-
Notifications
You must be signed in to change notification settings - Fork 73
🌱 Externalize CER phase objects into Secrets #2595
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -392,14 +392,29 @@ type ClusterExtensionRevisionPhase struct { | |
|
|
||
| // ClusterExtensionRevisionObject represents a Kubernetes object to be applied as part | ||
| // of a phase, along with its collision protection settings. | ||
| // | ||
| // Exactly one of object or ref must be set. | ||
| // | ||
| // +kubebuilder:validation:XValidation:rule="has(self.object) != has(self.ref)",message="exactly one of object or ref must be set" | ||
| type ClusterExtensionRevisionObject struct { | ||
| // object is a required embedded Kubernetes object to be applied. | ||
| // object is an optional embedded Kubernetes object to be applied. | ||
| // | ||
| // Exactly one of object or ref must be set. | ||
| // | ||
| // This object must be a valid Kubernetes resource with apiVersion, kind, and metadata fields. | ||
| // | ||
| // +kubebuilder:validation:EmbeddedResource | ||
| // +kubebuilder:pruning:PreserveUnknownFields | ||
| Object unstructured.Unstructured `json:"object"` | ||
| // +optional | ||
| Object unstructured.Unstructured `json:"object,omitzero"` | ||
|
|
||
| // ref is an optional reference to a Secret that holds the serialized | ||
| // object manifest. | ||
| // | ||
| // Exactly one of object or ref must be set. | ||
| // | ||
| // +optional | ||
| Ref ObjectSourceRef `json:"ref,omitzero"` | ||
|
|
||
| // collisionProtection controls whether the operator can adopt and modify objects | ||
| // that already exist on the cluster. | ||
|
|
@@ -425,6 +440,33 @@ type ClusterExtensionRevisionObject struct { | |
| CollisionProtection CollisionProtection `json:"collisionProtection,omitempty"` | ||
| } | ||
|
|
||
| // ObjectSourceRef references content within a Secret that contains a | ||
| // serialized object manifest. | ||
| type ObjectSourceRef struct { | ||
| // name is the name of the referenced Secret. | ||
| // | ||
| // +required | ||
| // +kubebuilder:validation:MinLength=1 | ||
| // +kubebuilder:validation:MaxLength=253 | ||
| Name string `json:"name"` | ||
|
|
||
| // namespace is the namespace of the referenced Secret. | ||
| // When empty, defaults to the OLM system namespace during ref resolution. | ||
| // | ||
| // +optional | ||
| // +kubebuilder:validation:MaxLength=63 | ||
| Namespace string `json:"namespace,omitempty"` | ||
|
Contributor
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. From the CER as its own thing perspective, should we make namespace required and drop the relationship with OLM? |
||
|
|
||
| // key is the data key within the referenced Secret containing the | ||
| // object manifest content. The value at this key must be a | ||
| // JSON-serialized Kubernetes object manifest. | ||
| // | ||
| // +required | ||
| // +kubebuilder:validation:MinLength=1 | ||
| // +kubebuilder:validation:MaxLength=253 | ||
| Key string `json:"key"` | ||
| } | ||
|
|
||
| // CollisionProtection specifies if and how ownership collisions are prevented. | ||
| type CollisionProtection string | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Does omission of
namespaceimply OLM system namespace? If so could we add a comment here for that?