Skip to content
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

MCO-1443: Promote onclusterbuild to GA #2090

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
6 changes: 5 additions & 1 deletion hack/update-payload-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ crd_globs="\
operator/v1/zz_generated.crd-manifests/0000_25_kube-controller-manager_01_kubecontrollermanagers*.crd.yaml
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/v1/zz_generated.crd-manifests/0000_80_machine-config_01_containerruntimeconfigs*.crd.yaml
machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs*.crd.yaml
machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_kubeletconfigs*.crd.yaml
machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigpools*.crd.yaml
machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigs*.crd.yaml
machineconfiguration/v1alpha1/zz_generated.crd-manifests/*.crd.yaml
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_clusterimagepolicies*.crd.yaml
Expand Down
4 changes: 4 additions & 0 deletions machineconfiguration/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&MachineConfigList{},
&MachineConfigPool{},
&MachineConfigPoolList{},
&MachineOSConfig{},
&MachineOSConfigList{},
&MachineOSBuild{},
&MachineOSBuildList{},
)

metav1.AddToGroupVersion(scheme, GroupVersion)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "MachineOSBuild"
crdName: machineosbuilds.machineconfiguration.openshift.io
featureGate: OnClusterBuild
tests:
onCreate:
- name: Should be able to create a minimal MachineOSBuild
initial: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSBuild
metadata:
name: foobar
spec:
desiredConfig:
name: rendered-worker-abcd
machineOSConfig:
name: worker
renderedImagePushspec: quay.io/cdoern/mco:latest
expected: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSBuild
metadata:
name: foobar
spec:
desiredConfig:
name: rendered-worker-abcd
machineOSConfig:
name: worker
renderedImagePushspec: quay.io/cdoern/mco:latest

Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "MachineOSConfig"
crdName: machineosconfigs.machineconfiguration.openshift.io
featureGate: OnClusterBuild
tests:
onCreate:
- name: Should be able to create a minimal MachineOSConfig
initial: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSConfig
metadata:
name: foobar
spec:
machineConfigPool:
name: worker
buildInputs:
imageBuilder:
imageBuilderType: JobImageBuilder
baseOSImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
baseImagePullSecret:
name: foo
baseOSExtensionsImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
renderedImagePushSecret:
name: foo
renderedImagePushspec: quay.io/cdoern/renderedImg:latest
buildOutputs:
currentImagePullSecret:
name: foo
expected: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSConfig
metadata:
name: foobar
spec:
machineConfigPool:
name: worker
buildInputs:
imageBuilder:
imageBuilderType: JobImageBuilder
baseOSImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
baseImagePullSecret:
name: foo
baseOSExtensionsImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
renderedImagePushSecret:
name: foo
renderedImagePushspec: quay.io/cdoern/renderedImg:latest
buildOutputs:
currentImagePullSecret:
name: foo
onCreate:
- name: Should be able to create a MachineOSConfig with a renderedImagePushspec that contains a port
initial: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSConfig
metadata:
name: foobar
spec:
machineConfigPool:
name: worker
buildInputs:
imageBuilder:
imageBuilderType: JobImageBuilder
baseOSImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
baseImagePullSecret:
name: foo
baseOSExtensionsImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
renderedImagePushSecret:
name: foo
renderedImagePushspec: registry.test.example.local:5000/test/custom-os-image:v0.1
buildOutputs:
currentImagePullSecret:
name: foo
expected: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSConfig
metadata:
name: foobar
spec:
machineConfigPool:
name: worker
buildInputs:
imageBuilder:
imageBuilderType: JobImageBuilder
baseOSImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
baseImagePullSecret:
name: foo
baseOSExtensionsImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
renderedImagePushSecret:
name: foo
renderedImagePushspec: registry.test.example.local:5000/test/custom-os-image:v0.1
buildOutputs:
currentImagePullSecret:
name: foo
- name: Fail on invalid rendered image pushspec
initial: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSConfig
metadata:
name: foobar
spec:
machineConfigPool:
name: worker
buildInputs:
imageBuilder:
imageBuilderType: JobImageBuilder
baseOSImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
baseImagePullSecret:
name: foo
baseOSExtensionsImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
renderedImagePushSecret:
name: foo
renderedImagePushspec: foo.bar
buildOutputs:
currentImagePullSecret:
name: foo
expectedError: "Invalid value: \"string\": the OCI Image name should follow the host[:port][/namespace]/name format, resembling a valid URL without the scheme"
- name: Fail on invalid base image pullspec
initial: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSConfig
metadata:
name: foobar
spec:
machineConfigPool:
name: worker
buildInputs:
imageBuilder:
imageBuilderType: JobImageBuilder
baseOSImagePullspec: foo.bar
baseImagePullSecret:
name: foo
baseOSExtensionsImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
renderedImagePushSecret:
name: foo
renderedImagePushspec: quay.io/cdoern/renderedImg:latest
buildOutputs:
currentImagePullSecret:
name: foo
expectedError: "Invalid value: \"string\": the OCI Image name should follow the host[:port][/namespace]/name format, resembling a valid URL without the scheme"
- name: Allows for an empty pull secret
initial: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSConfig
metadata:
name: foobar
spec:
machineConfigPool:
name: worker
buildInputs:
imageBuilder:
imageBuilderType: JobImageBuilder
baseOSImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
baseOSExtensionsImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
renderedImagePushSecret:
name: foo
renderedImagePushspec: quay.io/cdoern/renderedImg:latest
buildOutputs:
currentImagePullSecret:
name: foo
expected: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSConfig
metadata:
name: foobar
spec:
machineConfigPool:
name: worker
buildInputs:
imageBuilder:
imageBuilderType: JobImageBuilder
baseOSImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
baseOSExtensionsImagePullspec: example.io/my-project/image-v1.0_23@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
renderedImagePushSecret:
name: foo
renderedImagePushspec: quay.io/cdoern/renderedImg:latest
buildOutputs:
currentImagePullSecret:
name: foo
Loading