mirror of
https://github.com/rancher/rke.git
synced 2025-09-04 16:30:02 +00:00
fix_airgap
This commit is contained in:
@@ -169,17 +169,19 @@ func pullImage(ctx context.Context, dClient *client.Client, hostname string, con
|
|||||||
regURL := ref.Domain(containerNamed)
|
regURL := ref.Domain(containerNamed)
|
||||||
if pr, ok := prsMap[regURL]; ok {
|
if pr, ok := prsMap[regURL]; ok {
|
||||||
// We do this if we have some docker.io login information
|
// We do this if we have some docker.io login information
|
||||||
|
regAuth, err := getRegistryAuth(pr)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if pr.URL == DockerRegistryURL {
|
if pr.URL == DockerRegistryURL {
|
||||||
regAuth, err := getRegistryAuth(pr)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
pullOptions.RegistryAuth = regAuth
|
pullOptions.RegistryAuth = regAuth
|
||||||
} else {
|
} else {
|
||||||
// We have a registry, but it's not docker.io
|
// We have a registry, but it's not docker.io
|
||||||
// this could be public or private, ImagePull() can handle it
|
// this could be public or private, ImagePull() can handle it
|
||||||
// if we provide a PrivilegeFunc
|
// if we provide a PrivilegeFunc
|
||||||
|
|
||||||
pullOptions.PrivilegeFunc = tryRegistryAuth(pr)
|
pullOptions.PrivilegeFunc = tryRegistryAuth(pr)
|
||||||
|
pullOptions.RegistryAuth = regAuth
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user