Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
MGamya committed Sep 26, 2024
1 parent 5baab42 commit d0f19fe
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions client/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit d0f19fe

Please sign in to comment.