Skip to content

Commit db9f05c

Browse files
committed
update logs for the create cleanup
1 parent 8cbb7a5 commit db9f05c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

oci/containerengine_cluster_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,8 @@ func (s *ContainerengineClusterResourceCrud) Create() error {
424424
if err != nil {
425425
if clusterID != nil {
426426
//Try to clean up
427+
log.Printf("[DEBUG] creation failed, attempting to delete the cluster: %v\n", clusterID)
428+
427429
delReq := oci_containerengine.DeleteClusterRequest{}
428430
delReq.ClusterId = clusterID
429431
delReq.RequestMetadata.RetryPolicy = getRetryPolicy(s.DisableNotFoundRetries, "containerengine")
@@ -435,7 +437,6 @@ func (s *ContainerengineClusterResourceCrud) Create() error {
435437
}
436438
delWorkRequest := delRes.OpcWorkRequestId
437439

438-
log.Printf("[DEBUG] creation failed, attempting to delete the cluster: %v\n", clusterID)
439440
//Wait until request finishes
440441
_, delErr = containerEngineWaitForWorkRequest(delWorkRequest, "cluster",
441442
oci_containerengine.WorkRequestResourceActionTypeDeleted, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries, s.Client)

oci/containerengine_node_pool_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ func (s *ContainerengineNodePoolResourceCrud) Create() error {
312312
if err != nil {
313313
if nodePoolID != nil {
314314
//Try to clean up
315+
log.Printf("[DEBUG] creation failed, attempting to delete the node pool: %v\n", nodePoolID)
316+
315317
delReq := oci_containerengine.DeleteNodePoolRequest{}
316318
delReq.NodePoolId = nodePoolID
317319
delReq.RequestMetadata.RetryPolicy = getRetryPolicy(s.DisableNotFoundRetries, "containerengine")
@@ -323,7 +325,6 @@ func (s *ContainerengineNodePoolResourceCrud) Create() error {
323325
}
324326
delWorkRequest := delRes.OpcWorkRequestId
325327

326-
log.Printf("[DEBUG] creation failed, attempting to delete the node pool: %v\n", nodePoolID)
327328
//Wait until delRequest finishes
328329
_, delErr = containerEngineWaitForWorkRequest(delWorkRequest, "nodepool",
329330
oci_containerengine.WorkRequestResourceActionTypeDeleted,

0 commit comments

Comments
 (0)