e2eTest.tenantClient.Update(context.TODO(), controller) <- we need to assign result to err variable
if err != nil {
log.Panic(err)
}
I also found sections where the code worked correctly without the variable definition, so I removed it.
## FYI
- The following is the result of all unit test on Local environment
```sh
❯ go clean -testcache && go test ./...
ok github.com/civo/civo-csi 70.103s
ok github.com/civo/civo-csi/e2e 0.007s
ok github.com/civo/civo-csi/pkg/driver 10.013s
The following is the result of all unit test on CI environment
WHAT
I fixed an small issue where errors were not being handled correctly in the test code. Additionally, I removed an unnecessary variable definition.
WHY
There were parts of the test code where errors were being handled, but no errors were assigned. I believe this needs to be fixed.
./e2e/suite_test.go:104-113
e2eTest.tenantClient.Update
method toerr
variableerr = e2eTest.tenantClient.Get(context.TODO(), client.ObjectKey{Namespace: "kube-system", Name: "civo-csi-controller"}, controller) if err != nil { log.Panic(err) }
controller.Spec.Template.Spec.Containers[3].Image = Image
e2eTest.tenantClient.Update(context.TODO(), controller) <- we need to assign result to err variable if err != nil { log.Panic(err) }