@@ -26,6 +26,7 @@ import (
2626 "context"
2727 "encoding/base64"
2828 "fmt"
29+ "github.com/google/uuid"
2930 "time"
3031
3132 "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator"
@@ -341,7 +342,8 @@ func (r *namespaceResource) Create(ctx context.Context, req resource.CreateReque
341342 }
342343
343344 svcResp , err := r .client .CloudService ().CreateNamespace (ctx , & cloudservicev1.CreateNamespaceRequest {
344- Spec : spec ,
345+ Spec : spec ,
346+ AsyncOperationId : uuid .New ().String (),
345347 })
346348
347349 if err != nil {
@@ -468,9 +470,10 @@ func (r *namespaceResource) Update(ctx context.Context, req resource.UpdateReque
468470 }
469471
470472 svcResp , err := r .client .CloudService ().UpdateNamespace (ctx , & cloudservicev1.UpdateNamespaceRequest {
471- Namespace : plan .ID .ValueString (),
472- Spec : spec ,
473- ResourceVersion : currentNs .GetNamespace ().GetResourceVersion (),
473+ Namespace : plan .ID .ValueString (),
474+ Spec : spec ,
475+ ResourceVersion : currentNs .GetNamespace ().GetResourceVersion (),
476+ AsyncOperationId : uuid .New ().String (),
474477 })
475478 if err != nil {
476479 resp .Diagnostics .AddError ("Failed to update namespace" , err .Error ())
@@ -522,8 +525,9 @@ func (r *namespaceResource) Delete(ctx context.Context, req resource.DeleteReque
522525 ctx , cancel := context .WithTimeout (ctx , deleteTimeout )
523526 defer cancel ()
524527 svcResp , err := r .client .CloudService ().DeleteNamespace (ctx , & cloudservicev1.DeleteNamespaceRequest {
525- Namespace : state .ID .ValueString (),
526- ResourceVersion : currentNs .GetNamespace ().GetResourceVersion (),
528+ Namespace : state .ID .ValueString (),
529+ ResourceVersion : currentNs .GetNamespace ().GetResourceVersion (),
530+ AsyncOperationId : uuid .New ().String (),
527531 })
528532 if err != nil {
529533 resp .Diagnostics .AddError ("Failed to delete namespace" , err .Error ())
0 commit comments