Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix DataPlane only kustomize for installing CRD #232

Merged
merged 2 commits into from
May 7, 2024

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Apr 26, 2024

What this PR does / why we need it:

Fix DataPlane only kustomize for installing CRD which was introduced in #69

k kustomize https://github.com/kong/gateway-operator/config/crd/dataplane/
error: accumulating resources: accumulation err='accumulating resources from '../bases/gateway-operator.konghq.com_dataplanes.yaml': security; file '/private/var/folders/0m/_63w01516tgf3cftmp9h7ylm0000gn/T/kustomize-5188523/config/crd/bases/gateway-operator.konghq.com_dataplanes.yaml' is not in or below '/private/var/folders/0m/_63w01516tgf3cftmp9h7ylm0000gn/T/kustomize-5188523/config/crd/dataplane'': must build at directory: '/private/var/folders/0m/_63w01516tgf3cftmp9h7ylm0000gn/T/kustomize-5188523/config/crd/bases/gateway-operator.konghq.com_dataplanes.yaml': file is not directory

This introduces a copy paste of DataPlane CRD but there's no easy workaround for this given that kustomize requires bases to nested below the kustomization.


This will allow users to migrate from pre 1.2 versions and avoid errors like this: (logs from flux kustomize controller)

{"level":"error","ts":"2024-05-07T11:40:13.581Z","msg":"Reconciliation failed after 953.354003ms, next try in 5s","controller":"kustomization","controllerGroup":"kustomize.toolkit.fluxcd.io","controllerKind":"Kustomization","Kustomization":{"name":"gateway-operator-crd","namespace":"fluxcd"},"namespace":"fluxcd","name":"gateway-operator-crd","reconcileID":"d83732d7-2d00-4477-94a3-1100187afda6","revision":"v1.2.3@sha1:8f2e8d0efc091efc2a8558093ce0bf92a4968479","error":"CustomResourceDefinition/controlplanes.gateway-operator.konghq.com dry-run failed (Invalid): CustomResourceDefinition.apiextensions.k8s.io \"controlplanes.gateway-operator.konghq.com\" is invalid: status.storedVersions[0]: Invalid value: \"v1alpha1\": must appear in spec.versions"}
CustomResourceDefinition/controlplanes.gateway-operator.konghq.com dry-run failed (Invalid): CustomResourceDefinition.apiextensions.k8s.io \"controlplanes.gateway-operator.konghq.com\" is invalid: status.storedVersions[0]: Invalid value: \"v1alpha1\": must appear in spec.versions

@pmalek pmalek self-assigned this Apr 26, 2024
@pmalek pmalek force-pushed the fix-dataplane-only-kustomize branch from ef77571 to a321dd2 Compare May 7, 2024 11:43
@pmalek pmalek marked this pull request as ready for review May 7, 2024 11:57
@pmalek pmalek requested a review from a team as a code owner May 7, 2024 11:57
@pmalek pmalek merged commit e8844dd into main May 7, 2024
13 checks passed
@pmalek pmalek deleted the fix-dataplane-only-kustomize branch May 7, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants