@@ -30,7 +30,6 @@ import (
30
30
netutil "k8s.io/apimachinery/pkg/util/net"
31
31
"k8s.io/apimachinery/pkg/util/wait"
32
32
clientset "k8s.io/client-go/kubernetes"
33
- "k8s.io/kubernetes/cmd/kubeadm/app/constants"
34
33
kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants"
35
34
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
36
35
)
@@ -77,7 +76,7 @@ func NewKubeWaiter(client clientset.Interface, timeout time.Duration, writer io.
77
76
// WaitForAPI waits for the API Server's /healthz endpoint to report "ok"
78
77
func (w * KubeWaiter ) WaitForAPI () error {
79
78
start := time .Now ()
80
- return wait .PollImmediate (constants .APICallRetryInterval , w .timeout , func () (bool , error ) {
79
+ return wait .PollImmediate (kubeadmconstants .APICallRetryInterval , w .timeout , func () (bool , error ) {
81
80
healthStatus := 0
82
81
w .client .Discovery ().RESTClient ().Get ().AbsPath ("/healthz" ).Do ().StatusCode (& healthStatus )
83
82
if healthStatus != http .StatusOK {
@@ -94,7 +93,7 @@ func (w *KubeWaiter) WaitForAPI() error {
94
93
func (w * KubeWaiter ) WaitForPodsWithLabel (kvLabel string ) error {
95
94
96
95
lastKnownPodNumber := - 1
97
- return wait .PollImmediate (constants .APICallRetryInterval , w .timeout , func () (bool , error ) {
96
+ return wait .PollImmediate (kubeadmconstants .APICallRetryInterval , w .timeout , func () (bool , error ) {
98
97
listOpts := metav1.ListOptions {LabelSelector : kvLabel }
99
98
pods , err := w .client .CoreV1 ().Pods (metav1 .NamespaceSystem ).List (listOpts )
100
99
if err != nil {
@@ -123,7 +122,7 @@ func (w *KubeWaiter) WaitForPodsWithLabel(kvLabel string) error {
123
122
124
123
// WaitForPodToDisappear blocks until it timeouts or gets a "NotFound" response from the API Server when getting the Static Pod in question
125
124
func (w * KubeWaiter ) WaitForPodToDisappear (podName string ) error {
126
- return wait .PollImmediate (constants .APICallRetryInterval , w .timeout , func () (bool , error ) {
125
+ return wait .PollImmediate (kubeadmconstants .APICallRetryInterval , w .timeout , func () (bool , error ) {
127
126
_ , err := w .client .CoreV1 ().Pods (metav1 .NamespaceSystem ).Get (podName , metav1.GetOptions {})
128
127
if apierrors .IsNotFound (err ) {
129
128
fmt .Printf ("[apiclient] The old Pod %q is now removed (which is desired)\n " , podName )
@@ -187,8 +186,8 @@ func (w *KubeWaiter) WaitForStaticPodControlPlaneHashes(nodeName string) (map[st
187
186
componentHash := ""
188
187
var err error
189
188
mirrorPodHashes := map [string ]string {}
190
- for _ , component := range constants .ControlPlaneComponents {
191
- err = wait .PollImmediate (constants .APICallRetryInterval , w .timeout , func () (bool , error ) {
189
+ for _ , component := range kubeadmconstants .ControlPlaneComponents {
190
+ err = wait .PollImmediate (kubeadmconstants .APICallRetryInterval , w .timeout , func () (bool , error ) {
192
191
componentHash , err = getStaticPodSingleHash (w .client , nodeName , component )
193
192
if err != nil {
194
193
return false , nil
@@ -209,7 +208,7 @@ func (w *KubeWaiter) WaitForStaticPodSingleHash(nodeName string, component strin
209
208
210
209
componentPodHash := ""
211
210
var err error
212
- err = wait .PollImmediate (constants .APICallRetryInterval , w .timeout , func () (bool , error ) {
211
+ err = wait .PollImmediate (kubeadmconstants .APICallRetryInterval , w .timeout , func () (bool , error ) {
213
212
componentPodHash , err = getStaticPodSingleHash (w .client , nodeName , component )
214
213
if err != nil {
215
214
return false , nil
@@ -223,7 +222,7 @@ func (w *KubeWaiter) WaitForStaticPodSingleHash(nodeName string, component strin
223
222
// WaitForStaticPodHashChange blocks until it timeouts or notices that the Mirror Pod (for the Static Pod, respectively) has changed
224
223
// This implicitly means this function blocks until the kubelet has restarted the Static Pod in question
225
224
func (w * KubeWaiter ) WaitForStaticPodHashChange (nodeName , component , previousHash string ) error {
226
- return wait .PollImmediate (constants .APICallRetryInterval , w .timeout , func () (bool , error ) {
225
+ return wait .PollImmediate (kubeadmconstants .APICallRetryInterval , w .timeout , func () (bool , error ) {
227
226
228
227
hash , err := getStaticPodSingleHash (w .client , nodeName , component )
229
228
if err != nil {
0 commit comments