-
Notifications
You must be signed in to change notification settings - Fork 305
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
Only check for secret groups during registration context #2381
Only check for secret groups during registration context #2381
Conversation
Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
if get_plugin().secret_requires_group() and self.group is None: | ||
# Only check for the groups during registration. | ||
execution = FlyteContextManager.current_context().execution_state | ||
in_registration_context = execution.mode is None |
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.
Should we have this to be until function which can be used at other places if needed to determine if we are in registration context
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.
If this comes up more often, I would add a new is_registration
method to ExecutionState
:
flytekit/flytekit/core/context_manager.py
Line 453 in afa1fc7
class ExecutionState(object): |
As for this PR, I rather not add public API for now. This is first time in the codebase, we check for execution.mode is None
.
…ts_groups_not_required Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
* Only check for secret groups during registration context Signed-off-by: Thomas J. Fan <[email protected]> * Only check for secrets during registration Signed-off-by: Thomas J. Fan <[email protected]> * Adds test to check behavior Signed-off-by: Thomas J. Fan <[email protected]> * Lint Signed-off-by: Thomas J. Fan <[email protected]> --------- Signed-off-by: Thomas J. Fan <[email protected]>
* Only check for secret groups during registration context Signed-off-by: Thomas J. Fan <[email protected]> * Only check for secrets during registration Signed-off-by: Thomas J. Fan <[email protected]> * Adds test to check behavior Signed-off-by: Thomas J. Fan <[email protected]> * Lint Signed-off-by: Thomas J. Fan <[email protected]> --------- Signed-off-by: Thomas J. Fan <[email protected]>
* Only check for secret groups during registration context Signed-off-by: Thomas J. Fan <[email protected]> * Only check for secrets during registration Signed-off-by: Thomas J. Fan <[email protected]> * Adds test to check behavior Signed-off-by: Thomas J. Fan <[email protected]> * Lint Signed-off-by: Thomas J. Fan <[email protected]> --------- Signed-off-by: Thomas J. Fan <[email protected]> Signed-off-by: Jan Fiedler <[email protected]>
Tracking issue
Follow up to #2355
Why are the changes needed?
This is required to make sure that the secrets groups check never happens during execution time.
What changes were proposed in this pull request?
With this PR, the secrets group check only happens during registration time.
How was this patch tested?
There are current tests that checks
Secrets
construction whenExecution.mode
isNone
. I added more tests to make sure that the groups are not checked during execution time.