Skip to content

Commit

Permalink
chore: check .spec.versions length
Browse files Browse the repository at this point in the history
  • Loading branch information
tallaxes committed Feb 6, 2025
1 parent 1abebb7 commit a74c7c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hack/validation/labels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ rule=${rule//\"/\\\"} # escape double quotes
rule=${rule//$'\n'/} # remove newlines
rule=$(echo "$rule" | tr -s ' ') # remove extra spaces

# check that .spec.versions has 2 entries
[[ $(yq e '.spec.versions | length' pkg/apis/crds/karpenter.sh_nodepools.yaml) -eq 2 ]] || { echo "expected two versions"; exit 1; }

# nodepool
# v1beta1
printf -v expr '.spec.versions[1].schema.openAPIV3Schema.properties.spec.properties.template.properties.metadata.properties.labels.x-kubernetes-validations +=
Expand Down
4 changes: 4 additions & 0 deletions hack/validation/requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ rule=${rule//\"/\\\"} # escape double quotes
rule=${rule//$'\n'/} # remove newlines
rule=$(echo "$rule" | tr -s ' ') # remove extra spaces

# check that .spec.versions has 2 entries
[[ $(yq e '.spec.versions | length' pkg/apis/crds/karpenter.sh_nodepools.yaml) -eq 2 ]] || { echo "expected two versions"; exit 1; }
[[ $(yq e '.spec.versions | length' pkg/apis/crds/karpenter.sh_nodeclaims.yaml) -eq 2 ]] || { echo "expected two versions"; exit 1; }

# v1beta1
# nodeclaim
printf -v expr '.spec.versions[1].schema.openAPIV3Schema.properties.spec.properties.requirements.items.properties.key.x-kubernetes-validations +=
Expand Down

0 comments on commit a74c7c2

Please sign in to comment.