mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +08:00
Pass --tls-verify option in podman -remote build
Fixes: https://github.com/containers/podman/issues/13979 [NO NEW TESTS NEEDED] Buildah has a test for this. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -123,6 +123,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
|
|||||||
Tags []string `schema:"t"`
|
Tags []string `schema:"t"`
|
||||||
Target string `schema:"target"`
|
Target string `schema:"target"`
|
||||||
Timestamp int64 `schema:"timestamp"`
|
Timestamp int64 `schema:"timestamp"`
|
||||||
|
TLSVerify bool `schema:"tlsVerify"`
|
||||||
Ulimits string `schema:"ulimits"`
|
Ulimits string `schema:"ulimits"`
|
||||||
UnsetEnvs []string `schema:"unsetenv"`
|
UnsetEnvs []string `schema:"unsetenv"`
|
||||||
Secrets string `schema:"secrets"`
|
Secrets string `schema:"secrets"`
|
||||||
@ -491,6 +492,11 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
utils.PossiblyEnforceDockerHub(r, systemContext)
|
utils.PossiblyEnforceDockerHub(r, systemContext)
|
||||||
|
|
||||||
|
if _, found := r.URL.Query()["tlsVerify"]; found {
|
||||||
|
systemContext.DockerInsecureSkipTLSVerify = types.NewOptionalBool(!query.TLSVerify)
|
||||||
|
systemContext.OCIInsecureSkipTLSVerify = !query.TLSVerify
|
||||||
|
systemContext.DockerDaemonInsecureSkipTLSVerify = !query.TLSVerify
|
||||||
|
}
|
||||||
// Channels all mux'ed in select{} below to follow API build protocol
|
// Channels all mux'ed in select{} below to follow API build protocol
|
||||||
stdout := channel.NewWriter(make(chan []byte))
|
stdout := channel.NewWriter(make(chan []byte))
|
||||||
defer stdout.Close()
|
defer stdout.Close()
|
||||||
|
@ -312,10 +312,15 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
|
|||||||
var (
|
var (
|
||||||
headers http.Header
|
headers http.Header
|
||||||
)
|
)
|
||||||
if options.SystemContext != nil && options.SystemContext.DockerAuthConfig != nil {
|
if options.SystemContext != nil {
|
||||||
headers, err = auth.MakeXRegistryAuthHeader(options.SystemContext, options.SystemContext.DockerAuthConfig.Username, options.SystemContext.DockerAuthConfig.Password)
|
if options.SystemContext.DockerAuthConfig != nil {
|
||||||
} else {
|
headers, err = auth.MakeXRegistryAuthHeader(options.SystemContext, options.SystemContext.DockerAuthConfig.Username, options.SystemContext.DockerAuthConfig.Password)
|
||||||
headers, err = auth.MakeXRegistryConfigHeader(options.SystemContext, "", "")
|
} else {
|
||||||
|
headers, err = auth.MakeXRegistryConfigHeader(options.SystemContext, "", "")
|
||||||
|
}
|
||||||
|
if options.SystemContext.DockerInsecureSkipTLSVerify == types.OptionalBoolTrue {
|
||||||
|
params.Set("tlsVerify", "false")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Reference in New Issue
Block a user