Skip to content

Conversation

@Akrog
Copy link
Contributor

@Akrog Akrog commented Jun 5, 2024

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.

@openshift-ci openshift-ci bot requested review from olliewalsh and stuggi June 5, 2024 16:16
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.
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/088dd60260974073bd6efa6b490daefe

openstack-k8s-operators-content-provider FAILURE in 14m 18s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ openstack-operator-tempest-multinode SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@Akrog
Copy link
Contributor Author

Akrog commented Jun 5, 2024

recheck

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 7, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Akrog, slagle
Once this PR has been reviewed and has the lgtm label, please assign frenzyfriday for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

.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 -
Copy link
Contributor

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

Copy link
Contributor Author

@Akrog Akrog Jun 18, 2024

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about having two targets install and install-force?

The install target could use:

kubectl replace -f - 

OR

kubectl apply --server-side -f -

And the install-force could utilize the --force parameter:

kubectl replace --force -f -

OR

kubectl apply --server-side --force-conflicts -f -

I was facing the Too long: must have at most 262144 bytes error as well, and I think it would be good if it was fixed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 18, 2025

@Akrog: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/openstack-operator-build-deploy-kuttl-4-18 a4058f8 link true /test openstack-operator-build-deploy-kuttl-4-18
ci/prow/openstack-operator-build-deploy-kuttl a4058f8 link true /test openstack-operator-build-deploy-kuttl

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants