@@ -18,7 +18,6 @@ package upgrade
18
18
19
19
import (
20
20
"fmt"
21
- "time"
22
21
23
22
"github.com/pkg/errors"
24
23
"github.com/spf13/cobra"
@@ -27,18 +26,13 @@ import (
27
26
"k8s.io/klog"
28
27
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
29
28
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/options"
30
- "k8s.io/kubernetes/cmd/kubeadm/app/constants"
31
29
"k8s.io/kubernetes/cmd/kubeadm/app/features"
32
30
"k8s.io/kubernetes/cmd/kubeadm/app/phases/upgrade"
33
31
kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util"
34
32
"k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient"
35
33
configutil "k8s.io/kubernetes/cmd/kubeadm/app/util/config"
36
34
)
37
35
38
- const (
39
- defaultImagePullTimeout = 15 * time .Minute
40
- )
41
-
42
36
// applyFlags holds the information about the flags that can be passed to apply
43
37
type applyFlags struct {
44
38
* applyPlanFlags
@@ -48,7 +42,6 @@ type applyFlags struct {
48
42
dryRun bool
49
43
etcdUpgrade bool
50
44
renewCerts bool
51
- imagePullTimeout time.Duration
52
45
kustomizeDir string
53
46
}
54
47
@@ -60,10 +53,9 @@ func (f *applyFlags) sessionIsInteractive() bool {
60
53
// NewCmdApply returns the cobra command for `kubeadm upgrade apply`
61
54
func NewCmdApply (apf * applyPlanFlags ) * cobra.Command {
62
55
flags := & applyFlags {
63
- applyPlanFlags : apf ,
64
- imagePullTimeout : defaultImagePullTimeout ,
65
- etcdUpgrade : true ,
66
- renewCerts : true ,
56
+ applyPlanFlags : apf ,
57
+ etcdUpgrade : true ,
58
+ renewCerts : true ,
67
59
}
68
60
69
61
cmd := & cobra.Command {
@@ -88,7 +80,6 @@ func NewCmdApply(apf *applyPlanFlags) *cobra.Command {
88
80
cmd .Flags ().BoolVar (& flags .dryRun , options .DryRun , flags .dryRun , "Do not change any state, just output what actions would be performed." )
89
81
cmd .Flags ().BoolVar (& flags .etcdUpgrade , "etcd-upgrade" , flags .etcdUpgrade , "Perform the upgrade of etcd." )
90
82
cmd .Flags ().BoolVar (& flags .renewCerts , options .CertificateRenewal , flags .renewCerts , "Perform the renewal of certificates used by component changed during upgrades." )
91
- cmd .Flags ().DurationVar (& flags .imagePullTimeout , "image-pull-timeout" , flags .imagePullTimeout , "The maximum amount of time to wait for the control plane pods to be downloaded." )
92
83
options .AddKustomizePodsFlag (cmd .Flags (), & flags .kustomizeDir )
93
84
94
85
return cmd
@@ -145,22 +136,7 @@ func runApply(flags *applyFlags, userVersion string) error {
145
136
}
146
137
}
147
138
148
- // Set the timeout as flags.imagePullTimeout to ensure that Prepuller truly respects 'image-pull-timeout' flag
149
- waiter := getWaiter (flags .dryRun , client , flags .imagePullTimeout )
150
-
151
- // Use a prepuller implementation based on creating DaemonSets
152
- // and block until all DaemonSets are ready; then we know for sure that all control plane images are cached locally
153
- klog .V (1 ).Infoln ("[upgrade/apply] creating prepuller" )
154
- prepuller := upgrade .NewDaemonSetPrepuller (client , waiter , & cfg .ClusterConfiguration )
155
- componentsToPrepull := constants .ControlPlaneComponents
156
- if cfg .Etcd .External == nil && flags .etcdUpgrade {
157
- componentsToPrepull = append (componentsToPrepull , constants .Etcd )
158
- }
159
- if err := upgrade .PrepullImagesInParallel (prepuller , flags .imagePullTimeout , componentsToPrepull ); err != nil {
160
- return errors .Wrap (err , "[upgrade/prepull] Failed prepulled the images for the control plane components error" )
161
- }
162
-
163
- waiter = getWaiter (flags .dryRun , client , upgrade .UpgradeManifestTimeout )
139
+ waiter := getWaiter (flags .dryRun , client , upgrade .UpgradeManifestTimeout )
164
140
165
141
// Now; perform the upgrade procedure
166
142
klog .V (1 ).Infoln ("[upgrade/apply] performing upgrade" )
0 commit comments