Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to read the operator namespace from an envirnment variable… #51

Closed
wants to merge 1 commit into from

Conversation

nunnatsa
Copy link
Contributor

…, or from a non-standard SA file.

While developing an operator, it is impossible to run from a local environment variable if the code
is trying to access the namespace file. For example, calling the conditions.NewCondition function
will return an error when the operator is running in a development environment.

This PR add to options to override the hard-coded path to the namespace file with another location:

  1. by setting the new OPERATOR_NAMESPACE environment variable to the required namespace.
  2. by setting the new SA_FILE_PATH environment variable to the local path of the namespace file.

If both new environment variables are set, the namespace will be taken from the OPERATOR_NAMESPACE
environment variable.

Fixes #50

Signed-off-by: Nahshon Unna-Tsameret [email protected]

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign camilamacedo86 after the PR has been reviewed.
You can assign the PR to them by writing /assign @camilamacedo86 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link

Hi @nunnatsa. Thanks for your PR.

I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 24, 2021
…, or from a non-standard SA file.

While developing an operator, it is impossible to run from a local environment variable if the code
is trying to access the namespace file. For example, calling the `conditions.NewCondition` function
will return an error when the operator is running in a development environment.

This PR add to options to override the hard-coded path to the namespace file with another location:
1. by setting the new `OPERATOR_NAMESPACE` environment variable to the required namespace.
2. by setting the new `SA_FILE_PATH` environment variable to the local path of the namespace file.

If both new environment variables are set, the namespace will be taken from the `OPERATOR_NAMESPACE`
environment variable.

Fixes operator-framework#50

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 507395819

  • 6 of 8 (75.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.6%) to 78.043%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/utils/utils.go 6 8 75.0%
Totals Coverage Status
Change from base Build 496698663: 0.6%
Covered Lines: 327
Relevant Lines: 419

💛 - Coveralls

@estroz
Copy link
Member

estroz commented Jan 25, 2021

Closing, see #50 (comment)

/close

@openshift-ci-robot
Copy link

@estroz: Closed this PR.

In response to this:

Closing, see #50 (comment)

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't run operators locally, when using the conditions package
4 participants