-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
WIP: fix(Backend+SDK): Update kubernetes.use_secret_as_volume to accept secret name dynamically at runtime #11039
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,6 +147,34 @@ def my_pipeline(): | |
} | ||
} | ||
|
||
def test_with_secret_name_param(self): | ||
@dsl.pipeline | ||
def my_pipeline(secret_name: str = 'my-secret'): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is missing a test that assert from the value There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem here is the pipeline spec generated from this compile step has the name stored in as a variable under the
I tried a bunch of combinations to have the The tests only work when Note that the assert statement still verifies that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for posterity
we discovered today that that's not how this works. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also for posterity, the above comment is also incorrect 😅
|
||
task = comp() | ||
kubernetes.use_secret_as_volume( | ||
task, | ||
secret_name=secret_name, | ||
mount_path='secretpath', | ||
) | ||
|
||
assert json_format.MessageToDict(my_pipeline.platform_spec) == { | ||
'platforms': { | ||
'kubernetes': { | ||
'deploymentSpec': { | ||
'executors': { | ||
'exec-comp': { | ||
'secretAsVolume': [{ | ||
'secretName': '{{secret_name}}', | ||
'mountPath': 'secretpath', | ||
'optional': False | ||
}] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
def test_preserves_secret_as_env(self): | ||
# checks that use_secret_as_volume respects previously set secrets as env | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in the community meeting, we suggest follow the "inject inputs" pattern to accept dynamic runtime value.
Example PRs on "injecting inputs":
#10435
#5183