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

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

Conversation

ericzzzzzzz
Copy link
Contributor

@ericzzzzzzz ericzzzzzzz commented Dec 5, 2023

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.

Copy link

codecov bot commented Dec 5, 2023

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 on lines 43 to 45
"IMAGE_REPO": ref.Repo,
"IMAGE_NAME": ref.Name,
"IMAGE_TAG": ref.Tag,
Copy link
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

@@ -150,11 +151,44 @@ func TestBuildOptions(t *testing.T) {
UserAgent: version.UserAgentWithClient(),
},
},
{
description: "",
Copy link
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
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

all builders should be able to reference IMAGE from templated fields.
3 participants