mirror of
https://github.com/containers/podman.git
synced 2025-06-24 11:28:24 +08:00
Simplify the header decision in pkg/bindings/images.Build a bit
... now that two of the three cases are the same. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
@ -293,14 +293,10 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
|
||||
headers map[string]string
|
||||
err error
|
||||
)
|
||||
if options.SystemContext == nil {
|
||||
headers, err = auth.MakeXRegistryConfigHeader(options.SystemContext, "", "")
|
||||
if options.SystemContext != nil && options.SystemContext.DockerAuthConfig != nil {
|
||||
headers, err = auth.MakeXRegistryAuthHeader(options.SystemContext, options.SystemContext.AuthFilePath, options.SystemContext.DockerAuthConfig.Username, options.SystemContext.DockerAuthConfig.Password)
|
||||
} else {
|
||||
if options.SystemContext.DockerAuthConfig != nil {
|
||||
headers, err = auth.MakeXRegistryAuthHeader(options.SystemContext, options.SystemContext.AuthFilePath, options.SystemContext.DockerAuthConfig.Username, options.SystemContext.DockerAuthConfig.Password)
|
||||
} else {
|
||||
headers, err = auth.MakeXRegistryConfigHeader(options.SystemContext, "", "")
|
||||
}
|
||||
headers, err = auth.MakeXRegistryConfigHeader(options.SystemContext, "", "")
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user