Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove workerpool related fields from vpc cluster Read #5287

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions ibm/service/kubernetes/resource_ibm_container_vpc_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -945,13 +945,14 @@ func resourceIBMContainerVpcClusterRead(d *schema.ResourceData, meta interface{}
return fmt.Errorf("[ERROR] Error retrieving conatiner vpc cluster: %s", err)
}

workerPool, err := csClient.WorkerPools().GetWorkerPool(clusterID, "default", targetEnv)
wps, err := csClient.WorkerPools().ListWorkerPools(clusterID, targetEnv)
if err != nil || len(wps) == 0 {
return fmt.Errorf("[ERROR] Error retrieving workerpools of the cluster %s: %s", clusterID, err)
}
wp := wps[0]
attilatabori marked this conversation as resolved.
Show resolved Hide resolved
workerPool, err := csClient.WorkerPools().GetWorkerPool(clusterID, wp.ID, targetEnv)
if err != nil {
if apiErr, ok := err.(bmxerror.RequestFailure); ok {
if apiErr.StatusCode() != 404 && !strings.Contains(apiErr.Description(), "The specified worker pool could not be found") {
return fmt.Errorf("[ERROR] Error retrieving worker pool of the cluster %s: %s", workerPool.ID, err)
}
}
return fmt.Errorf("[ERROR] Error retrieving worker pool of the cluster %s: %s", workerPool.ID, err)
}

var zones = make([]map[string]interface{}, 0)
Expand Down Expand Up @@ -1082,7 +1083,7 @@ func resourceIBMContainerVpcClusterDelete(d *schema.ResourceData, meta interface
listlbOptions := &vpcv1.ListLoadBalancersOptions{}
lbs, response, err1 := sess1.ListLoadBalancers(listlbOptions)
if err1 != nil {
log.Printf("Error Retrieving vpc load balancers: %s\n%s", err, response)
log.Printf("Error Retrieving vpc load balancers: %s\n%s", err1, response)
}
if lbs != nil && lbs.LoadBalancers != nil && len(lbs.LoadBalancers) > 0 {
for _, lb := range lbs.LoadBalancers {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ func TestAccIBMContainerVpcClusterBaseEnvvar(t *testing.T) {
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{
"wait_till", "update_all_workers", "kms_config", "force_delete_storage", "wait_for_worker_update", "albs"},
"wait_till", "update_all_workers", "kms_config", "force_delete_storage", "wait_for_worker_update", "albs", "disable_outbound_traffic_protection"},
},
},
})
Expand Down
Loading