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

🐛 (helm/v1-alpha): not scaffold webhooks conditionals manifests for projects without webhooks #4584

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

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Feb 28, 2025

Closes: #4582

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 28, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 28, 2025
@camilamacedo86 camilamacedo86 changed the title 🐛 (helm/v1-alpha): Fix helm-chart scaffold by not scaffolding manifests with webhook conditions when webhooks are not used 🐛 (helm/v1-alpha): not scaffold webhooks conditionals manifests for projects without webhooks Feb 28, 2025
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 28, 2025
@@ -96,7 +97,7 @@ func (s *initScaffolder) Scaffold() error {
DeployImages: len(imagesEnvVars) > 0,
HasWebhooks: hasWebhooks,
},
&templatescertmanager.Certificate{},
&templatescertmanager.Certificate{HasWebhooks: hasWebhooks},
Copy link

Choose a reason for hiding this comment

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

sorry Camila, just wondered whether it is being updated due to scaffalding webhooks conditional issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

we are passing the value HasWebhooks here because then inside of the boilerplate to generate the Certs we just generate those which related to Webhook Sever only when we have Webhooks

@camilamacedo86 camilamacedo86 requested a review from sbin64 March 6, 2025 22:56
Copy link

@sbin64 sbin64 left a comment

Choose a reason for hiding this comment

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

Looks good, but why this has failed. I suspect from here whether intended.

sigs.k8s.io/kubebuilder/v4/pkg/config
  Incompatible changes:
  - Config.HasWebhooks: added

@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Mar 7, 2025

Regards: #4584 (review)
The lib try to help us know about breaking changes in the API
In this case, shows a false alarm. We are adding a new method, not removing.

We can either do not change the API and keep the implementation inside of the plugin.
It might be a better choice, if we see more places that needs it then we can consider in expose the method

@@ -172,6 +172,23 @@ func (c Cfg) HasResource(gvk resource.GVK) bool {
return found
}

// HasWebhooks checks if any stored resource has associated webhooks.
func (c Cfg) HasWebhooks() bool {
Copy link
Member Author

Choose a reason for hiding this comment

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

/hold

Remove from the interface

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 7, 2025
@camilamacedo86
Copy link
Member Author

/hold cancel

It is good to fly now.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 19, 2025
… with webhook conditions when webhooks are not used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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.

(helm/v1-alpha) Generates invalid chart in operator without webhooks
3 participants