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

Only check for secret groups during registration context #2381

Conversation

thomasjpfan
Copy link
Member

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 when Execution.mode is None. I added more tests to make sure that the groups are not checked during execution time.

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
Copy link
Contributor

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

Copy link
Member Author

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:

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.

Signed-off-by: Thomas J. Fan <[email protected]>
@eapolinario eapolinario merged commit e4ba876 into flyteorg:master Apr 26, 2024
47 checks passed
austin362667 pushed a commit to austin362667/flytekit that referenced this pull request May 9, 2024
* 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]>
austin362667 pushed a commit to austin362667/flytekit that referenced this pull request May 10, 2024
* 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]>
fiedlerNr9 pushed a commit that referenced this pull request Jul 25, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants