From 868c8df996370198cbf25031d88c6a72fc15500a Mon Sep 17 00:00:00 2001 From: Patrik Date: Mon, 16 Mar 2020 10:51:38 +0100 Subject: [PATCH] fix(k8s): return cluster on wait flags (#776) Signed-off-by: Patrik Cyvoct --- internal/namespaces/k8s/v1beta4/custom_cluster.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/namespaces/k8s/v1beta4/custom_cluster.go b/internal/namespaces/k8s/v1beta4/custom_cluster.go index d902d8e4a0..c28ba6e58e 100644 --- a/internal/namespaces/k8s/v1beta4/custom_cluster.go +++ b/internal/namespaces/k8s/v1beta4/custom_cluster.go @@ -79,18 +79,18 @@ func clusterUpdateBuilder(c *core.Command) *core.Command { func waitForClusterFunc(action int) core.WaitFunc { return func(ctx context.Context, _, respI interface{}) (interface{}, error) { - _, err := k8s.NewAPI(core.ExtractClient(ctx)).WaitForCluster(&k8s.WaitForClusterRequest{ + cluster, err := k8s.NewAPI(core.ExtractClient(ctx)).WaitForCluster(&k8s.WaitForClusterRequest{ Region: respI.(*k8s.Cluster).Region, ClusterID: respI.(*k8s.Cluster).ID, Timeout: scw.DurationPtr(clusterActionTimeout), }) switch action { case clusterActionCreate: - return fmt.Sprintf("Cluster %s successfully created.", respI.(*k8s.Cluster).ID), nil + return cluster, err case clusterActionUpdate: - return fmt.Sprintf("Cluster %s successfully updated.", respI.(*k8s.Cluster).ID), nil + return cluster, err case clusterActionUpgrade: - return fmt.Sprintf("Cluster %s successfully upgraded.", respI.(*k8s.Cluster).ID), nil + return cluster, err case clusterActionDelete: if err != nil { // if we get a 404 here, it means the resource was successfully deleted