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

Update config/secret handling: Copy files into containers instead of bind mounting #12448

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into fix-configs-secrets-2
Signed-off-by: schaubl <schaubl@users.noreply.github.com>
  • Loading branch information
schaubl committed Feb 18, 2025
commit 66579df61e5a0e57bc4aa0c0ee7219bcc4156e45
8 changes: 4 additions & 4 deletions pkg/compose/secrets.go
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ func (s *composeService) injectSecrets(ctx context.Context, project *types.Proje
if file.Environment != "" {
env, ok := project.Environment[file.Environment]
if !ok {
return fmt.Errorf("environment variable %q required by file %q is not set", file.Environment, file.Name)
return fmt.Errorf("environment variable %q required by secret %q is not set", file.Environment, file.Name)
}
content = env
} else if file.File != "" {
@@ -53,9 +53,9 @@ func (s *composeService) injectSecrets(ctx context.Context, project *types.Proje
}

if service.ReadOnly {
return fmt.Errorf("cannot create secret %q in read-only service %s: `file` is the sole supported option", file.Name, service.Name)
return fmt.Errorf("cannot create secret %q in read-only service %s", file.Name, service.Name)
}

if config.Target == "" {
config.Target = "/run/secrets/" + config.Source
} else if !isAbsTarget(config.Target) {
@@ -101,7 +101,7 @@ func (s *composeService) injectConfigs(ctx context.Context, project *types.Proje
}

if service.ReadOnly {
return fmt.Errorf("cannot create config %q in read-only service %s: `file` is the sole supported option", file.Name, service.Name)
return fmt.Errorf("cannot create config %q in read-only service %s", file.Name, service.Name)
}

if config.Target == "" {
You are viewing a condensed version of this merge commit. You can view the full changes here.