Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion hack/update-payload-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ crd_globs="\
config/v1/zz_generated.crd-manifests/0000_10_openshift-controller-manager_01_builds*.crd.yaml
operator/v1/zz_generated.crd-manifests/0000_50_openshift-controller-manager_02_openshiftcontrollermanagers*.crd.yaml
machineconfiguration/v1/zz_generated.crd-manifests/*.crd.yaml
machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages*.crd.yaml

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@andfasano The v1 InternalReleaseImage CRDs are already covered by the existing catch-all pattern at line 25. The removed line was specifically needed for v1alpha1 to pick only the InternalReleaseImage CRDs from v1alpha1. Cc @sadasu

operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations*.crd.yaml
config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitoring*.crd.yaml
config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_pkis*.crd.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
feature-gate.release.openshift.io/NoRegistryClusterInstall: "true"
name: internalreleaseimages.machineconfiguration.openshift.io
spec:
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: |-
InternalReleaseImage is used to keep track and manage a set
of release bundles (OCP and OLM operators images) that are stored
into the control planes nodes.

Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: spec describes the configuration of this internal release
image.
properties:
releases:
description: |-
releases is a list of release bundle identifiers that the user wants to
add/remove to/from the control plane nodes.
Entries must be unique, keyed on the name field.
releases must contain at least one entry and must not exceed 16 entries.
items:
description: |-
InternalReleaseImageRef is used to provide a simple reference for a release
bundle. Currently it contains only the name field.
properties:
name:
description: |-
name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long.
The expected name format is ocp-release-bundle-<version>-<arch|stream>.
maxLength: 64
minLength: 1
type: string
x-kubernetes-validations:
- message: must be ocp-release-bundle-<version>-<arch|stream>
and <= 64 chars
rule: self.matches('^ocp-release-bundle-[0-9]+\\.[0-9]+\\.[0-9]+-[A-Za-z0-9._-]+$')
required:
- name
type: object
maxItems: 16
minItems: 1
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
required:
- releases
type: object
status:
description: status describes the last observed state of this internal
release image.
properties:
conditions:
description: |-
conditions represent the observations of the InternalReleaseImage controller current state.
Valid types are: Degraded.
If Degraded is true, that means something has gone wrong in the controller.
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
maxItems: 20
minItems: 1
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
releases:
description: |-
releases is a list of the release bundles currently owned and managed by the
cluster.
A release bundle content could be safely pulled only when its Conditions field
contains at least an Available entry set to "True" and Degraded to "False".
Entries must be unique, keyed on the name field.
releases must contain at least one entry and must not exceed 32 entries.
items:
properties:
conditions:
description: |-
conditions represent the observations of an internal release image current state. Valid types are:
Mounted, Installing, Available, Removing and Degraded.

If Mounted is true, that means that a valid ISO has been discovered and mounted on one of the cluster nodes.
If Installing is true, that means that a new release bundle is currently being copied on one (or more) cluster nodes, and not yet completed.
If Available is true, it means that the release has been previously installed on all the cluster nodes, and it can be used.
If Removing is true, it means that a release deletion is in progress on one (or more) cluster nodes, and not yet completed.
If Degraded is true, that means something has gone wrong (possibly on one or more cluster nodes).

In general, after installing a new release bundle, it is required to wait for the Conditions "Available" to become "True" (and all
the other conditions to be equal to "False") before being able to pull its content.
items:
description: Condition contains details for one aspect of
the current state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False,
Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
maxItems: 5
minItems: 1
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
image:
description: |-
image is an OCP release image referenced by digest.
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
The length of the whole spec must be between 1 to 447 characters.
The field is optional, and it will be provided after a release will be successfully installed.
maxLength: 447
minLength: 1
type: string
x-kubernetes-validations:
- message: the OCI Image reference must end with a valid '@sha256:<digest>'
suffix, where '<digest>' is 64 characters long
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
- message: the OCI Image name should follow the host[:port][/namespace]/name
format, resembling a valid URL without the scheme
rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
name:
description: |-
name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long.
The expected name format is ocp-release-bundle-<version>-<arch|stream>.
maxLength: 64
minLength: 1
type: string
x-kubernetes-validations:
- message: must be ocp-release-bundle-<version>-<arch|stream>
and <= 64 chars
rule: self.matches('^ocp-release-bundle-[0-9]+\\.[0-9]+\\.[0-9]+-[A-Za-z0-9._-]+$')
required:
- name
type: object
maxItems: 32
minItems: 1
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
required:
- releases
type: object
required:
- metadata
- spec
type: object
x-kubernetes-validations:
- message: internalreleaseimage is a singleton, .metadata.name must be 'cluster'
rule: self.metadata.name == 'cluster'
served: true
storage: false
subresources:
status: {}
2 changes: 2 additions & 0 deletions machineconfiguration/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&ContainerRuntimeConfigList{},
&ControllerConfig{},
&ControllerConfigList{},
&InternalReleaseImage{},
&InternalReleaseImageList{},
&KubeletConfig{},
&KubeletConfigList{},
&MachineConfig{},
Expand Down
Loading