-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
cmd/build: Add buildah support #1311
cmd/build: Add buildah support #1311
Conversation
Hi @mkimuram. Thanks for your PR. I'm waiting for a operator-framework or openshift 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. |
It seems that #563 is doing a similar change, but it has no update for a long time. For memcached-operator, builds with below commands succeeded after applying this PR,
@estroz @AlexNPavel @shawn-hurley Could you review this PR? |
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 like that this uses a flag to tell the build to use buildah and keeps the same default, this allows us to switch the default when it makes sense.
I wonder if there is some way to hide the switch statement in its own function because we have to do it twice? I looked at it, and it might not be super easy but would like to see an attempt.
WDYT?
cmd/operator-sdk/build/cmd.go
Outdated
@@ -63,6 +65,8 @@ For example: | |||
buildCmd.Flags().StringVar(&testLocationBuild, "test-location", "./test/e2e", "Location of tests") | |||
buildCmd.Flags().StringVar(&namespacedManBuild, "namespaced-manifest", "deploy/operator.yaml", "Path of namespaced resources manifest for tests") | |||
buildCmd.Flags().StringVar(&dockerBuildArgs, "docker-build-args", "", "Extra docker build arguments as one string such as \"--build-arg https_proxy=$https_proxy\"") | |||
buildCmd.Flags().StringVar(&buildahBuildArgs, "buildah-build-args", "", "Extra buildah build arguments as one string such as \"--build-arg https_proxy=$https_proxy\"") |
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.
WDYT of re-using a flag build-args
for both docker and buildah?
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.
Can we rename docker-build-args
with something like image-build-args
?
Then re-using flag makes sense to me. I'm not sure how operator-sdk community thinks about the backward compatibility of command line option.
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.
image-build-args
is fine with me. We'll have to add these changes to the CHANGELOG.md
too.
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'm fine with these changes overall. A few points need addressing first.
7d84bdc
to
2106140
Compare
Thank you for your feedback. I've fixed as suggested. PTAL |
Thank you for your suggestion. Fixed as suggested again. PTAL |
838a7c8
to
f5f0331
Compare
/lgtm /cc @theishshah |
Below error happens without quote for
|
/retest |
/ok-to-test |
/lgtm |
e9af095
to
1000490
Compare
New changes are detected. LGTM label has been removed. |
Rebased again to resolve conflict. PTAL |
Description of the change:
This PR adds buildah support.
Motivation for the change:
operator-sdk should support building image by using buildah.
There is an existing discussion for motivation in #563 .