@@ -47,14 +47,14 @@ func describe() {
4747 f := framework .NewDefaultFramework ("sgxplugin" )
4848 f .NamespacePodSecurityEnforceLevel = admissionapi .LevelPrivileged
4949
50- deploymentWebhookPath , err := utils .LocateRepoFile (kustomizationWebhook )
51- if err != nil {
52- framework .Failf ("unable to locate %q: %v" , kustomizationWebhook , err )
50+ deploymentWebhookPath , errFailedToLocateRepoFile := utils .LocateRepoFile (kustomizationWebhook )
51+ if errFailedToLocateRepoFile != nil {
52+ framework .Failf ("unable to locate %q: %v" , kustomizationWebhook , errFailedToLocateRepoFile )
5353 }
5454
55- deploymentPluginPath , err := utils .LocateRepoFile (kustomizationPlugin )
56- if err != nil {
57- framework .Failf ("unable to locate %q: %v" , kustomizationPlugin , err )
55+ deploymentPluginPath , errFailedToLocateRepoFile := utils .LocateRepoFile (kustomizationPlugin )
56+ if errFailedToLocateRepoFile != nil {
57+ framework .Failf ("unable to locate %q: %v" , kustomizationPlugin , errFailedToLocateRepoFile )
5858 }
5959
6060 ginkgo .BeforeEach (func (ctx context.Context ) {
@@ -64,12 +64,12 @@ func describe() {
6464 e2ekubectl .RunKubectlOrDie (f .Namespace .Name , "apply" , "-k" , filepath .Dir (deploymentPluginPath ))
6565
6666 ginkgo .By ("waiting for SGX plugin's availability" )
67- podList , errPodNotRunning := e2epod .WaitForPodsWithLabelRunningReady (ctx , f .ClientSet , f .Namespace .Name ,
67+ podList , err := e2epod .WaitForPodsWithLabelRunningReady (ctx , f .ClientSet , f .Namespace .Name ,
6868 labels.Set {"app" : "intel-sgx-plugin" }.AsSelector (), 1 /* one replica */ , 100 * time .Second )
69- if errPodNotRunning != nil {
69+ if err != nil {
7070 e2edebug .DumpAllNamespaceInfo (ctx , f .ClientSet , f .Namespace .Name )
7171 e2ekubectl .LogFailedContainers (ctx , f .ClientSet , f .Namespace .Name , framework .Logf )
72- framework .Failf ("unable to wait for all pods to be running and ready: %v" , errPodNotRunning )
72+ framework .Failf ("unable to wait for all pods to be running and ready: %v" , err )
7373 }
7474
7575 ginkgo .By ("checking SGX plugin's securityContext" )
@@ -81,13 +81,13 @@ func describe() {
8181 ginkgo .Context ("When SGX resources are available" , func () {
8282 ginkgo .BeforeEach (func (ctx context.Context ) {
8383 ginkgo .By ("checking if the resource is allocatable" )
84- if err = utils .WaitForNodesWithResource (ctx , f .ClientSet , "sgx.intel.com/epc" , 150 * time .Second ); err != nil {
84+ if err : = utils .WaitForNodesWithResource (ctx , f .ClientSet , "sgx.intel.com/epc" , 150 * time .Second ); err != nil {
8585 framework .Failf ("unable to wait for nodes to have positive allocatable epc resource: %v" , err )
8686 }
87- if err = utils .WaitForNodesWithResource (ctx , f .ClientSet , "sgx.intel.com/enclave" , 30 * time .Second ); err != nil {
87+ if err : = utils .WaitForNodesWithResource (ctx , f .ClientSet , "sgx.intel.com/enclave" , 30 * time .Second ); err != nil {
8888 framework .Failf ("unable to wait for nodes to have positive allocatable enclave resource: %v" , err )
8989 }
90- if err = utils .WaitForNodesWithResource (ctx , f .ClientSet , "sgx.intel.com/provision" , 30 * time .Second ); err != nil {
90+ if err : = utils .WaitForNodesWithResource (ctx , f .ClientSet , "sgx.intel.com/provision" , 30 * time .Second ); err != nil {
9191 framework .Failf ("unable to wait for nodes to have positive allocatable provision resource: %v" , err )
9292 }
9393 })
0 commit comments