From 8833ba9c3b7f2e74d9fcc9cec5e19edbf91c2723 Mon Sep 17 00:00:00 2001 From: Ahmad Ibrahim Date: Fri, 27 Dec 2024 09:59:07 -0800 Subject: [PATCH 1/2] feat: implement validate cluster repave --- client/cluster.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/cluster.go b/client/cluster.go index 94e5902f..6d5cf436 100644 --- a/client/cluster.go +++ b/client/cluster.go @@ -193,6 +193,15 @@ func (h *V1Client) ApproveClusterRepave(clusterUID string) error { return err } +// ValidateClusterRepave validates if cluster gets repaved for the specified packs. +func (h *V1Client) ValidateClusterRepave(clusterUID string, body *models.V1SpectroClusterPacksEntity) error { + params := clientv1.NewV1SpectroClustersUIDValidateRepaveParamsWithContext(h.ctx). + WithUID(clusterUID). + WithBody(body) + _, err := h.Client.V1SpectroClustersUIDValidateRepave(params) + return err +} + // GetRepaveReasons retrieves a cluster's repave reasons. func (h *V1Client) GetRepaveReasons(clusterUID string) ([]string, error) { params := clientv1.NewV1SpectroClustersUIDRepaveGetParamsWithContext(h.ctx). From 6d8748bc295e59998fe0800472a8c8cc804cd2e6 Mon Sep 17 00:00:00 2001 From: Ahmad Ibrahim Date: Fri, 27 Dec 2024 10:16:30 -0800 Subject: [PATCH 2/2] fix: return response payload --- client/cluster.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/cluster.go b/client/cluster.go index 6d5cf436..cdc03e58 100644 --- a/client/cluster.go +++ b/client/cluster.go @@ -194,12 +194,12 @@ func (h *V1Client) ApproveClusterRepave(clusterUID string) error { } // ValidateClusterRepave validates if cluster gets repaved for the specified packs. -func (h *V1Client) ValidateClusterRepave(clusterUID string, body *models.V1SpectroClusterPacksEntity) error { +func (h *V1Client) ValidateClusterRepave(clusterUID string, body *models.V1SpectroClusterPacksEntity) (*models.V1SpectroClusterRepaveValidationResponse, error) { params := clientv1.NewV1SpectroClustersUIDValidateRepaveParamsWithContext(h.ctx). WithUID(clusterUID). WithBody(body) - _, err := h.Client.V1SpectroClustersUIDValidateRepave(params) - return err + resp, err := h.Client.V1SpectroClustersUIDValidateRepave(params) + return resp.Payload, err } // GetRepaveReasons retrieves a cluster's repave reasons.