@@ -425,8 +425,7 @@ func NewCmdConfigImagesPull() *cobra.Command {
425
425
kubeadmutil .CheckErr (err )
426
426
containerRuntime , err := utilruntime .NewContainerRuntime (utilsexec .New (), internalcfg .GetCRISocket ())
427
427
kubeadmutil .CheckErr (err )
428
- imagesPull := NewImagesPull (containerRuntime , images .GetAllImages (& internalcfg .ClusterConfiguration ))
429
- kubeadmutil .CheckErr (imagesPull .PullAll ())
428
+ PullControlPlaneImages (containerRuntime , & internalcfg .ClusterConfiguration )
430
429
},
431
430
}
432
431
AddImagesCommonConfigFlags (cmd .PersistentFlags (), externalcfg , & cfgPath , & featureGatesString )
@@ -449,10 +448,11 @@ func NewImagesPull(runtime utilruntime.ContainerRuntime, images []string) *Image
449
448
}
450
449
}
451
450
452
- // PullAll pulls all images that the ImagesPull knows about
453
- func (ip * ImagesPull ) PullAll () error {
454
- for _ , image := range ip .images {
455
- if err := ip .runtime .PullImage (image ); err != nil {
451
+ // PullControlPlaneImages pulls all images that the ImagesPull knows about
452
+ func PullControlPlaneImages (runtime utilruntime.ContainerRuntime , cfg * kubeadmapi.ClusterConfiguration ) error {
453
+ images := images .GetControlPlaneImages (cfg )
454
+ for _ , image := range images {
455
+ if err := runtime .PullImage (image ); err != nil {
456
456
return errors .Wrapf (err , "failed to pull image %q" , image )
457
457
}
458
458
fmt .Printf ("[config/images] Pulled %s\n " , image )
@@ -507,7 +507,7 @@ type ImagesList struct {
507
507
508
508
// Run runs the images command and writes the result to the io.Writer passed in
509
509
func (i * ImagesList ) Run (out io.Writer ) error {
510
- imgs := images .GetAllImages (& i .cfg .ClusterConfiguration )
510
+ imgs := images .GetControlPlaneImages (& i .cfg .ClusterConfiguration )
511
511
for _ , img := range imgs {
512
512
fmt .Fprintln (out , img )
513
513
}
0 commit comments