Skip to content

Commit

Permalink
chore: Include status validation for v1 NodeClaim in v0.36.x (#1526)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam authored Aug 7, 2024
1 parent 8b55e39 commit dba50c3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ verify: ## Verify code. Includes codegen, docgen, dependencies, linting, formatt
hack/validation/requirements.sh
hack/validation/labels.sh
hack/validation/resources.sh
hack/validation/status.sh
hack/dependabot.sh
@# Use perl instead of sed due to https://stackoverflow.com/questions/4247068/sed-command-with-i-option-failing-on-mac-but-works-on-linux
@# We need to do this "sed replace" until controller-tools fixes this parameterized types issue: https://github.com/kubernetes-sigs/controller-tools/issues/756
Expand Down
3 changes: 3 additions & 0 deletions hack/validation/status.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
yq eval 'del(.spec.versions[0].schema.openAPIV3Schema.properties.status.properties.conditions.items.properties.reason.minLength)' -i pkg/apis/crds/karpenter.sh_nodeclaims.yaml
yq eval '.spec.versions[0].schema.openAPIV3Schema.properties.status.properties.conditions.items.properties.reason.pattern = "^([A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?|)$"' -i pkg/apis/crds/karpenter.sh_nodeclaims.yaml
yq eval '.spec.versions[0].schema.openAPIV3Schema.properties.status.properties.conditions.items.required = ["lastTransitionTime","status","type"]' -i pkg/apis/crds/karpenter.sh_nodeclaims.yaml
5 changes: 1 addition & 4 deletions pkg/apis/crds/karpenter.sh_nodeclaims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ spec:
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_])?$
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.
Expand All @@ -359,8 +358,6 @@ spec:
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
Expand Down

0 comments on commit dba50c3

Please sign in to comment.