@@ -12,7 +12,7 @@ import (
1212
1313 k8s "github.com/Azure/azure-container-networking/test/integration"
1414 "github.com/Azure/azure-container-networking/test/integration/goldpinger"
15- k8sutils "github.com/Azure/azure-container-networking/test/internal/k8sutils "
15+ "github.com/Azure/azure-container-networking/test/internal/kubernetes "
1616 "github.com/Azure/azure-container-networking/test/internal/retry"
1717 "github.com/pkg/errors"
1818
@@ -74,17 +74,17 @@ func setupLinuxEnvironment(t *testing.T) {
7474 ctx := context .Background ()
7575
7676 t .Log ("Create Clientset" )
77- clientset , err := k8sutils .MustGetClientset ()
77+ clientset , err := kubernetes .MustGetClientset ()
7878 if err != nil {
7979 t .Fatalf ("could not get k8s clientset: %v" , err )
8080 }
8181
8282 t .Log ("Create Label Selectors" )
83- podLabelSelector := k8sutils .CreateLabelSelector (podLabelKey , podPrefix )
84- nodeLabelSelector := k8sutils .CreateLabelSelector (nodepoolKey , nodepoolSelector )
83+ podLabelSelector := kubernetes .CreateLabelSelector (podLabelKey , podPrefix )
84+ nodeLabelSelector := kubernetes .CreateLabelSelector (nodepoolKey , nodepoolSelector )
8585
8686 t .Log ("Get Nodes" )
87- nodes , err := k8sutils .GetNodeListByLabelSelector (ctx , clientset , nodeLabelSelector )
87+ nodes , err := kubernetes .GetNodeListByLabelSelector (ctx , clientset , nodeLabelSelector )
8888 if err != nil {
8989 t .Fatalf ("could not get k8s node list: %v" , err )
9090 }
@@ -96,29 +96,29 @@ func setupLinuxEnvironment(t *testing.T) {
9696 var deployment appsv1.Deployment
9797
9898 if * isDualStack {
99- deployment , err = k8sutils .MustParseDeployment (LinuxDeployIPv6 )
99+ deployment , err = kubernetes .MustParseDeployment (LinuxDeployIPv6 )
100100 if err != nil {
101101 t .Fatal (err )
102102 }
103103
104- daemonset , err = k8sutils .MustParseDaemonSet (gpDaemonsetIPv6 )
104+ daemonset , err = kubernetes .MustParseDaemonSet (gpDaemonsetIPv6 )
105105 if err != nil {
106106 t .Fatal (err )
107107 }
108108 } else {
109- deployment , err = k8sutils .MustParseDeployment (LinuxDeployIPV4 )
109+ deployment , err = kubernetes .MustParseDeployment (LinuxDeployIPV4 )
110110 if err != nil {
111111 t .Fatal (err )
112112 }
113113
114- daemonset , err = k8sutils .MustParseDaemonSet (gpDaemonset )
114+ daemonset , err = kubernetes .MustParseDaemonSet (gpDaemonset )
115115 if err != nil {
116116 t .Fatal (err )
117117 }
118118 }
119119
120120 // setup common RBAC, ClusteerRole, ClusterRoleBinding, ServiceAccount
121- rbacSetupFn , err := k8sutils .MustSetUpClusterRBAC (ctx , clientset , gpClusterRolePath , gpClusterRoleBindingPath , gpServiceAccountPath )
121+ rbacSetupFn , err := kubernetes .MustSetUpClusterRBAC (ctx , clientset , gpClusterRolePath , gpClusterRoleBindingPath , gpServiceAccountPath )
122122 if err != nil {
123123 t .Log (os .Getwd ())
124124 t .Fatal (err )
@@ -134,13 +134,13 @@ func setupLinuxEnvironment(t *testing.T) {
134134 daemonset .Namespace = * podNamespace
135135
136136 deploymentsClient := clientset .AppsV1 ().Deployments (* podNamespace )
137- err = k8sutils .MustCreateDeployment (ctx , deploymentsClient , deployment )
137+ err = kubernetes .MustCreateDeployment (ctx , deploymentsClient , deployment )
138138 if err != nil {
139139 t .Fatal (err )
140140 }
141141
142142 daemonsetClient := clientset .AppsV1 ().DaemonSets (daemonset .Namespace )
143- err = k8sutils .MustCreateDaemonset (ctx , daemonsetClient , daemonset )
143+ err = kubernetes .MustCreateDaemonset (ctx , daemonsetClient , daemonset )
144144 if err != nil {
145145 t .Fatal (err )
146146 }
@@ -159,7 +159,7 @@ func setupLinuxEnvironment(t *testing.T) {
159159 })
160160
161161 t .Log ("Waiting for pods to be running state" )
162- err = k8sutils .WaitForPodsRunning (ctx , clientset , * podNamespace , podLabelSelector )
162+ err = kubernetes .WaitForPodsRunning (ctx , clientset , * podNamespace , podLabelSelector )
163163 if err != nil {
164164 t .Fatalf ("Pods are not in running state due to %+v" , err )
165165 }
@@ -172,7 +172,7 @@ func setupLinuxEnvironment(t *testing.T) {
172172
173173 t .Log ("Checking Linux test environment" )
174174 for _ , node := range nodes .Items {
175- pods , err := k8sutils .GetPodsByNode (ctx , clientset , * podNamespace , podLabelSelector , node .Name )
175+ pods , err := kubernetes .GetPodsByNode (ctx , clientset , * podNamespace , podLabelSelector , node .Name )
176176 if err != nil {
177177 t .Fatalf ("could not get k8s clientset: %v" , err )
178178 }
@@ -188,20 +188,20 @@ func TestDatapathLinux(t *testing.T) {
188188 ctx := context .Background ()
189189
190190 t .Log ("Get REST config" )
191- restConfig := k8sutils .MustGetRestConfig (t )
191+ restConfig := kubernetes .MustGetRestConfig (t )
192192
193193 t .Log ("Create Clientset" )
194- clientset , err := k8sutils .MustGetClientset ()
194+ clientset , err := kubernetes .MustGetClientset ()
195195 if err != nil {
196196 t .Fatalf ("could not get k8s clientset: %v" , err )
197197 }
198198 setupLinuxEnvironment (t )
199- podLabelSelector := k8sutils .CreateLabelSelector (podLabelKey , podPrefix )
199+ podLabelSelector := kubernetes .CreateLabelSelector (podLabelKey , podPrefix )
200200
201201 t .Run ("Linux ping tests" , func (t * testing.T ) {
202202 // Check goldpinger health
203203 t .Run ("all pods have IPs assigned" , func (t * testing.T ) {
204- err := k8sutils .WaitForPodsRunning (ctx , clientset , * podNamespace , podLabelSelector )
204+ err := kubernetes .WaitForPodsRunning (ctx , clientset , * podNamespace , podLabelSelector )
205205 if err != nil {
206206 t .Fatalf ("Pods are not in running state due to %+v" , err )
207207 }
0 commit comments