Skip to content

Commit

Permalink
Fix CRDs to prepare for controller-runtime upgrade
Browse files Browse the repository at this point in the history
Bumping controller-runtime from 0.14.1 to 0.14.4 (#2261) seem to break our integration test:

```
      unable to install CRDs onto control plane: unable to create CRD instances: unable to create CRD "ephemeralrunners.actions.github.com": CustomResourceDefinition.apiextensions.k8s.io "ephemeralrunners.actions.github.com" is invalid: [spec.validation.openAPIV3Schema.properties[spec].properties[spec].properties[volumes].items.properties[ephemeral].properties[volumeClaimTemplate].properties[spec].properties[resources].properties[claims].x-kubernetes-list-type: Required value: must be map if x-kubernetes-list-map-keys is non-empty, spec.validation.openAPIV3Schema.properties[spec].properties[spec].properties[ephemeralContainers].items.properties[resources].properties[claims].x-kubernetes-list-type: Required value: must be map if x-kubernetes-list-map-keys is non-empty, spec.validation.openAPIV3Schema.properties[spec].properties[spec].properties[containers].items.properties[resources].properties[claims].x-kubernetes-list-type: Required value: must be map if x-kubernetes-list-map-keys is non-empty, spec.validation.openAPIV3Schema.properties[spec].properties[spec].properties[initContainers].items.properties[resources].properties[claims].x-kubernetes-list-type: Required value: must be map if x-kubernetes-list-map-keys is non-empty]
```

To be clear, the offending field, "x-kubernetes-list-map-keys", is new, and was NOT there before the upgrade.

We previously fixed a similar issue for "x-kubernetes-list-type" in #2132, by adding a post-processing step to our CRD generation make target to remove the offending fields.

This commit refactors the post-processing logic into a new make target. The CRD generation target uses the new target for removing both "x-kubernetes-list-type" and the new "x-kubernetes-list-map-keys" fields.

Ref #2132
Ref #2261
  • Loading branch information
mumoshu committed Feb 26, 2023
1 parent 7f0d7cf commit c6301b6
Showing 1 changed file with 51 additions and 46 deletions.
Loading

0 comments on commit c6301b6

Please sign in to comment.