Small utility that removes CRD versions from status.storedVersion
. It essentially cuts
status:
storedVersions:
- v1alpha1
- v1beta1
- v1
down to
status:
storedVersions:
- v1
This allows updating the CRD to an newer version where v1alpha1
has been removed.
Otherwise kubectl
might respond with something like
The CustomResourceDefinition is invalid: status.storedVersions[0]: Invalid value: "v1alpha1": must appear in spec.versions
go install github.com/MisterMX/k8s-crd-storedversion-cleanup/cmd/k8s-crd-storedversion-cleanup@latest
- Clone this repo
- Run
go run cmd/k8s-crd-storedversion-cleanup/main.go
Optional parameters:
--group <group>
thespec.group
that should be filtered. Matches to the suffix soapi.io
goes fora.api.io
andb.api.io