Skip to content

Commit

Permalink
Update downstream v3.3.1 (#395)
Browse files Browse the repository at this point in the history
* make bundle for v3.3.1 (#389)

* [COST-5390] make downstream v3.3.1

* clean up directory name and version

* [COST-5409] Specify correct toolchain version number in go.mod (#394)

* [COST-5409] Specify correct toolchain version number in go.mod

* use mirco version

* definitely use toolchain and not micro version

* address non-constant format string in call to fmt.Errorf
  • Loading branch information
djnakabaale authored Aug 16, 2024
1 parent 82cba81 commit 6b4d72a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module github.com/project-koku/koku-metrics-operator

go 1.22
toolchain go1.22.5

require (
github.com/go-logr/logr v1.4.2
Expand Down
7 changes: 4 additions & 3 deletions internal/controller/kokumetricsconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func GetAuthSecret(r *MetricsConfigReconciler, cr *metricscfgv1beta1.MetricsConf
if len(keys[k]) <= 0 {
msg := fmt.Sprintf("secret not found with expected %s data", k)
log.Info(msg)
return fmt.Errorf(msg)
return fmt.Errorf("%s", msg)
}
}

Expand Down Expand Up @@ -339,7 +339,7 @@ func (r *MetricsConfigReconciler) GetServiceAccountSecret(ctx context.Context, c
if len(keys[requiredKey]) <= 0 {
msg := fmt.Sprintf("service account secret not found with expected %s data", requiredKey)
log.Info(msg)
return fmt.Errorf(msg)
return fmt.Errorf("%s", msg)
}
}
log.Info("found required keys in secret")
Expand Down Expand Up @@ -935,7 +935,8 @@ func concatErrs(errors ...error) error {
errstrings = append(errstrings, e.Error())
}
if len(errstrings) > 0 {
err = fmt.Errorf(strings.Join(errstrings, "\n"))
msg := strings.Join(errstrings, "\n")
err = fmt.Errorf("%s", msg)
}
return err
}
6 changes: 3 additions & 3 deletions internal/sources/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func SourceGetOrCreate(handler *SourceHandler, client crhchttp.HTTPClient) (bool
log.Info("create source = " + strconv.FormatBool(*handler.Spec.CreateSource))
msg := fmt.Sprintf("No OpenShift source registered with name %s and Cluster ID %s.", handler.Spec.SourceName, handler.Auth.ClusterID)
if !*handler.Spec.CreateSource {
return false, metav1.Now(), fmt.Errorf(msg)
return false, metav1.Now(), fmt.Errorf("%s", msg)
}
log.Info(msg)

Expand All @@ -398,7 +398,7 @@ func SourceGetOrCreate(handler *SourceHandler, client crhchttp.HTTPClient) (bool
if source != nil {
errMsg := fmt.Sprintf("This cluster may already be registered because an OpenShift source with Cluster ID %s is already registered with a different name (%s).", handler.Auth.ClusterID, source.Name)
log.Info(errMsg)
return false, metav1.Now(), fmt.Errorf(errMsg)
return false, metav1.Now(), fmt.Errorf("%s", errMsg)
}

// Check if source name is already in use
Expand All @@ -416,7 +416,7 @@ func SourceGetOrCreate(handler *SourceHandler, client crhchttp.HTTPClient) (bool
handler.Spec.SourceName, source.SourceRef)
}
log.Info(errMsg)
return false, metav1.Now(), fmt.Errorf(errMsg)
return false, metav1.Now(), fmt.Errorf("%s", errMsg)
}

// No source is registered with this name
Expand Down

0 comments on commit 6b4d72a

Please sign in to comment.