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: remove dummy caBundle from CRDs #1326

Merged
merged 2 commits into from
Oct 11, 2024
Merged

Conversation

dkwon17
Copy link
Collaborator

@dkwon17 dkwon17 commented Oct 10, 2024

What does this PR do?

Removes webhook.clientConfig.caBundle: Cg== from the DevWorkspace and DevWorkspaceTemplate CRDs.

What issues does this PR fix or reference?

For Kubernetes version 1.31 and later, CRDs with clientConfig.caBundle: Cg== cannot be applied anymore:
kubernetes/kubernetes#125569 (comment)

This PR fixes redhat-developer/web-terminal-operator#171, #1327

Is it tested? How?

Create a bundle and apply the catalog source to the cluster and install the DWO version provided from the catalog source:

export DWO_BUNDLE_IMG=quay.io/<username>/devworkspace-operator-bundle:removeCaBundle
export DWO_INDEX_IMG=quay.io/<username>/devworkspace-operator-index:removeCaBundle
make generate_olm_bundle_yaml build_bundle_and_index register_catalogsource

DWO installation should be successful.

To test even further, you can try creating a DevWorkspace and use conversion webhooks by retrieving the v1alpha1 version:

$ kubectl apply -f ./samples/code-latest.yaml 
$ kubectl get devworkspace.v1alpha1.workspace.devfile.io code-latest

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Signed-off-by: dkwon17 <dakwon@redhat.com>
Copy link
Collaborator

@AObuchow AObuchow left a comment

Choose a reason for hiding this comment

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

Thanks for catching this issue & for the PR David :) I'm currently requesting an OCP 4.18 cluster to test this out.

Would you mind also creating an DWO issue about what this PR is for? Just something that briefly mentions that the caBundle field used to be required to be filled with a placeholder value for CRD validation to pass, but this is no longer required and having an (invalid) placeholder value actually causes CRD validation to fail. The issue description doesn't have to be thorough, and it could mention the Kubernetes slack thread discussion to provide more context.

This way, we can track this bug getting fixed in the DWO 0.32.0 milestones (for the downstream release changelog)

@@ -17,7 +17,7 @@ spec:
path: /convert
port: 443
# caBundle will be filled by cert-manager on creation
caBundle: Cg==
# caBundle: Cg==
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should just remove this line (as well as the other mentions of caBundle: Cg== from the templates) rather than commenting it out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed them in my latest commit

Signed-off-by: dkwon17 <dakwon@redhat.com>
Copy link
Collaborator

@AObuchow AObuchow left a comment

Choose a reason for hiding this comment

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

Works as expected to me. I installed via OLM on an OpenShift 4.18 cluster & was able to retrieve a v2 devworkspace as a v1 devworkspace:

$ kubectl get devworkspace.v1alpha1.workspace.devfile.io plain-devworkspace -o yaml
Warning: workspace.devfile.io/v1alpha1 DevWorkspace is deprecated; use workspace.devfile.io/v1alpha2 DevWorkspace
apiVersion: workspace.devfile.io/v1alpha1
kind: DevWorkspace
(...)

Awesome work @dkwon17, thank you so much for quickly catching and fixing this 🥳

My final small suggestion before merging is to squash your second commit into your first one, and maybe add a fix #1327 in the commit description to directly link the GH issue.

Copy link

openshift-ci bot commented Oct 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AObuchow, dkwon17

The full list of commands accepted by this bot can be found here.

The pull request process is described 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

@dkwon17 dkwon17 merged commit a285d3b into devfile:main Oct 11, 2024
8 checks passed
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.

Web-terminal operator installation on the latest OCP 4.18 clusters is not happening
2 participants