Skip to content

Commit

Permalink
Update cluster.go
Browse files Browse the repository at this point in the history
  • Loading branch information
MGamya committed Sep 26, 2024
1 parent 906dd24 commit 79cd0b8
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions client/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,3 +323,29 @@ func (h *V1Client) UpdatePauseAgentUpgradeSettingCluster(upgradeSetting *models.
}
return nil
}

func (h *V1Client) InitiateTheCertRenewal(clusterUid string) error {

Check failure on line 327 in client/cluster.go

View workflow job for this annotation

GitHub Actions / build-with-coverage

var-naming: method parameter clusterUid should be clusterUID (revive)
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 nil
}

func (h *V1Client) GetTheKubernetesCerts(clusterUid string) (*models.V1MachineCertificates,error) {

Check failure on line 336 in client/cluster.go

View workflow job for this annotation

GitHub Actions / build-with-coverage

var-naming: method parameter clusterUid should be clusterUID (revive)
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)
}
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 certList,nil
}

0 comments on commit 79cd0b8

Please sign in to comment.