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: use of kustomize deprecated features #52

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erikgb
Copy link

@erikgb erikgb commented Dec 21, 2024

This PR's main motivation is to make it easier to replace the long-deprecated kube-rbac-proxy image with similar functionality now available in controller-runtime. But since I noticed some use of deprecated kustomize features, I made some additional improvements.

Some of the proposed changes are based on the latest updates in kubebuilder (go/v4). I don't want to attempt migrating to kubebuilder go/v4 before #49 is merged (or closed) to avoid interference between PRs.

@cert-manager-prow cert-manager-prow bot added the dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. label Dec 21, 2024
@cert-manager-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign munnerz 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

@cert-manager-prow cert-manager-prow bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 21, 2024
@erikgb erikgb force-pushed the fix-kustomize-deprecated branch from 533d963 to 22a4174 Compare December 21, 2024 13:19
@cert-manager-prow cert-manager-prow bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. and removed dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. labels Dec 21, 2024
@wallrj wallrj self-requested a review January 3, 2025 11:11
- manager_auth_proxy_patch.yaml


- path: manager_auth_proxy_patch.yaml
Copy link
Member

Choose a reason for hiding this comment

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

I expected this patch to change or be deleted, since it's what adds the kube-rbac-proxy sidecar:

Did you forget to commit something?

Copy link
Author

Choose a reason for hiding this comment

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

I could extend the PR to include migration away from kube-rbac-proxy, but that will increase the number of changes significantly. But can still make sense. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I misunderstood your PR description.

But since I noticed some use of deprecated kustomize features, I made some additional improvements.

I thought you meant that you'd removed kube-rbac-proxy and additionally replaced some deprecated kustomize features.

Now I understand that this PR is ground work for a follow up PR which removes kube-rbac-proxy.

Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

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

Thanks @erikgb

Now I understand that this is ground work for the replacement of kube-rbac-proxy in a followup PR.

I could find the kubebuilder PRs for most of these changes, but some of the changes do not seem to be found upstream.

Please write a little more about how you generated this PR and highlight which parts are mechanical and which parts are hand crafted.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@@ -12,6 +12,3 @@ namespace:
group: apiextensions.k8s.io
path: spec/conversion/webhookClientConfig/service/namespace
create: false

varReference:
- path: metadata/annotations
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Why did these filenames change? Is it because the CRD name was changed in #42 and we forgot to re-run the kubebuilder crd generator tool?

If so, it really annoys me that issuer-lib prevents us from using the CRD name issuer and clusterissuer.

@erikgb
Copy link
Author

erikgb commented Jan 3, 2025

Please write a little more about how you generated this PR and highlight which parts are mechanical and which parts are hand crafted.

Basically everything was had-crafted, but based on the content in https://github.com/kubernetes-sigs/kubebuilder/tree/master/testdata/project-v4. Do you want me to perform a full rescaffolding? Would that be easier to review?

@wallrj
Copy link
Member

wallrj commented Jan 3, 2025

Do you want me to perform a full rescaffolding?

Maybe that would be cleaner.

The PR description says:

I don't want to attempt migrating to kubebuilder go/v4 before #49 is merged (or closed) to avoid interference between PRs

I vote to close that PR for the reasons given by Ash in his review.

This PR's main motivation is to make it easier to replace the long-deprecated kube-rbac-proxy image with similar functionality now available in controller-runtime

Update the PR description to explain how these changes makes it easier to accomplish that goal.

I really just want to understand the reasoning for this particular set of changes.
The PR title says "fix use of kustomize deprecated features"
Some of these changes do remove deprecated kustomize features.
Some changes (such as the removal of cainjection patches) seem like they are part of the rescaffolding.
Other changes (the removal of the varReference block) do not have any upstream counterpart, and I want to know why that change belongs in this PR (is it a deprecated kustomize feature?) and why it has not been changed in the kubebuilder project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants