-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: generalize container tool usage in Makefile template #6932
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
feat: generalize container tool usage in Makefile template #6932
Conversation
9c416f9 to
66a2529
Compare
camilamacedo86
left a comment
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.
Hi @rhuss
Thank you for your contribution 🥇
I think that is OK because matches with the scaffold of kubebuilder: https://github.com/kubernetes-sigs/kubebuilder/blob/master/testdata/project-v4/Makefile
However, you need to run make install and make generate locally to ensure that those files are properly updated in the testdata.
9566ad4 to
1a11e7c
Compare
|
Thanks! Regenerated makefiles now. |
df2d9c6 to
1228903
Compare
|
For non-go Makefiles the $CONTAINER_TOOL needs to be included in the fragment, vor go Makefiles it comes from kubebuilder. Adapted the template accordingly. |
|
Hi @rhuss Can you please rebase it with master? |
1228903 to
4734c43
Compare
|
rebased ... |
|
@camilamacedo86 I've fixed the sanity check, but the doc check fails for some reason, but I'm pretty sure this is not because of this PR. |
54bcdb5 to
c09f688
Compare
|
|
||
| makefileBundleFragmentNonGo = ` | ||
| # Container tool to use for building images | ||
| CONTAINER_TOOL ?= docker |
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 believe we shouldn't add this code here directly.
The more appropriate approach would be to update the Makefile scaffold used by Helm. You can refer to the implementation here for context:
👉 https://github.com/operator-framework/operator-sdk/blob/master/internal/plugins/helm/v1/scaffolds/internal/templates/makefile.go
Additionally, it would be great if we could add the same logic in the default Golang plugin as well, ideally on the same line. This would help us keep things consistent and easier to maintain across plugins. Could you please take a look?
Lastly, if this change is really needed here, we'd need to ensure it's applied and validated across all relevant places to keep things aligned.
Appreciate your effort—thank you! 😊
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.
Definitely, I changed it to add it directly to the Heml makefile. Thanks for the pointer!
For the Golang plugin, I wonder whether this wouldn't conflict with the definition of $(CONTAINER_TOOL) that comes in from the kubebuilder dependencies. I do not know enough to fully understand how the final Makefile is assembled from fragments here and from the kubebuilder dep, but I believe if we add this definition also to the golang makefile.go then it would be added twice.
3180171 to
2d953de
Compare
|
Hi @rhuss That is great 🥇 Thank you very much for your contribution 👍 |
To allow also the usage of podman, a $(CONTAINER_TOOL) var is include in teh Makefile generation. This aligns with the changes in kubebuilder. Signed-off-by: Roland Huß <[email protected]>
2d953de to
f42fbae
Compare
Description of the change:
This PR generalizes the container tool usage in the bundle build target to respect the
CONTAINER_TOOLvariable. The change replaces the hardcodeddockercommand with$(CONTAINER_TOOL)in thebundle-buildtarget of the Makefile template, making it consistent with other container-related targets in the operator-sdk.Motivation for the change:
Currently, the bundle build target hardcodes the use of
dockeras the container tool, which is inconsistent with other parts of the operator-sdk that respect theCONTAINER_TOOLvariable. This change:Checklist
If the pull request includes user-facing changes, extra documentation is required:
changelog/fragments(seechangelog/fragments/00-template.yaml)website/content/en/docs