-
Notifications
You must be signed in to change notification settings - Fork 1.8k
internal/plugins: Add kustomize as a prerequisite of Makefile's bundle target #4090
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
internal/plugins: Add kustomize as a prerequisite of Makefile's bundle target #4090
Conversation
Hi, I've also added a new separate commit containing a changelog fragment. If you see it ok and you want me to squash it just tell me. Let me know if there's something else I might be missing. Thank you. |
ddd4f07
to
f93eee1
Compare
# Migration can be defined to automatically add a section to | ||
# the migration guide. This is required for breaking changes. | ||
migration: | ||
header: (Golang based operators) Update Makefile's bundle task |
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.
header: (Golang based operators) Update Makefile's bundle task | |
header: (Golang based operators) Update Makefile's bundle target |
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.
Changed
In the `Makefile` file add the `kustomize` target as | ||
a prerequisite of the `bundle` target. |
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.
In the `Makefile` file add the `kustomize` target as | |
a prerequisite of the `bundle` target. | |
In the `Makefile` file, replace `bundle: manifests` with `bundle: manifests kustomize` to call | |
the kustomize target when the `bundle` target is used. |
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.
Changed
Add `kustomize` as a prerequiste target of the `bundle` | ||
target in the autogenerated Makefile on Golang based | ||
operator projects. |
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.
Add `kustomize` as a prerequiste target of the `bundle` | |
target in the autogenerated Makefile on Golang based | |
operator projects. | |
For Golang based operators, fix an error faced when the [kustomize](https://kubernetes-sigs.github.io/kustomize/) is not installed locally and the Makefile target `bundle` is used by adding the kustomize target on 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.
Changed. Instead of when the kustomize is not installed locally...
I've written when the kustomize binary is not installed locally...
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.
It shows fine for me. Just some nits.
However, @estroz wdyt ?
/lgtm
f93eee1
to
0f0271d
Compare
Do you want me to squash the changelog fragment commit into the other commit? |
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.
One nit and I'd like to see the samples generator updated so we know this change works as intended.
For Golang based operators, fix an error faced when the | ||
[kustomize](https://kubernetes-sigs.github.io/kustomize/) | ||
binary is not installed locally and the Makefile target | ||
`bundle` is used by adding the kustomize target on 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.
For Golang based operators, fix an error faced when the | |
[kustomize](https://kubernetes-sigs.github.io/kustomize/) | |
binary is not installed locally and the Makefile target | |
`bundle` is used by adding the kustomize target on it. | |
Added the `kustomize` make dependency to the `bundle` target scaffolded | |
for Golang projects to install `kustomize` before running. |
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.
👍 changed. However, take into account that the previous text was suggested by @camilamacedo86, so, whatever you prefer.
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 thought that we had defined the standard of For Golang based operators, For Helm based operators and etc ...
However, it is fine 👍 I am ok with the new wording suggested by @estroz as well.
0f0271d
to
489ea48
Compare
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
Hi,
If I'm understanding correctly, we can now remove the explicit call to the I've applied the changes to remove those explicit calls. In the case of Ansible and Helm the I've done the following to verify the newer changes:
Also, to verify that the order in which the generators are run doesn't affect the execution I've executed the generation of each sample generator individually by temporarily commenting code for the others in hack/generate/samples/generate_all.go. Additionally, interestingly enough, I've observed that Ansible and Helm generators install the As you can see, the
Whereas for Ansible (testdata/ansible/memcached-operator/Makefile) and Helm (testdata/helm/memcached-operator/Makefile) is:
Notice the difference in how it is installed. |
If you're asking if Go projects need to install |
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.
PS.: I checked that it is done for
- Helm - https://github.com/operator-framework/operator-sdk/blob/master/testdata/helm/memcached-operator/Makefile#L83
- Ansible - https://github.com/operator-framework/operator-sdk/blob/master/testdata/ansible/memcached-operator/Makefile#L83
So, it is fine to be done only for Go.
Regarding the binary location: I've taken a look at the related issue and I've found the following PR too kubernetes-sigs/kubebuilder#1711 If I can help somehow with this tell me. I'd be happy to contribute. Thanks. |
489ea48
to
cbd1d56
Compare
New changes are detected. LGTM label has been removed. |
I've force-pushed content to reexecute tests, as |
It seems travis tests failed again, but now on the ansible e2e test:
Force-pushed again to reexecute tests |
cbd1d56
to
2ed4ac7
Compare
Hi @miguelsorianod, Could you please rebase your PR with master and push it? Also, if some job Travis fails that has no relation with the changes in your PR not worry it is a flake and we can re-stat the specific job to get this merged. If you need please feel free to ping me in the slack as well. |
…e target `bundle` target in the autogenerated Makefile for new golang based operator projects generated by the operator-sdk make use of the `kustomize` CLI tool. This commit adds the `kustomize` Makefile target as a prerequisite of the `bundle` target.
…in bundle Makefile target
…arget It is not needed anymore due to `make bundle` target already contains the `kustomize` target as a prerequisite.
2ed4ac7
to
8c9989f
Compare
Rebased and pushed |
Description of the change:
bundle
target in the autogenerated Makefile for new golang based operator projects generatedby the operator-sdk make use of the
kustomize
CLI tool. This commit adds thekustomize
Makefiletarget as a prerequisite of the
bundle
target.Motivation for the change:
When running
make bundle
an error is returned if kustomize is not previously installed in$PATH
.Execution example:
Checklist
If the pull request includes user-facing changes, extra documentation is required:
changelog/fragments
(seechangelog/fragments/00-template.yaml
)website/content/en/docs