@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
14
14
limitations under the License.
15
15
*/
16
16
17
- package framework
17
+ package kubelet
18
18
19
19
import (
20
20
"crypto/tls"
@@ -31,6 +31,7 @@ import (
31
31
kubeletconfigv1beta1 "k8s.io/kubelet/config/v1beta1"
32
32
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
33
33
34
+ "k8s.io/kubernetes/test/e2e/framework"
34
35
e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"
35
36
)
36
37
@@ -52,47 +53,47 @@ func pollConfigz(timeout time.Duration, pollInterval time.Duration, nodeName, na
52
53
endpoint := ""
53
54
if useProxy {
54
55
// start local proxy, so we can send graceful deletion over query string, rather than body parameter
55
- Logf ("Opening proxy to cluster" )
56
- tk := e2ekubectl .NewTestKubeconfig (TestContext .CertDir , TestContext .Host , TestContext .KubeConfig , TestContext .KubeContext , TestContext .KubectlPath , namespace )
56
+ framework . Logf ("Opening proxy to cluster" )
57
+ tk := e2ekubectl .NewTestKubeconfig (framework . TestContext .CertDir , framework . TestContext .Host , framework . TestContext .KubeConfig , framework . TestContext .KubeContext , framework . TestContext .KubectlPath , namespace )
57
58
cmd := tk .KubectlCmd ("proxy" , "-p" , "0" )
58
- stdout , stderr , err := StartCmdAndStreamOutput (cmd )
59
- ExpectNoError (err )
59
+ stdout , stderr , err := framework . StartCmdAndStreamOutput (cmd )
60
+ framework . ExpectNoError (err )
60
61
defer stdout .Close ()
61
62
defer stderr .Close ()
62
- defer TryKill (cmd )
63
+ defer framework . TryKill (cmd )
63
64
64
65
buf := make ([]byte , 128 )
65
66
var n int
66
67
n , err = stdout .Read (buf )
67
- ExpectNoError (err )
68
+ framework . ExpectNoError (err )
68
69
output := string (buf [:n ])
69
70
proxyRegexp := regexp .MustCompile ("Starting to serve on 127.0.0.1:([0-9]+)" )
70
71
match := proxyRegexp .FindStringSubmatch (output )
71
- ExpectEqual (len (match ), 2 )
72
+ framework . ExpectEqual (len (match ), 2 )
72
73
port , err := strconv .Atoi (match [1 ])
73
- ExpectNoError (err )
74
- Logf ("http requesting node kubelet /configz" )
74
+ framework . ExpectNoError (err )
75
+ framework . Logf ("http requesting node kubelet /configz" )
75
76
endpoint = fmt .Sprintf ("http://127.0.0.1:%d/api/v1/nodes/%s/proxy/configz" , port , nodeName )
76
77
} else {
77
- endpoint = fmt .Sprintf ("http://127.0.0.1:8080/api/v1/nodes/%s/proxy/configz" , TestContext .NodeName )
78
+ endpoint = fmt .Sprintf ("http://127.0.0.1:8080/api/v1/nodes/%s/proxy/configz" , framework . TestContext .NodeName )
78
79
}
79
80
tr := & http.Transport {
80
81
TLSClientConfig : & tls.Config {InsecureSkipVerify : true },
81
82
}
82
83
client := & http.Client {Transport : tr }
83
84
req , err := http .NewRequest ("GET" , endpoint , nil )
84
- ExpectNoError (err )
85
+ framework . ExpectNoError (err )
85
86
req .Header .Add ("Accept" , "application/json" )
86
87
87
88
var resp * http.Response
88
89
wait .PollImmediate (pollInterval , timeout , func () (bool , error ) {
89
90
resp , err = client .Do (req )
90
91
if err != nil {
91
- Logf ("Failed to get /configz, retrying. Error: %v" , err )
92
+ framework . Logf ("Failed to get /configz, retrying. Error: %v" , err )
92
93
return false , nil
93
94
}
94
95
if resp .StatusCode != 200 {
95
- Logf ("/configz response status not 200, retrying. Response was: %+v" , resp )
96
+ framework . Logf ("/configz response status not 200, retrying. Response was: %+v" , resp )
96
97
return false , nil
97
98
}
98
99
0 commit comments