Skip to content

Commit

Permalink
Additional MOSC/MOSB updates
Browse files Browse the repository at this point in the history
Mostly fixes around validation and godocs. Added some additional test
cases.
  • Loading branch information
yuqi-zhang committed Dec 3, 2024
1 parent 7ff1e4d commit 8f073d7
Show file tree
Hide file tree
Showing 14 changed files with 756 additions and 586 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,129 @@ 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/mco/renderedImage:latest
expected: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSBuild
metadata:
name: foobar
spec:
desiredConfig:
name: rendered-worker-abcd
machineOSConfig:
name: worker
renderedImagePushspec: quay.io/mco/renderedImage:latest
onCreate:
- name: Fail on invalid buildEnd time
initial: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSBuild
metadata:
name: foobar
spec:
desiredConfig:
name: rendered-worker-abcd
machineOSConfig:
name: worker
renderedImagePushspec: quay.io/mco/renderedImage:latest
status:
buildStart: 2024-11-28T10:00:00Z
buildEnd: 2024-11-28T09:00:00Z
expectedError: "Invalid value: \"string\": buildEnd must be after buildStart"

- 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/mco/renderedImage:latest
expected: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSBuild
metadata:
name: foobar
spec:
desiredConfig:
name: rendered-worker-abcd
machineOSConfig:
name: worker
renderedImagePushSpec: quay.io/mco/renderedImage:latest
- name: Fail on invalid buildEnd time
initial: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSBuild
metadata:
name: foobar
spec:
desiredConfig:
name: rendered-worker-abcd
machineOSConfig:
name: worker
renderedImagePushSpec: quay.io/mco/renderedImage:latest
status:
builder:
imageBuilderType: Job
buildStart: 2024-11-28T10:00:00Z
buildEnd: 2024-11-28T09:00:00Z
expectedError: "status.BuildEnd: Invalid value: \"string\": buildEnd must be after buildStart"
onUpdate:
- name: Failed builds cannot change status
initial: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSBuild
metadata:
name: foobar
spec:
desiredConfig:
name: rendered-worker-abcd
machineOSConfig:
name: worker
renderedImagePushSpec: quay.io/mco/renderedImage:latest
status:
builder:
imageBuilderType: Job
conditions:
- type: Failed
status: "True"
reason: "Reason"
message: "Message"
lastTransitionTime: "2024-11-28T10:00:00Z"
updated: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSBuild
metadata:
name: foobar
spec:
desiredConfig:
name: rendered-worker-abcd
machineOSConfig:
name: worker
renderedImagePushSpec: quay.io/mco/renderedImage:latest
status:
builder:
imageBuilderType: Job
conditions:
- type: Failed
status: "False"
reason: "Reason"
message: "Message"
lastTransitionTime: "2024-11-28T10:00:00Z"
expectedError: "status.conditions[0].status: Invalid value: \"string\": once a Failed condition is set, conditions are immutable"
- name: Interrupted builds cannot change status
initial: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSBuild
metadata:
name: foobar
spec:
desiredConfig:
name: rendered-worker-abcd
machineOSConfig:
name: worker
renderedImagePushSpec: quay.io/mco/renderedImage:latest
status:
builder:
imageBuilderType: Job
conditions:
- type: Interrupted
status: "True"
reason: "Reason"
message: "Message"
lastTransitionTime: "2024-11-28T10:00:00Z"
updated: |
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineOSBuild
metadata:
name: foobar
spec:
desiredConfig:
name: rendered-worker-abcd
machineOSConfig:
name: worker
renderedImagePushSpec: quay.io/mco/renderedImage:latest
status:
builder:
imageBuilderType: Job
conditions:
- type: Succeeded
status: "True"
reason: "Reason"
message: "Message"
lastTransitionTime: "2024-11-28T10:00:00Z"
expectedError: "status.conditions[0].status: Invalid value: \"string\": once an Interrupted condition is set, conditions are immutable"
Loading

0 comments on commit 8f073d7

Please sign in to comment.