Skip to content
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

Pass buildArgs to Kaniko #822

Merged
merged 4 commits into from Jul 18, 2018
Merged

Pass buildArgs to Kaniko #822

merged 4 commits into from Jul 18, 2018

Conversation

JoelPM
Copy link
Contributor

@JoelPM JoelPM commented Jul 13, 2018

If buildArgs are present in skaffold.yaml for the Docker configuration pass them through to kaniko. Addresses #821

This is likely not idiomatic golang, happy to update based on feedback.

If buildArgs are present in skaffold.yaml for the Docker configuration,
pass them through to kaniko. Addresses #821
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@JoelPM
Copy link
Contributor Author

JoelPM commented Jul 13, 2018

CLA is signed.

@googlebot
Copy link

CLAs look good, thanks!


i := len(args)
for k, v := range artifact.DockerArtifact.BuildArgs {
withBuildArgs[i] = fmt.Sprintf("--build-arg=%s=%s", k, *v)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use append(args, fmt.Sprintf("--build-arg=%s=%s", k, *v)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated based on feedback. That's definitely cleaner.

@JoelPM
Copy link
Contributor Author

JoelPM commented Jul 17, 2018

@r2d4 - Made the changes you suggested, any other changes you'd like to see?

Copy link
Contributor

@r2d4 r2d4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks!!

@r2d4 r2d4 added the kokoro:run runs the kokoro jobs on a PR label Jul 17, 2018
Copy link
Contributor

@dgageot dgageot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a nit

return args
}

if artifact.DockerArtifact.BuildArgs == nil || len(artifact.DockerArtifact.BuildArgs) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be replaced with if len(artifact.DockerArtifact.BuildArgs) == 0

@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Jul 18, 2018
@JoelPM
Copy link
Contributor Author

JoelPM commented Jul 18, 2018

Good point @dgageot, nit addressed.

@dgageot dgageot merged commit e9af7e5 into GoogleContainerTools:master Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants