@@ -194,7 +194,7 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
194194
195195 By ("validating that the Prometheus manager has provisioned the Service" )
196196 Eventually (func (g Gomega ) {
197- _ , err : = kbc .Kubectl .Get (
197+ _ , err = kbc .Kubectl .Get (
198198 false ,
199199 "Service" , "prometheus-operator" )
200200 g .Expect (err ).NotTo (HaveOccurred ())
@@ -208,7 +208,8 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
208208
209209 if hasNetworkPolicies {
210210 By ("Checking for Calico pods" )
211- outputGet , err := kbc .Kubectl .Get (
211+ var outputGet string
212+ outputGet , err = kbc .Kubectl .Get (
212213 false ,
213214 "pods" ,
214215 "-n" , "kube-system" ,
@@ -224,7 +225,8 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
224225 "metrics=enabled" )).Error ().NotTo (HaveOccurred ())
225226
226227 By ("Ensuring the Allow Metrics Traffic NetworkPolicy exists" , func () {
227- output , err := kbc .Kubectl .Get (
228+ var output string
229+ output , err = kbc .Kubectl .Get (
228230 true ,
229231 "networkpolicy" , fmt .Sprintf ("e2e-%s-allow-metrics-traffic" , kbc .TestSuffix ),
230232 )
@@ -241,7 +243,8 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
241243 Expect (err ).NotTo (HaveOccurred ())
242244
243245 By ("Ensuring the allow-webhook-traffic NetworkPolicy exists" , func () {
244- output , err := kbc .Kubectl .Get (
246+ var output string
247+ output , err = kbc .Kubectl .Get (
245248 true ,
246249 "networkpolicy" , fmt .Sprintf ("e2e-%s-allow-webhook-traffic" , kbc .TestSuffix ),
247250 )
@@ -256,7 +259,8 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
256259 By ("validating that cert-manager has provisioned the certificate Secret" )
257260
258261 verifyWebhookCert := func (g Gomega ) {
259- output , err := kbc .Kubectl .Get (
262+ var output string
263+ output , err = kbc .Kubectl .Get (
260264 true ,
261265 "secrets" , "webhook-server-cert" )
262266 g .Expect (err ).ToNot (HaveOccurred (), "webhook-server-cert should exist in the namespace" )
@@ -267,7 +271,8 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
267271
268272 By ("validating that the mutating|validating webhooks have the CA injected" )
269273 verifyCAInjection := func (g Gomega ) {
270- mwhOutput , err := kbc .Kubectl .Get (
274+ var mwhOutput , vwhOutput string
275+ mwhOutput , err = kbc .Kubectl .Get (
271276 false ,
272277 "mutatingwebhookconfigurations.admissionregistration.k8s.io" ,
273278 fmt .Sprintf ("e2e-%s-mutating-webhook-configuration" , kbc .TestSuffix ),
@@ -276,7 +281,7 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
276281 // check that ca should be long enough, because there may be a place holder "\n"
277282 g .Expect (len (mwhOutput )).To (BeNumerically (">" , 10 ))
278283
279- vwhOutput , err : = kbc .Kubectl .Get (
284+ vwhOutput , err = kbc .Kubectl .Get (
280285 false ,
281286 "validatingwebhookconfigurations.admissionregistration.k8s.io" ,
282287 fmt .Sprintf ("e2e-%s-validating-webhook-configuration" , kbc .TestSuffix ),
@@ -291,7 +296,8 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
291296 By ("validating that the CA injection is applied for CRD conversion" )
292297 crdKind := "ConversionTest"
293298 verifyCAInjection = func (g Gomega ) {
294- crdOutput , err := kbc .Kubectl .Get (
299+ var crdOutput string
300+ crdOutput , err = kbc .Kubectl .Get (
295301 false ,
296302 "customresourcedefinition.apiextensions.k8s.io" ,
297303 "-o" , fmt .Sprintf (
@@ -367,7 +373,7 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller, isToUseHelmChart,
367373 By ("applying the CR in the created namespace" )
368374
369375 applySampleNamespaced := func (g Gomega ) {
370- _ , err : = kbc .Kubectl .Apply (false , "-n" , namespace , "-f" , sampleFile )
376+ _ , err = kbc .Kubectl .Apply (false , "-n" , namespace , "-f" , sampleFile )
371377 g .Expect (err ).To (Not (HaveOccurred ()))
372378 }
373379 Eventually (applySampleNamespaced , 2 * time .Minute , time .Second ).Should (Succeed ())
@@ -494,7 +500,8 @@ func getMetricsOutput(kbc *utils.TestContext) string {
494500
495501 By ("ensuring the service endpoint is ready" )
496502 checkServiceEndpoint := func (g Gomega ) {
497- output , err := kbc .Kubectl .Get (
503+ var output string
504+ output , err = kbc .Kubectl .Get (
498505 true ,
499506 "endpoints" , fmt .Sprintf ("e2e-%s-controller-manager-metrics-service" , kbc .TestSuffix ),
500507 "-o" , "jsonpath={.subsets[*].addresses[*].ip}" ,
@@ -512,7 +519,8 @@ func getMetricsOutput(kbc *utils.TestContext) string {
512519
513520 By ("validating that the curl pod is running as expected" )
514521 verifyCurlUp := func (g Gomega ) {
515- status , err := kbc .Kubectl .Get (
522+ var status string
523+ status , err = kbc .Kubectl .Get (
516524 true ,
517525 "pods" , "curl" , "-o" , "jsonpath={.status.phase}" )
518526 g .Expect (err ).NotTo (HaveOccurred ())
0 commit comments