Skip to content

chore: inject imageInfo when expanding templates for ko builder#9207

Merged
ericzzzzzzz merged 5 commits into
GoogleContainerTools:mainfrom
ericzzzzzzz:more-env-variables-to-builder
Dec 13, 2023
Merged

chore: inject imageInfo when expanding templates for ko builder#9207
ericzzzzzzz merged 5 commits into
GoogleContainerTools:mainfrom
ericzzzzzzz:more-env-variables-to-builder

Conversation

@ericzzzzzzz

@ericzzzzzzz ericzzzzzzz commented Dec 5, 2023

Copy link
Copy Markdown
Contributor

Fixes: #9045
Related: Relevant tracking issues, for context
Merge before/after: Dependent or prerequisite PRs

Description

  • The original ticket ask was to inject all available runtime envs in custom builder also available to other builders
  • After investigation, it looks like that the reason we have some envs such as platform, pushImage to custom builder due to the custom builder may have some logic to build based on these values.
  • Other builders don't need those info, hence only inject imageInfo to ko builder, we're already doing this for docker and kaniko.
@codecov

codecov Bot commented Dec 5, 2023

Copy link
Copy Markdown

Codecov Report

Attention: 295 lines in your changes are missing coverage. Please review.

Comparison is base (290280e) 70.48% compared to head (e4568e4) 63.65%.
Report is 1078 commits behind head on main.

Files Patch % Lines
cmd/skaffold/app/cmd/exec.go 16.32% 40 Missing and 1 partial ⚠️
cmd/skaffold/app/cmd/filter.go 47.27% 22 Missing and 7 partials ⚠️
cmd/skaffold/app/cmd/lsp.go 28.12% 23 Missing ⚠️
cmd/skaffold/app/cmd/verify.go 23.33% 23 Missing ⚠️
cmd/skaffold/app/cmd/fix.go 51.16% 17 Missing and 4 partials ⚠️
cmd/skaffold/app/cmd/inspect_job_manifest_paths.go 60.00% 15 Missing and 1 partial ⚠️
cmd/skaffold/app/cmd/inspect_namespaces.go 50.00% 13 Missing and 1 partial ⚠️
...md/skaffold/app/cmd/inspect_config_dependencies.go 45.83% 12 Missing and 1 partial ⚠️
cmd/skaffold/app/cmd/lint.go 42.85% 12 Missing ⚠️
cmd/skaffold/app/cmd/inspect_build_env.go 60.71% 11 Missing ⚠️
... and 21 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9207      +/-   ##
==========================================
- Coverage   70.48%   63.65%   -6.83%     
==========================================
  Files         515      632     +117     
  Lines       23150    32554    +9404     
==========================================
+ Hits        16317    20722    +4405     
- Misses       5776    10237    +4461     
- Partials     1057     1595     +538     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ericzzzzzzz ericzzzzzzz marked this pull request as ready for review December 5, 2023 16:59
Comment thread pkg/skaffold/build/ko/builder.go Outdated
Comment on lines +43 to +45
"IMAGE_REPO": ref.Repo,
"IMAGE_NAME": ref.Name,
"IMAGE_TAG": ref.Tag,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found a var in https://github.com/GoogleContainerTools/skaffold/blob/main/pkg/skaffold/constants/constants.go#L139, ImageRef that has 2 out of 3 of these values, do you think is a good idea to use that constant instead? We would need to add IMAGE_NAME if we decide we want to use it

Comment thread pkg/skaffold/build/ko/builder_test.go Outdated
},
},
{
description: "",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we add a description for this test case? Just to be able to detect it better in the logs if something happens. Thanks! 😄

@ericzzzzzzz ericzzzzzzz added the kokoro:force-run forces a kokoro re-run on a PR label Dec 11, 2023
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Dec 11, 2023
@ericzzzzzzz ericzzzzzzz force-pushed the more-env-variables-to-builder branch from 1c67fff to e4568e4 Compare December 12, 2023 20:03
@ericzzzzzzz ericzzzzzzz merged commit aec8e3e into GoogleContainerTools:main Dec 13, 2023
@menahyouyeah menahyouyeah mentioned this pull request Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants