@@ -21,7 +21,6 @@ import (
21
21
"os/exec"
22
22
23
23
"k8s.io/kubernetes/test/e2e/framework"
24
- e2elog "k8s.io/kubernetes/test/e2e/framework/log"
25
24
26
25
"github.com/onsi/ginkgo"
27
26
)
@@ -35,64 +34,64 @@ var _ = framework.KubeDescribe("GKE node pools [Feature:GKENodePool]", func() {
35
34
})
36
35
37
36
ginkgo .It ("should create a cluster with multiple node pools [Feature:GKENodePool]" , func () {
38
- e2elog .Logf ("Start create node pool test" )
37
+ framework .Logf ("Start create node pool test" )
39
38
testCreateDeleteNodePool (f , "test-pool" )
40
39
})
41
40
})
42
41
43
42
func testCreateDeleteNodePool (f * framework.Framework , poolName string ) {
44
- e2elog .Logf ("Create node pool: %q in cluster: %q" , poolName , framework .TestContext .CloudConfig .Cluster )
43
+ framework .Logf ("Create node pool: %q in cluster: %q" , poolName , framework .TestContext .CloudConfig .Cluster )
45
44
46
45
clusterStr := fmt .Sprintf ("--cluster=%s" , framework .TestContext .CloudConfig .Cluster )
47
46
48
47
out , err := exec .Command ("gcloud" , "container" , "node-pools" , "create" ,
49
48
poolName ,
50
49
clusterStr ,
51
50
"--num-nodes=2" ).CombinedOutput ()
52
- e2elog .Logf ("\n %s" , string (out ))
51
+ framework .Logf ("\n %s" , string (out ))
53
52
if err != nil {
54
- e2elog .Failf ("Failed to create node pool %q. Err: %v\n %v" , poolName , err , string (out ))
53
+ framework .Failf ("Failed to create node pool %q. Err: %v\n %v" , poolName , err , string (out ))
55
54
}
56
- e2elog .Logf ("Successfully created node pool %q." , poolName )
55
+ framework .Logf ("Successfully created node pool %q." , poolName )
57
56
58
57
out , err = exec .Command ("gcloud" , "container" , "node-pools" , "list" ,
59
58
clusterStr ).CombinedOutput ()
60
59
if err != nil {
61
- e2elog .Failf ("Failed to list node pools from cluster %q. Err: %v\n %v" , framework .TestContext .CloudConfig .Cluster , err , string (out ))
60
+ framework .Failf ("Failed to list node pools from cluster %q. Err: %v\n %v" , framework .TestContext .CloudConfig .Cluster , err , string (out ))
62
61
}
63
- e2elog .Logf ("Node pools:\n %s" , string (out ))
62
+ framework .Logf ("Node pools:\n %s" , string (out ))
64
63
65
- e2elog .Logf ("Checking that 2 nodes have the correct node pool label." )
64
+ framework .Logf ("Checking that 2 nodes have the correct node pool label." )
66
65
nodeCount := nodesWithPoolLabel (f , poolName )
67
66
if nodeCount != 2 {
68
- e2elog .Failf ("Wanted 2 nodes with node pool label, got: %v" , nodeCount )
67
+ framework .Failf ("Wanted 2 nodes with node pool label, got: %v" , nodeCount )
69
68
}
70
- e2elog .Logf ("Success, found 2 nodes with correct node pool labels." )
69
+ framework .Logf ("Success, found 2 nodes with correct node pool labels." )
71
70
72
- e2elog .Logf ("Deleting node pool: %q in cluster: %q" , poolName , framework .TestContext .CloudConfig .Cluster )
71
+ framework .Logf ("Deleting node pool: %q in cluster: %q" , poolName , framework .TestContext .CloudConfig .Cluster )
73
72
out , err = exec .Command ("gcloud" , "container" , "node-pools" , "delete" ,
74
73
poolName ,
75
74
clusterStr ,
76
75
"-q" ).CombinedOutput ()
77
- e2elog .Logf ("\n %s" , string (out ))
76
+ framework .Logf ("\n %s" , string (out ))
78
77
if err != nil {
79
- e2elog .Failf ("Failed to delete node pool %q. Err: %v\n %v" , poolName , err , string (out ))
78
+ framework .Failf ("Failed to delete node pool %q. Err: %v\n %v" , poolName , err , string (out ))
80
79
}
81
- e2elog .Logf ("Successfully deleted node pool %q." , poolName )
80
+ framework .Logf ("Successfully deleted node pool %q." , poolName )
82
81
83
82
out , err = exec .Command ("gcloud" , "container" , "node-pools" , "list" ,
84
83
clusterStr ).CombinedOutput ()
85
84
if err != nil {
86
- e2elog .Failf ("\n Failed to list node pools from cluster %q. Err: %v\n %v" , framework .TestContext .CloudConfig .Cluster , err , string (out ))
85
+ framework .Failf ("\n Failed to list node pools from cluster %q. Err: %v\n %v" , framework .TestContext .CloudConfig .Cluster , err , string (out ))
87
86
}
88
- e2elog .Logf ("\n Node pools:\n %s" , string (out ))
87
+ framework .Logf ("\n Node pools:\n %s" , string (out ))
89
88
90
- e2elog .Logf ("Checking that no nodes have the deleted node pool's label." )
89
+ framework .Logf ("Checking that no nodes have the deleted node pool's label." )
91
90
nodeCount = nodesWithPoolLabel (f , poolName )
92
91
if nodeCount != 0 {
93
- e2elog .Failf ("Wanted 0 nodes with node pool label, got: %v" , nodeCount )
92
+ framework .Failf ("Wanted 0 nodes with node pool label, got: %v" , nodeCount )
94
93
}
95
- e2elog .Logf ("Success, found no nodes with the deleted node pool's label." )
94
+ framework .Logf ("Success, found no nodes with the deleted node pool's label." )
96
95
}
97
96
98
97
// nodesWithPoolLabel returns the number of nodes that have the "gke-nodepool"
0 commit comments