Skip to content

Commit cfe3c8d

Browse files
committed
Remove operatorCondition lastTransitionTime
Problem: The OperatorCondition CRD has a requirement that the spec.overrides[*].lastTransitionTime is provided, which makes this API difficult for humans to use. Solution: Use yq to remove the requirement on the opeatorCondition.spec.overrides[*].lastTransitionTime field.
1 parent 0f2bc27 commit cfe3c8d

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ manifests: controller-gen ## Generate manifests e.g. CRD, RBAC etc
6767
@# Preserve fields for embedded metadata fields
6868
$(Q)$(YQ) w --inplace ./crds/operators.coreos.com_clusterserviceversions.yaml spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.install.properties.spec.properties.deployments.items.properties.spec.properties.template.properties.metadata.x-kubernetes-preserve-unknown-fields true
6969

70+
@# Remove OperatorCondition.spec.overrides[*].lastTransitionTime requirement
71+
$(Q)$(YQ) delete --inplace ./crds/operators.coreos.com_operatorconditions.yaml 'spec.versions[*].schema.openAPIV3Schema.properties.spec.properties.overrides.items.required(.==lastTransitionTime)'
72+
7073
@# Remove status subresource from the CRD manifests to ensure server-side apply works
7174
$(Q)for f in ./crds/*.yaml ; do $(YQ) d --inplace $$f status; done
7275

crds/operators.coreos.com_operatorconditions.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ spec:
4444
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
4545
type: object
4646
required:
47-
- lastTransitionTime
4847
- message
4948
- reason
5049
- status

0 commit comments

Comments
 (0)