-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
✨ handle missing boilerplate file gracefully during scaffolding #4518
base: master
Are you sure you want to change the base?
✨ handle missing boilerplate file gracefully during scaffolding #4518
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sarthaksarthak9 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 |
Hi @sarthaksarthak9. 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-sigs/prow repository. |
6b945f0
to
9da9bac
Compare
9da9bac
to
093acab
Compare
log.Warnf("Unable to find %s: %s.\n"+ "This file is used to generate the license header in the project.\n"+ | ||
"Note that controller-gen will also use this. Therefore, ensure that you add the license file or configure your project accordingly.", | ||
s.boilerplatePath, err) | ||
boilerplate = []byte("") |
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.
Why you added it ?
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.
Ig, we have to handle it here also and yesterday you had also mentioned this one.
build/.goreleaser.yml
Outdated
- -X cmd.goarch={{ .Arch }} | ||
- -X cmd.gitCommit={{ .Commit }} | ||
- -X cmd.buildDate={{ .Date }} | ||
- -X cmd.kubernetesVendorVersion={{ .Env.KUBERNETES_VERSION }} | ||
targets: | ||
- linux_amd64 |
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.
To validate these changes we can:
- I update the script that generate all samples that we have under the testdata in order to remove the hack dir. See: https://github.com/kubernetes-sigs/kubebuilder/blob/master/test/testdata/generate.sh by adding the line
...
header_text "Initializing project ..."
$kb init $init_flags --domain testproject.org --license apache2 --owner "The Kubernetes authors"
rm -rf hack/
- Then, I called
make generate
Could you please do that and add the result here in the description of the PR, or let us know the error faced?
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.
yes
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.
@camilamacedo86 changes are working fine. Share the end lines of the output in the description
093acab
to
7ddda45
Compare
7ddda45
to
337bc78
Compare
/ok-to-test |
echo "Warning: Boilerplate file '{{ .BoilerplatePath }}' not found. Proceeding without it."; \ | ||
echo "You can create it later and regenerate code with the boilerplate using 'make generate'."; \ | ||
$(CONTROLLER_GEN) object paths="./..."; \ | ||
fi |
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.
When we change something that change the scaffolds we need to run make generate
so that all samples will be updated. Otherwise, we cannot move forward and get it merged. But you can wait I will review it properly better and provide a good guidance.
Fixes: #4507