@@ -193,7 +193,7 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
193193
194194 By ("validating that the Prometheus manager has provisioned the Service" )
195195 Eventually (func (g Gomega ) {
196- _ , err : = kbc .Kubectl .Get (
196+ _ , err = kbc .Kubectl .Get (
197197 false ,
198198 "Service" , "prometheus-operator" )
199199 g .Expect (err ).NotTo (HaveOccurred ())
@@ -207,7 +207,8 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
207207
208208 if hasNetworkPolicies {
209209 By ("Checking for Calico pods" )
210- outputGet , err := kbc .Kubectl .Get (
210+ var outputGet string
211+ outputGet , err = kbc .Kubectl .Get (
211212 false ,
212213 "pods" ,
213214 "-n" , "kube-system" ,
@@ -223,7 +224,8 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
223224 "metrics=enabled" )).Error ().NotTo (HaveOccurred ())
224225
225226 By ("Ensuring the Allow Metrics Traffic NetworkPolicy exists" , func () {
226- output , err := kbc .Kubectl .Get (
227+ var output string
228+ output , err = kbc .Kubectl .Get (
227229 true ,
228230 "networkpolicy" , fmt .Sprintf ("e2e-%s-allow-metrics-traffic" , kbc .TestSuffix ),
229231 )
@@ -240,7 +242,8 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
240242 Expect (err ).NotTo (HaveOccurred ())
241243
242244 By ("Ensuring the allow-webhook-traffic NetworkPolicy exists" , func () {
243- output , err := kbc .Kubectl .Get (
245+ var output string
246+ output , err = kbc .Kubectl .Get (
244247 true ,
245248 "networkpolicy" , fmt .Sprintf ("e2e-%s-allow-webhook-traffic" , kbc .TestSuffix ),
246249 )
@@ -255,7 +258,8 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
255258 By ("validating that cert-manager has provisioned the certificate Secret" )
256259
257260 verifyWebhookCert := func (g Gomega ) {
258- output , err := kbc .Kubectl .Get (
261+ var output string
262+ output , err = kbc .Kubectl .Get (
259263 true ,
260264 "secrets" , "webhook-server-cert" )
261265 g .Expect (err ).ToNot (HaveOccurred (), "webhook-server-cert should exist in the namespace" )
@@ -266,7 +270,8 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
266270
267271 By ("validating that the mutating|validating webhooks have the CA injected" )
268272 verifyCAInjection := func (g Gomega ) {
269- mwhOutput , err := kbc .Kubectl .Get (
273+ var mwhOutput , vwhOutput string
274+ mwhOutput , err = kbc .Kubectl .Get (
270275 false ,
271276 "mutatingwebhookconfigurations.admissionregistration.k8s.io" ,
272277 fmt .Sprintf ("e2e-%s-mutating-webhook-configuration" , kbc .TestSuffix ),
@@ -275,7 +280,7 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
275280 // check that ca should be long enough, because there may be a place holder "\n"
276281 g .Expect (len (mwhOutput )).To (BeNumerically (">" , 10 ))
277282
278- vwhOutput , err : = kbc .Kubectl .Get (
283+ vwhOutput , err = kbc .Kubectl .Get (
279284 false ,
280285 "validatingwebhookconfigurations.admissionregistration.k8s.io" ,
281286 fmt .Sprintf ("e2e-%s-validating-webhook-configuration" , kbc .TestSuffix ),
@@ -290,7 +295,8 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
290295 By ("validating that the CA injection is applied for CRD conversion" )
291296 crdKind := "ConversionTest"
292297 verifyCAInjection = func (g Gomega ) {
293- crdOutput , err := kbc .Kubectl .Get (
298+ var crdOutput string
299+ crdOutput , err = kbc .Kubectl .Get (
294300 false ,
295301 "customresourcedefinition.apiextensions.k8s.io" ,
296302 "-o" , fmt .Sprintf (
@@ -366,7 +372,7 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
366372 By ("applying the CR in the created namespace" )
367373
368374 applySampleNamespaced := func (g Gomega ) {
369- _ , err : = kbc .Kubectl .Apply (false , "-n" , namespace , "-f" , sampleFile )
375+ _ , err = kbc .Kubectl .Apply (false , "-n" , namespace , "-f" , sampleFile )
370376 g .Expect (err ).To (Not (HaveOccurred ()))
371377 }
372378 Eventually (applySampleNamespaced , 2 * time .Minute , time .Second ).Should (Succeed ())
@@ -493,7 +499,8 @@ func getMetricsOutput(kbc *utils.TestContext) string {
493499
494500 By ("ensuring the service endpoint is ready" )
495501 checkServiceEndpoint := func (g Gomega ) {
496- output , err := kbc .Kubectl .Get (
502+ var output string
503+ output , err = kbc .Kubectl .Get (
497504 true ,
498505 "endpoints" , fmt .Sprintf ("e2e-%s-controller-manager-metrics-service" , kbc .TestSuffix ),
499506 "-o" , "jsonpath={.subsets[*].addresses[*].ip}" ,
@@ -511,7 +518,8 @@ func getMetricsOutput(kbc *utils.TestContext) string {
511518
512519 By ("validating that the curl pod is running as expected" )
513520 verifyCurlUp := func (g Gomega ) {
514- status , err := kbc .Kubectl .Get (
521+ var status string
522+ status , err = kbc .Kubectl .Get (
515523 true ,
516524 "pods" , "curl" , "-o" , "jsonpath={.status.phase}" )
517525 g .Expect (err ).NotTo (HaveOccurred ())
0 commit comments