-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
π (kustomize/v1 and kustomize/v2-alpha) : ComponentConfig scaffolds should not be done by default #2826
π (kustomize/v1 and kustomize/v2-alpha) : ComponentConfig scaffolds should not be done by default #2826
Conversation
Hi @laxmikantbpandhare. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
@camilamacedo86 - I verified the field |
Terrific ! yes, we need to also fix the v2-alpha kustomize plugin. |
/ok-to-test |
OK, I will update that too and then will do the |
@camilamacedo86 - I went through the tests that are failing and found that they are failing in It is because
The solution for this is, that I need to modify the test cases and enable the |
/label tide/merge-method-squash |
Regards the comment : #2826 (comment) That means:
Could you look to address these needs? WDYT? |
@camilamacedo86 - Got your point and agree with the suggestions. I will update the PR soon. |
Hi @camilamacedo86 I am trying to align my own project to incorporate these changes manually (since its already scaffolded). A clarification regarding the last comment which might be important for this PR too
Is the resources:
- manager.yaml or resources:
- manager.yaml
generatorOptions:
disableNameSuffixHash: true I am pretty sure that all of configMapGenerator:
- name: manager-config
files:
- controller_manager_config.yaml needs to be removed though. |
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.
I dont know if this is something that you intend to fix but just thought to mention that the ManagerConfigPatch
is also something that should depend on whether the config flag is pased or not. The generated patch is referencing the controller_manager_config.yaml
which won't exist and is sure to confuse users.
https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/common/kustomize/v1/scaffolds/internal/templates/config/kdefault/manager_config_patch.go
Also notice how the kustomize.yaml
referencing the above patch is commenting out the line to include the patch
Lines 79 to 84 in e116b54
# Mount the controller config file for loading manager configurations | |
# through a ComponentConfig type | |
{{ if not .ComponentConfig }}#{{ end }}- manager_config_patch.yaml | |
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in | |
# crd/kustomization.yaml |
Yes, you are correct. We are removing the below completely.
I will update the PR soon. |
@SayakMukhopadhyay @camilamacedo86 - Updated the PR with the new changes that we discussed for |
@laxmikantbpandhare please correct me if I am wrong, from what I understand, if the ComponentConfig is disabled # Mount the controller config file for loading manager configurations
# through a ComponentConfig type
#- manager_config_patch.yaml the resultant section of the # Mount the controller config file for loading manager configurations
# through a ComponentConfig type |
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.
@laxmikantbpandhare very nice work.
Just a few nits and could you please squash the commits?
@SayakMukhopadhyay Yes, I will remove those comments as well. |
Sure @camilamacedo86 |
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.
Great π₯
/approved
In a follow up we need to create a plugin that does this config.
Then, we might also implement the edit subcommand to do the required changes
/test pull-kubebuilder-e2e-k8s-1-19-16 |
Yes @camilamacedo86, I will work on those as well. |
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.
Just a couple minor nits from me. Other than that it looks great! Great work @laxmikantbpandhare !
updated testdata update v2-alpha and modified tests and added component-confit flag in it modified tests and enables componenet config flag removed unnecessary addition componenent config flag in v2 whenre this flag is not available removed for tests modified kustomization.yml file modified testdata added end to end tests with component config field marked as true line length is more than 122 characters mis spell updated doc modified docs modified docs modified default kustomization file too updated scaffold condition worked on review comments updated according to code review comments
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, everettraven, laxmikantbpandhare 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 |
Oops, I forgot that an LGTM on this repo auto merges. @camilamacedo86 is it okay that this has merged? |
No worries, thanks for your comments. |
A description of the change
This PR will verify whether the
--component-config
flag is passed or not. If not then it will not scaffold out thecontroller_manager_config.yaml
file.The motivation for the change
it fixes #2782
Tests done to ensure the changes:
Init command ( without the --component-config flag)
From this PR:
Init command ( with the changes and passed the --component-config flag)
This will verify that it is working, the
controller_manager_config.yaml
file got scaffolded only when a flag(--component-config
) is passed.