Skip to content

fix: support alternative env var naming using support env variable + artifact-name (vs env variable + index)#8175

Merged
aaron-prindle merged 1 commit into
GoogleContainerTools:mainfrom
aaron-prindle:setvaluetemplates-env-var-changes-v3
Nov 30, 2022
Merged

fix: support alternative env var naming using support env variable + artifact-name (vs env variable + index)#8175
aaron-prindle merged 1 commit into
GoogleContainerTools:mainfrom
aaron-prindle:setvaluetemplates-env-var-changes-v3

Conversation

@aaron-prindle

@aaron-prindle aaron-prindle commented Nov 30, 2022

Copy link
Copy Markdown
Contributor

Some issues in the original PR with the updated naming .<artifact-name>.IMAGE_X. Reverting env naming to working solution: .IMAGE_X_<artifact-name>. Also updated to docs to reflect this change

fixes: #7967

fixes: #6207

fixes: #7989

Manually tested as working using skaffold-test-repro which is a repro repo created in #7989 (comment). Logs showing correctness below:

aprindle@aprindle-ssd ~/skaffold-test-repo  [master]$ skaffold dev --default-repo=gcr.io/aprindle-test-cluster
Listing files to watch...
 - localhost/nginx
Generating tags...
 - localhost/nginx -> gcr.io/aprindle-test-cluster/localhost/nginx:2ff8c19-dirty
Checking cache...
 - localhost/nginx: Found Remotely
Tags used in deployment:
 - localhost/nginx -> gcr.io/aprindle-test-cluster/localhost/nginx:2ff8c19-dirty@sha256:5cfa549eefd73aea2f5bd2768d2b3e3a0955092be15eb6620b6c32ea17465f16
Starting deploy...
Helm release test not installed. Installing...
aprindle@aprindle-ssd ~/skaffold-test-repo  [master]$ kubectl get deployment -n test test-chart -o=jsonpath={.spec.template.spec.containers[0].image}
gcr.io/aprindle-test-cluster/localhost/nginx:2ff8c19-dirty@sha256:5cfa549eefd73aea2f5bd2768d2b3e3a0955092be15eb6620b6c32ea17465f16:1.1aprindle@aprindle-ssd ~/skaffold-test-repo  [master]$ ]$ kubectl  job -n test foo -o=jsonpath={.spec.template.spec.containers[0].image}
gcr.io/aprindle-test-cluster/localhost/nginx:2ff8c19-dirty@sha256:5cfa549eefd73aea2f5bd2768d2b3e3a0955092be15eb6620b6c32ea17465f16:1.16.0
@aaron-prindle aaron-prindle force-pushed the setvaluetemplates-env-var-changes-v3 branch 6 times, most recently from f2bca84 to 6ab70cd Compare November 30, 2022 01:18
image.repository: '{{.app2.IMAGE_REPO}}'
image.tag: "{{.app2.IMAGE_TAG}}@{{.app2.IMAGE_DIGEST}}" No newline at end of file
image.repository: '{{.IMAGE_REPO_app2}}'
image.tag: "{{.IMAGE_TAG_app1}}@{{.IMAGE_DIGEST_app2}}" No newline at end of file

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 think it should be "{{.IMAGE_TAG_app2}}@{{.IMAGE_DIGEST_app2}}" -> changed app1 to app2

@aaron-prindle aaron-prindle Nov 30, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed thanks, I fixed that and then must have undone the fix at some point lol

@aaron-prindle aaron-prindle force-pushed the setvaluetemplates-env-var-changes-v3 branch 2 times, most recently from d8fa424 to 1281f35 Compare November 30, 2022 01:34
@aaron-prindle aaron-prindle force-pushed the setvaluetemplates-env-var-changes-v3 branch from 1281f35 to ff220ea Compare November 30, 2022 01:40
@codecov

codecov Bot commented Nov 30, 2022

Copy link
Copy Markdown

Codecov Report

Merging #8175 (ff220ea) into main (290280e) will decrease coverage by 4.26%.
The diff coverage is 53.26%.

@@            Coverage Diff             @@
##             main    #8175      +/-   ##
==========================================
- Coverage   70.48%   66.22%   -4.27%     
==========================================
  Files         515      599      +84     
  Lines       23150    29351    +6201     
==========================================
+ Hits        16317    19437    +3120     
- Misses       5776     8457    +2681     
- Partials     1057     1457     +400     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/completion.go 13.04% <0.00%> (-1.25%) ⬇️
cmd/skaffold/app/cmd/credits/export.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/deploy.go 40.90% <0.00%> (-12.94%) ⬇️
cmd/skaffold/app/cmd/test.go 44.44% <0.00%> (ø)
cmd/skaffold/app/exitcode.go 100.00% <ø> (+6.66%) ⬆️
cmd/skaffold/skaffold.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/inspect_tests.go 62.50% <14.28%> (-1.14%) ⬇️
cmd/skaffold/app/cmd/render.go 35.48% <18.18%> (-5.90%) ⬇️
cmd/skaffold/app/cmd/lsp.go 28.12% <28.12%> (ø)
cmd/skaffold/app/cmd/run.go 64.28% <33.33%> (-9.63%) ⬇️
... and 393 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants