-
Notifications
You must be signed in to change notification settings - Fork 225
SecretsManager - support ignore flag to noop if already exists #2457
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
SecretsManager - support ignore flag to noop if already exists #2457
Conversation
Reviewer's GuideAdds an IgnoreIfExists option to the SecretsManager.Store method, enforces mutual exclusivity with the existing Replace option, and updates Store logic to no-op when ignoring an already existing secret; test coverage is added for these scenarios. Class diagram for updated StoreOptions and SecretsManager.StoreclassDiagram
class StoreOptions {
map~string, string~ Labels
bool Replace
bool IgnoreIfExists
}
class SecretsManager {
Store(name string, data []byte, driverType string, options StoreOptions) (string, error)
}
SecretsManager --> StoreOptions : uses
Flow diagram for SecretsManager.Store logic with IgnoreIfExists and Replaceflowchart TD
A[Start Store] --> B{Data size valid?}
B -- No --> Z[Return errDataSize]
B -- Yes --> C{IgnoreIfExists && Replace?}
C -- Yes --> Y[Return errIgnoreIfExistsAndReplace]
C -- No --> D{Secret exists?}
D -- No --> E[Create new Secret]
D -- Yes --> F{Replace or IgnoreIfExists?}
F -- No --> G[Return errSecretNameInUse]
F -- IgnoreIfExists --> H[Return existing Secret ID]
F -- Replace --> I[Update existing Secret]
E --> J[Return new Secret ID]
I --> J
H --> J
G --> J
Y --> J
Z --> J
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Signed-off-by: Ygal Blum <[email protected]>
5baf72d to
e5e3f5e
Compare
|
Ephemeral COPR build failed. @containers/packit-build please check. |
1 similar comment
|
Ephemeral COPR build failed. @containers/packit-build please check. |
|
@Luap99 this is the PR to complement: containers/podman#26467 |
Luap99
left a comment
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.
LGTM
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99, sourcery-ai[bot], ygalblum The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@contaers/maintainers PTAL |
|
@containers/common-maintainers PTAL |
|
/lgtm |
Summary by Sourcery
Enhance SecretsManager.Store to support an ignore-if-exists flag with proper validation and add corresponding tests
New Features:
Bug Fixes:
Enhancements:
Tests: