Skip to content

Commit

Permalink
e2e: fix error to run tests with shouldProvisionCluster false
Browse files Browse the repository at this point in the history
Fixes confidential-containers#693

Signed-off-by: Lei Li <[email protected]>
Signed-off-by: Lei Li <[email protected]>
  • Loading branch information
Lei Li authored and liudalibj committed Mar 10, 2023
1 parent cf3441c commit 867ff31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions test/e2e/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ func TestMain(m *testing.M) {
// key2 = "value2"
provisionPropsFile := os.Getenv("TEST_E2E_PROVISION_FILE")

if shouldProvisionCluster || podvmImage != "" {
// Get an provisioner instance for the cloud provider.
provisioner, err = pv.GetCloudProvisioner(cloudProvider, provisionPropsFile)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
// Get an provisioner instance for the cloud provider.
provisioner, err = pv.GetCloudProvisioner(cloudProvider, provisionPropsFile)
if err != nil {
fmt.Println(err)
os.Exit(1)
}

if !shouldProvisionCluster {
Expand Down
2 changes: 1 addition & 1 deletion test/provisioner/provision_ibmcloud_initializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func initProperties(properties map[string]string) error {
}

podvmImage := os.Getenv("TEST_E2E_PODVM_IMAGE")
if len(podvmImage) >= 0 {
if len(podvmImage) > 0 {
if len(IBMCloudProps.CosApiKey) <= 0 {
return errors.New("COS_APIKEY was not set.")
}
Expand Down

0 comments on commit 867ff31

Please sign in to comment.