Call MakeXRegistryConfigHeader instead of Header(..., XRegistryConfigHeader)

All callers hard-code a header value, so this is actually shorter.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2021-09-11 23:05:22 +02:00
parent 8155fb5658
commit d073b1275d

View File

@ -294,12 +294,12 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
err error
)
if options.SystemContext == nil {
headers, err = auth.Header(options.SystemContext, auth.XRegistryConfigHeader, "", "", "")
headers, err = auth.MakeXRegistryConfigHeader(options.SystemContext, "", "", "")
} else {
if options.SystemContext.DockerAuthConfig != nil {
headers, err = auth.Header(options.SystemContext, auth.XRegistryAuthHeader, options.SystemContext.AuthFilePath, options.SystemContext.DockerAuthConfig.Username, options.SystemContext.DockerAuthConfig.Password)
} else {
headers, err = auth.Header(options.SystemContext, auth.XRegistryConfigHeader, options.SystemContext.AuthFilePath, "", "")
headers, err = auth.MakeXRegistryConfigHeader(options.SystemContext, options.SystemContext.AuthFilePath, "", "")
}
}
if err != nil {