Skip to content

Commit cb40169

Browse files
committed
[FIX] - Constant String
Resolved the issue on the constant string and go vet problem
1 parent a93a40d commit cb40169

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

pkg/controller/configuration/detect_errors.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ func (c *Controller) ensureErrorDetection(configuration *terraformv1alpha1.Confi
114114
return reconcile.Result{}, controller.ErrIgnore
115115
}
116116
if m.MatchString(string(logs)) {
117+
message := detectors[i].Message
118+
117119
//nolint:govet
118-
cond.ActionRequired(detectors[i].Message)
120+
cond.ActionRequired(message)
119121
}
120122
}
121123

pkg/controller/configuration/ensure.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,19 +248,21 @@ func (c *Controller) ensureCustomBackendTemplate(configuration *terraformv1alpha
248248
return reconcile.Result{}, err
249249
}
250250
if !found {
251+
mesasage := fmt.Sprintf("Backend template secret %q not found, contact administrator", reference)
251252
//nolint:govet
252-
cond.ActionRequired(fmt.Sprintf("Backend template secret %q not found, contact administrator", reference))
253+
cond.ActionRequired(mesasage)
253254

254255
return reconcile.Result{}, controller.ErrIgnore
255256
}
256257

257258
// @step: ensure we have the backend.tf key in the secret
258259
backend, ok := secret.Data[terraformv1alpha1.TerraformBackendSecretKey]
259260
if !ok || len(backend) == 0 {
261+
message := fmt.Sprintf("Backend template secret %q does not contain the %s key",
262+
reference, terraformv1alpha1.TerraformBackendSecretKey)
263+
260264
//nolint:govet
261-
cond.ActionRequired(fmt.Sprintf("Backend template secret %q does not contain the %s key",
262-
reference, terraformv1alpha1.TerraformBackendSecretKey),
263-
)
265+
cond.ActionRequired(message)
264266

265267
return reconcile.Result{}, controller.ErrIgnore
266268
}

0 commit comments

Comments
 (0)