Skip to content

feat:(build/docker): support env as secret source #6632

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

Merged
merged 1 commit into from
Sep 24, 2021
Merged

feat:(build/docker): support env as secret source #6632

merged 1 commit into from
Sep 24, 2021

Conversation

ahmetb
Copy link
Contributor

@ahmetb ahmetb commented Sep 23, 2021

Fixes: #6489

Description

Used in buildkit mode, allow users to specify docker secrets provided via env
vars to Skaffold (and hence docker/buildkit) in addition to file sources
("src").

I am setting "src" and "env" as mutually exclusive here in skaffold, however
docker currently does not enforce this (but "env" takes precedence regardless
of the order if both specified).

If we receive issues about this, we can relax
it in a backwards-compatible way.

User facing changes (remove if N/A)

A backwards-compatible new field introduced in the schema (DockerSecret.env)
mutually exclusive with DockerSecret.src.

@ahmetb ahmetb requested a review from a team as a code owner September 23, 2021 16:33
@ahmetb ahmetb requested a review from tejal29 September 23, 2021 16:33
@google-cla google-cla bot added the cla: yes label Sep 23, 2021
@codecov
Copy link

codecov bot commented Sep 23, 2021

Codecov Report

Merging #6632 (296610d) into main (290280e) will decrease coverage by 0.47%.
The diff coverage is 74.60%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6632      +/-   ##
==========================================
- Coverage   70.48%   70.00%   -0.48%     
==========================================
  Files         515      522       +7     
  Lines       23150    23705     +555     
==========================================
+ Hits        16317    16595     +278     
- Misses       5776     6025     +249     
- Partials     1057     1085      +28     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/flags.go 89.00% <0.00%> (-1.82%) ⬇️
cmd/skaffold/skaffold.go 0.00% <ø> (ø)
pkg/diag/recommender/container_errors.go 0.00% <0.00%> (ø)
pkg/diag/validator/pod.go 1.32% <0.00%> (ø)
pkg/skaffold/build/buildpacks/logger.go 0.00% <ø> (ø)
pkg/skaffold/build/cluster/logs.go 0.00% <ø> (-16.67%) ⬇️
pkg/skaffold/build/jib/errors.go 48.93% <50.00%> (ø)
cmd/skaffold/app/cmd/cmd.go 70.32% <66.66%> (-0.73%) ⬇️
pkg/diag/validator/resource.go 47.05% <66.66%> (ø)
pkg/skaffold/build/docker/docker.go 86.44% <66.66%> (-2.85%) ⬇️
... and 77 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb9037a...296610d. Read the comment docs.

@ahmetb ahmetb changed the title build/docker: support env as secret source feat:(build/docker): support env as secret source Sep 23, 2021
Used in buildkit mode, allow users to specify secrets provided via env vars to
Skaffold (and hence docker/buildkit) in addition to file sources ("src").

I am setting "src" and "env" as mutually exclusive here in skaffold, however
docker currently does not enforce this (but "env" takes precedence regardless
of the order if both specified).

If we receive issues about this, we can relax
it in a backwards-compatible way.

Signed-off-by: Ahmet Alp Balkan <[email protected]>
@tejal29 tejal29 merged commit 151b8d3 into GoogleContainerTools:main Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] Ability to load secrets from environment variables
2 participants