-
Notifications
You must be signed in to change notification settings - Fork 79
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 make install #828
base: main
Are you sure you want to change the base?
Fix make install #828
Conversation
Running `make install` fails with error: The CustomResourceDefinition "openstackcontrolplanes.core.openstack.org" is invalid: metadata.annotations: Too long: must have at most 262144 bytes This patch fixes this problem by using `kubectl replace` instead of `kubectl apply`. Replace was chosen over `kubectl apply --server-side` because the apply may fail to merge with the existing CRD, whereas replace will not fail.
Build failed (check pipeline). Post https://review.rdoproject.org/zuul/buildset/088dd60260974073bd6efa6b490daefe ❌ openstack-k8s-operators-content-provider FAILURE in 14m 18s |
recheck |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Akrog, slagle The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -188,7 +188,7 @@ endif | |||
|
|||
.PHONY: install | |||
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. | |||
$(KUSTOMIZE) build config/crd | kubectl apply -f - | |||
$(KUSTOMIZE) build config/crd | kubectl replace --force -f - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why force is needed? that also removes CRDs and custom resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I've seen it fail otherwise during development complaining about some incompatibility.
It also solves the problem of trying to replace a CRD that doesn't exist. For example if we run make uninstall install
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to understand first what were those incompatibility because when i tried it i didn't faced it, but yes it possible based on the version installed and what being installed.
If it fails due to incompatibility, i think user can be provided an option to force it with details about what to expect with force option and not do it by default because of the above concerns as there can be requirement to not wipe out installed control plane services.
Running
make install
fails with error:This patch fixes this problem by using
kubectl replace
instead ofkubectl apply
.Replace was chosen over
kubectl apply --server-side
because the apply may fail to merge with the existing CRD, whereas replace will not fail.