-
Notifications
You must be signed in to change notification settings - Fork 74
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
Improve OpenAPI validation and SSA Golang markers #477
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,9 @@ type BundleList struct { | |
// BundleSpec defines the desired state of a Bundle. | ||
type BundleSpec struct { | ||
// Sources is a set of references to data whose data will sync to the target. | ||
// +listType=atomic | ||
// +kubebuilder:validation:MinItems=1 | ||
// +kubebuilder:validation:MaxItems=100 | ||
Sources []BundleSource `json:"sources"` | ||
|
||
// Target is the target location in all namespaces to sync source data to. | ||
|
@@ -67,6 +70,7 @@ type BundleSpec struct { | |
|
||
// BundleSource is the set of sources whose data will be appended and synced to | ||
// the BundleTarget in all Namespaces. | ||
// +structType=atomic | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
type BundleSource struct { | ||
// ConfigMap is a reference (by name) to a ConfigMap's `data` key(s), or to a | ||
// list of ConfigMap's `data` key(s) using label selector, in the trust Namespace. | ||
|
@@ -99,11 +103,13 @@ type BundleSource struct { | |
type BundleTarget struct { | ||
// ConfigMap is the target ConfigMap in Namespaces that all Bundle source | ||
// data will be synced to. | ||
// +optional | ||
ConfigMap *KeySelector `json:"configMap,omitempty"` | ||
|
||
// Secret is the target Secret that all Bundle source data will be synced to. | ||
// Using Secrets as targets is only supported if enabled at trust-manager startup. | ||
// By default, trust-manager has no permissions for writing to secrets and can only read secrets in the trust namespace. | ||
// +optional | ||
Secret *KeySelector `json:"secret,omitempty"` | ||
|
||
// AdditionalFormats specifies any additional formats to write to the target | ||
|
@@ -121,12 +127,16 @@ type AdditionalFormats struct { | |
// JKS requests a JKS-formatted binary trust bundle to be written to the target. | ||
// The bundle has "changeit" as the default password. | ||
// For more information refer to this link https://cert-manager.io/docs/faq/#keystore-passwords | ||
// +optional | ||
JKS *JKS `json:"jks,omitempty"` | ||
// PKCS12 requests a PKCS12-formatted binary trust bundle to be written to the target. | ||
// The bundle is by default created without a password. | ||
// +optional | ||
PKCS12 *PKCS12 `json:"pkcs12,omitempty"` | ||
} | ||
|
||
// JKS specifies additional target JKS files | ||
// +structType=atomic | ||
type JKS struct { | ||
KeySelector `json:",inline"` | ||
|
||
|
@@ -138,6 +148,8 @@ type JKS struct { | |
Password *string `json:"password"` | ||
} | ||
|
||
// PKCS12 specifies additional target PKCS#12 files | ||
// +structType=atomic | ||
type PKCS12 struct { | ||
KeySelector `json:",inline"` | ||
|
||
|
@@ -158,10 +170,12 @@ type NamespaceSelector struct { | |
|
||
// SourceObjectKeySelector is a reference to a source object and its `data` key(s) | ||
// in the trust Namespace. | ||
// +structType=atomic | ||
type SourceObjectKeySelector struct { | ||
// Name is the name of the source object in the trust Namespace. | ||
// This field must be left empty when `selector` is set | ||
//+optional | ||
// +kubebuilder:validation:MinLength=1 | ||
Name string `json:"name,omitempty"` | ||
|
||
// Selector is the label selector to use to fetch a list of objects. Must not be set | ||
|
@@ -171,6 +185,7 @@ type SourceObjectKeySelector struct { | |
|
||
// Key of the entry in the object's `data` field to be used. | ||
//+optional | ||
// +kubebuilder:validation:MinLength=1 | ||
inteon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Key string `json:"key,omitempty"` | ||
|
||
// IncludeAllKeys is a flag to include all keys in the object's `data` field to be used. False by default. | ||
|
@@ -182,6 +197,7 @@ type SourceObjectKeySelector struct { | |
// KeySelector is a reference to a key for some map data object. | ||
type KeySelector struct { | ||
// Key is the key of the entry in the object's `data` field to be used. | ||
// +kubebuilder:validation:MinLength=1 | ||
Key string `json:"key"` | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
MaxItems is added to pass the cost requirements when CEL validations are added to the API.