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

optimize: don't parse Dockerfile twice, reusing stages #1174

Merged
merged 3 commits into from
Apr 8, 2020

Conversation

dani29
Copy link
Contributor

@dani29 dani29 commented Apr 3, 2020

Description

Planning to refactor a bit to work on issue #533, this one is just doing preparation refactoring that is out of scope for that issue.

  • We call CalculateDependencies(), which parsing the Dockerfile again into kanikoStages, even though we already have them.
  • modified command_utils.UpdateConfigEnv() so that it will only update the config with the state of the existing environment variables, but will not modify the cmd.Env object itself. It prevents escaping the same ENV command twice (during calculateDependencies, and ExecuteCommand).

Submitter Checklist*

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Adds integration tests if needed.

See the contribution guide for more details.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

Release Notes

Describe any changes here so maintainer can include it in the release notes, or delete this block.

Examples of user facing changes:
- Optimization: do not parse Dockerfile again while calculating dependencies

@googlebot googlebot added the cla: yes CLA signed by all commit authors label Apr 3, 2020
@dani29 dani29 requested a review from tejal29 April 3, 2020 15:48
@dani29 dani29 closed this Apr 3, 2020
@dani29 dani29 reopened this Apr 3, 2020
@tejal29
Copy link
Contributor

tejal29 commented Apr 8, 2020

Looks good to me!

@tejal29 tejal29 merged commit 2609944 into GoogleContainerTools:master Apr 8, 2020
@dani29 dani29 deleted the onbuild-copy branch April 9, 2020 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA signed by all commit authors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants