Skip to content

feat: introduce priorityPolicy in merge rewrite#5329

Merged
Skarlso merged 6 commits intomainfrom
5326-priority-policy
Sep 25, 2025
Merged

feat: introduce priorityPolicy in merge rewrite#5329
Skarlso merged 6 commits intomainfrom
5326-priority-policy

Conversation

@riccardomc
Copy link
Copy Markdown
Member

@riccardomc riccardomc commented Sep 17, 2025

Problem Statement

Introduce priorityPolicy allowing user to control behavior when keys specified in priority list cannot be found in the source secret.

Related Issue

Implements #5326

Proposed Changes

The current behavior is to error out and fail the merge when a key specified in the priority list is not found in the source secret. This is retained as default behavior indicated as Strict. With the changes in this PR users can decide to ignore errors using IgnoreNotFound as priorityPolicy.

Checklist

  • I have read the contribution guidelines
  • All commits are signed with git commit --signoff
  • My changes have reasonable test coverage
  • All tests pass with make test
  • I ensured my PR is ready for review with make reviewable

Signed-off-by: Riccardo M. Cefala <riccardo.c@miro.com>
@github-actions github-actions bot added area/release Issues / Pull Requests related to releases kind/feature Categorizes issue or PR as related to a new feature. size/s labels Sep 17, 2025
@riccardomc riccardomc changed the title feat(release): introduce priorityPolicy in merge rewrite feat: introduce priorityPolicy in merge rewrite Sep 17, 2025
@riccardomc riccardomc removed the area/release Issues / Pull Requests related to releases label Sep 17, 2025
@riccardomc riccardomc changed the title feat: introduce priorityPolicy in merge rewrite [DRAFT] feat: introduce priorityPolicy in merge rewrite Sep 17, 2025
Signed-off-by: Riccardo M. Cefala <riccardo.c@miro.com>
@github-actions github-actions bot added the kind/documentation Categorizes issue or PR as related to documentation. label Sep 17, 2025
@Skarlso Skarlso moved this to In Progress in External Secrets Sep 17, 2025
@riccardomc riccardomc changed the title [DRAFT] feat: introduce priorityPolicy in merge rewrite feat: introduce priorityPolicy in merge rewrite Sep 17, 2025

// Used to define the policy when a key in the priority list does not exist in the input.
// +optional
// +kubebuilder:default="Strict"
Copy link
Copy Markdown
Contributor

@bharath-b-rh bharath-b-rh Sep 23, 2025

Choose a reason for hiding this comment

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

nit: Should we add an enum for supported values?
// +kubebuilder:validation:Enum:="IgnoreNotFound";"Strict"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think is a good idea, and to be honest I was even about to add it... however other Enums are also not specified, so in the end I didn't do it.

We could definitely take a sweep and do it for all Enums, however I'd rather do it in another PR.

I'll create an issue for that.

Copy link
Copy Markdown
Member Author

@riccardomc riccardomc Sep 25, 2025

Choose a reason for hiding this comment

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

Actually, I just went ahead and added them. There was only one missing from other APIs, so I just did it.

Signed-off-by: Riccardo M. Cefala <riccardo.cefala@gmail.com>
@riccardomc riccardomc marked this pull request as ready for review September 24, 2025 09:31
Signed-off-by: Riccardo M. Cefala <riccardo.c@miro.com>
@sonarqubecloud
Copy link
Copy Markdown

@Skarlso Skarlso merged commit 50af88e into main Sep 25, 2025
30 checks passed
@Skarlso Skarlso deleted the 5326-priority-policy branch September 25, 2025 14:53
@github-project-automation github-project-automation bot moved this from In Progress to Done in External Secrets Sep 25, 2025
SamuelMolling pushed a commit to SamuelMolling/external-secrets that referenced this pull request Oct 24, 2025
* introduce priorityPolicy in merge rewrite

Signed-off-by: Riccardo M. Cefala <riccardo.c@miro.com>

* make reviewable

Signed-off-by: Riccardo M. Cefala <riccardo.c@miro.com>

* update documentation for priorityPolicy

Signed-off-by: Riccardo M. Cefala <riccardo.cefala@gmail.com>

* add some missing kubebuilder Enum validation directives

Signed-off-by: Riccardo M. Cefala <riccardo.c@miro.com>

---------

Signed-off-by: Riccardo M. Cefala <riccardo.c@miro.com>
Signed-off-by: Riccardo M. Cefala <riccardo.cefala@gmail.com>
Signed-off-by: Samuel Molling <samuelmolling@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. size/m size/s

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants