Skip to content

Commit 278d64c

Browse files
committed
Include 9509
Signed-off-by: Sascha Grunert <[email protected]>
1 parent 5a35fbc commit 278d64c

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

server/image_pull.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ func (s *Server) pullImage(ctx context.Context, pullArgs *pullArguments) (storag
144144
return storage.RegistryImageReference{}, fmt.Errorf("get context for namespace: %w", err)
145145
}
146146

147+
log.Debugf(ctx, "Using pull policy path for image %s: %q", pullArgs.image, sourceCtx.SignaturePolicyPath)
148+
147149
if pullArgs.namespace != "" {
148150
authCleanup, err := s.prepareTempAuthFile(ctx, &sourceCtx, pullArgs.image, pullArgs.namespace)
149151
if err != nil {
@@ -152,24 +154,11 @@ func (s *Server) pullImage(ctx context.Context, pullArgs *pullArguments) (storag
152154
defer authCleanup()
153155
}
154156

155-
log.Debugf(ctx, "Using pull policy path for image %s: %q", pullArgs.image, sourceCtx.SignaturePolicyPath)
156-
157157
sourceCtx.DockerLogMirrorChoice = true // Add info level log of the pull source
158158
if pullArgs.credentials.Username != "" {
159159
sourceCtx.DockerAuthConfig = &pullArgs.credentials
160160
}
161161

162-
if pullArgs.namespace != "" {
163-
policyPath := filepath.Join(s.config.SignaturePolicyDir, pullArgs.namespace+".json")
164-
if _, err := os.Stat(policyPath); err == nil {
165-
sourceCtx.SignaturePolicyPath = policyPath
166-
} else if !os.IsNotExist(err) {
167-
return storage.RegistryImageReference{}, fmt.Errorf("read policy path %s: %w", policyPath, err)
168-
}
169-
}
170-
171-
log.Debugf(ctx, "Using pull policy path for image %s: %s", pullArgs.image, sourceCtx.SignaturePolicyPath)
172-
173162
decryptConfig, err := getDecryptionKeys(s.config.DecryptionKeysPath)
174163
if err != nil {
175164
return storage.RegistryImageReference{}, err

0 commit comments

Comments
 (0)