Updated cluster.go fmt.Errorf to errors.Errorf
@@ -170,7 +170,7 @@ func (m *Manager) DownloadFiles(c *models.Cluster) (err error) {
clusterStatusInstalled,
clusterStatusError}
if !funk.ContainsString(allowedStatuses, clusterStatus) {
- err = fmt.Errorf("cluster %s is in %s state, files can be downloaded only when status is one of: %s",
+ err = errors.Errorf("cluster %s is in %s state, files can be downloaded only when status is one of: %s",
c.ID, clusterStatus, allowedStatuses)
}
return err
@@ -179,7 +179,7 @@ func (m *Manager) DownloadFiles(c *models.Cluster) (err error) {
func (m *Manager) DownloadKubeconfig(c *models.Cluster) (err error) {
clusterStatus := swag.StringValue(c.Status)
if clusterStatus != clusterStatusInstalled {
- err = fmt.Errorf("cluster %s is in %s state, %s can be downloaded only in installed state", c.ID, clusterStatus, "kubeconfig")
+ err = errors.Errorf("cluster %s is in %s state, %s can be downloaded only in installed state", c.ID, clusterStatus, "kubeconfig")
}
return err
@@ -188,7 +188,7 @@ func (m *Manager) GetCredentials(c *models.Cluster) (err error) {
clusterStatus := swag.StringValue(c.Status)
allowedStatuses := []string{clusterStatusInstalling, clusterStatusInstalled}
if !funk.ContainsString(allowedStatuses, clusterStatus) {
- err = fmt.Errorf("Cluster %s is in %s state, credentials are available only in installing or installed state", c.ID, clusterStatus)
+ err = errors.Errorf("Cluster %s is in %s state, credentials are available only in installing or installed state", c.ID, clusterStatus)
}
return err
@@ -197,7 +197,7 @@ func (m *Manager) GetCredentials(c *models.Cluster) (err error) {
func (m *Manager) UploadIngressCert(c *models.Cluster) (err error) {
clusterStatus := swag.StringValue(c.Status)
if clusterStatus != clusterStatusInstalled {
- err = fmt.Errorf("Cluster %s is in %s state, upload ingress ca can be done only in installed state", c.ID, clusterStatus)
+ err = errors.Errorf("Cluster %s is in %s state, upload ingress ca can be done only in installed state", c.ID, clusterStatus)
}
return err
