diff --git a/client/cluster.go b/client/cluster.go index 47224679..94e5902f 100644 --- a/client/cluster.go +++ b/client/cluster.go @@ -329,25 +329,24 @@ func (h *V1Client) InitiateTheCertRenewal(clusterUID string) error { params := clientv1.NewV1SpectroClustersCertificatesRenewParamsWithContext(h.ctx).WithUID(clusterUID) _, err := h.Client.V1SpectroClustersCertificatesRenew(params) if err != nil { - return fmt.Errorf("error while renewing the cluster certificates: %w", err) + return fmt.Errorf("error while renewing the cluster certificates: %w", err) } return nil } // GetTheKubernetesCerts retrieves the Kubernetes certificates for the specified cluster. -func (h *V1Client) GetTheKubernetesCerts(clusterUID string) (*models.V1MachineCertificates,error) { +func (h *V1Client) GetTheKubernetesCerts(clusterUID string) (*models.V1MachineCertificates, error) { params := clientv1.NewV1SpectroClustersK8CertificateParamsWithContext(h.ctx).WithUID(clusterUID) resp, err := h.Client.V1SpectroClustersK8Certificate(params) if err != nil { - return nil,fmt.Errorf("error while getting the cluster certificates: %w", err) + return nil, fmt.Errorf("error while getting the cluster certificates: %w", err) } certList := resp.GetPayload() // Check if the list contains any machine certificates if len(certList.MachineCertificates) == 0 { fmt.Println("No machine certificates found.") - return nil,nil + return nil, nil } - - return certList,nil -} + return certList, nil +}