Skip to content

Commit

Permalink
fix(platform): support mirror config for worker (#2150)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo Ryu authored Nov 3, 2022
1 parent b02bfac commit f9205d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/platform/provider/baremetal/machine/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ func (p *Provider) EnsureContainerd(ctx context.Context, machine *platformv1.Mac
InsecureRegistries: insecureRegistries,
IsGPU: gpu.IsEnable(machine.Spec.Labels),
SandboxImage: images.Get().Pause.FullName(),
RegistryMirror: containerregistryutil.GetPrefix(),
// for mirror, we just need domain in prefix
RegistryMirror: strings.Split(containerregistryutil.GetPrefix(), "/")[0],
}
err = containerd.Install(machineSSH, option)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion pkg/platform/provider/baremetal/phases/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package image
import (
"fmt"
"strings"

platformv1 "tkestack.io/tke/api/platform/v1"
"tkestack.io/tke/pkg/platform/provider/baremetal/images"
v1 "tkestack.io/tke/pkg/platform/types/v1"
Expand Down Expand Up @@ -56,7 +57,7 @@ func PullKubernetesImages(c *v1.Cluster, s ssh.Interface, option *Option) error
return err
}
} else {
cmd = fmt.Sprintf("nerdctl --insecure-registry --namespace k8s.io pull %s", image)
cmd = fmt.Sprintf("crictl pull %s", image)
_, err := s.CombinedOutput(cmd)
if err != nil {
if strings.Contains(err.Error(), "502 Bad Gateway") {
Expand Down

0 comments on commit f9205d8

Please sign in to comment.