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

docs: Fix environment variables names #11013

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

diegolovison
Copy link
Contributor

@diegolovison diegolovison commented Jul 16, 2024

Description of your changes:
Fix environment variable names

The current code is using os.environ['my-secret'] but we are setting the environment variable to be SECRET_VAR

    kubernetes.use_secret_as_env(task,
                                 secret_name='my-secret',
                                 secret_key_to_env={'password': 'SECRET_VAR'})

The code os.environ['my-secret'] will return an error

print(os.environ['my-secret'])
File "/usr/lib64/python3.9/os.py", line 679, in __getitem__
raise KeyError(key) from None
KeyError: 'my-secret'

The goal of this PR is to fix the doc issue.

Checklist:

Copy link

@diegolovison: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
kfp-kubernetes-execution-tests 2254d93 link false /test kfp-kubernetes-execution-tests

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-sigs/prow repository. I understand the commands that are listed here.

Copy link
Contributor

@DharmitD DharmitD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this out by creating a pipeline and a run using a yaml created out of the previous example snippet. Observed this error on run creation:

File "/tmp/tmp.j8rF6VFIdK/ephemeral_component.py", line 9, in print_secret
print(os.environ['my-secret'])
File "/usr/lib64/python3.9/os.py", line 679, in __getitem__
raise KeyError(key) from None
KeyError: 'my-secret'

Generated a yaml out of this fixed example snippet, created a pipeline and run. Run completed successfully.

[KFP Executor 2024-07-16 20:09:45,963 INFO]: Looking for component `print_secret` in --component_module_path `/tmp/tmp.Lz61ANvhsm/ephemeral_component.py`
[KFP Executor 2024-07-16 20:09:45,963 INFO]: Loading KFP component "print_secret" from /tmp/tmp.Lz61ANvhsm/ephemeral_component.py (directory "/tmp/tmp.Lz61ANvhsm" and module name "ephemeral_component")

/lgtm

Copy link
Contributor

@gregsheremeta gregsheremeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@gregsheremeta
Copy link
Contributor

forwarding to @chensun for final review and approval :)

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chensun

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

The pull request process is described 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

@DharmitD
Copy link
Contributor

DharmitD commented Aug 6, 2024

@diegolovison could you please rebase? That should remove the failing Prow test and this PR shall get merged.

Signed-off-by: Diego Lovison <[email protected]>
Copy link
Contributor

@hbelmiro hbelmiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Aug 7, 2024
@google-oss-prow google-oss-prow bot merged commit 99bd234 into kubeflow:master Aug 7, 2024
8 checks passed
droctothorpe pushed a commit to droctothorpe/pipelines that referenced this pull request Aug 13, 2024
R3hankhan123 pushed a commit to R3hankhan123/pipelines that referenced this pull request Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants