Skip to content

Conversation

@cbandy
Copy link
Member

@cbandy cbandy commented Feb 19, 2025

This adds validation to the recurring pattern of selecting a single value from a Secret. Note that the name field is now required.

Secrets are best mounted as files, and the logic for translating these references into volume projections is now consolidated in two exported methods.

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • Bug fix
  • Other

What is the current behavior (link to any open issues here)?

Secret name is not validated as required, and forgetting to add it causes reconciliation errors.

What is the new behavior (if this is a feature change)?

  • Breaking change (fix or feature that would cause existing functionality to change)

The field is now required, but clusters that lack it are broken anyway.

Copy link
Contributor

@dsessler7 dsessler7 left a comment

Choose a reason for hiding this comment

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

LGTM

This adds validation to the recurring pattern of selecting a single
value from a Secret. Note that the "name" field is now required.

Secrets are best mounted as files, and the logic for translating these
references into volume projections is now consolidated in two exported
methods.
@cbandy cbandy force-pushed the shared-api-structs branch from 5b40675 to dd23d3e Compare February 20, 2025 23:28
type: string
x-kubernetes-validations:
- message: cannot be "." or start with ".."
rule: self != "." && !self.startsWith("..")
Copy link
Member Author

Choose a reason for hiding this comment

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

📝 Having a CEL rule felt like a bit much, but if we allow these values up-front, then we'll error trying to send them into volume source, secret ref, etc during reconcile.

@cbandy cbandy merged commit 85636a8 into CrunchyData:main Feb 21, 2025
19 checks passed
@cbandy cbandy deleted the shared-api-structs branch February 21, 2025 13:52
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