Skip to content

Commit

Permalink
fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
hashiblaum committed Nov 4, 2024
1 parent 0d4a15e commit b259b33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions consts/reasons.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ const (
ReasonStatusUpdateError = "StatusUpdateError"
ReasonUnrecoverable = "Unrecoverable"
ReasonVaultClientConfigError = "VaultClientConfigError"
HVSVaultClientConfigError = "HVSClientConfigError"
ReasonHVSClientConfigError = "HVSClientConfigError"
ReasonVaultClientError = "VaultClientError"
ReasonVaultStaticSecret = "VaultStaticSecretError"
ReasonHVSStaticSecret = "HVSStaticSecretError"
ReasonHVSDynamicSecret = "HVSDynamicSecretError"
ReasonHVSSecret = "HVSSecretError"
ReasonSecretDataDrift = "SecretDataDrift"
ReasonInexistentDestination = "InexistentDestination"
ReasonResourceUpdated = "ResourceUpdated"
Expand Down
12 changes: 6 additions & 6 deletions controllers/hcpvaultsecretsapp_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (r *HCPVaultSecretsAppReconciler) Reconcile(ctx context.Context, req ctrl.R
d, err := parseDurationString(o.Spec.RefreshAfter, ".spec.refreshAfter", r.MinRefreshAfter)
if err != nil {
logger.Error(err, "Field validation failed")
r.Recorder.Eventf(o, corev1.EventTypeWarning, consts.ReasonHVSStaticSecret,
r.Recorder.Eventf(o, corev1.EventTypeWarning, consts.ReasonHVSSecret,
"Field validation failed, err=%s", err)
return ctrl.Result{}, err
}
Expand All @@ -147,7 +147,7 @@ func (r *HCPVaultSecretsAppReconciler) Reconcile(ctx context.Context, req ctrl.R
c, err := r.hvsClient(ctx, o)
if err != nil {
logger.Error(err, "Get HCP Vault Secrets Client")
r.Recorder.Eventf(o, corev1.EventTypeWarning, consts.HVSVaultClientConfigError,
r.Recorder.Eventf(o, corev1.EventTypeWarning, consts.ReasonHVSClientConfigError,
"Failed to instantiate HVS client: %s", err)
return ctrl.Result{
RequeueAfter: computeHorizonWithJitter(requeueDurationOnError),
Expand All @@ -166,8 +166,8 @@ func (r *HCPVaultSecretsAppReconciler) Reconcile(ctx context.Context, req ctrl.R
resp, err := fetchOpenSecretsPaginated(ctx, c, params, nil)
if err != nil {
logger.Error(err, "Get App Secrets", "appName", o.Spec.AppName)
r.Recorder.Eventf(o, corev1.EventTypeWarning, consts.ReasonVaultStaticSecret,
"Failed to get hvs static secrets: %s", err)
r.Recorder.Eventf(o, corev1.EventTypeWarning, consts.ReasonHVSSecret,
"Failed to get HVS App secrets: %s", err)
entry, _ := r.BackOffRegistry.Get(req.NamespacedName)
return ctrl.Result{
RequeueAfter: entry.NextBackOff(),
Expand All @@ -189,8 +189,8 @@ func (r *HCPVaultSecretsAppReconciler) Reconcile(ctx context.Context, req ctrl.R
dynamicSecrets, err := getHVSDynamicSecrets(ctx, c, o.Spec.AppName, renewPercent, shadowSecrets)
if err != nil {
logger.Error(err, "Get Dynamic Secrets", "appName", o.Spec.AppName)
r.Recorder.Eventf(o, corev1.EventTypeWarning, consts.ReasonHVSDynamicSecret,
"Failed to get hvs dynamic secrets: %s", err)
r.Recorder.Eventf(o, corev1.EventTypeWarning, consts.ReasonHVSSecret,
"Failed to get HVS dynamic secrets: %s", err)
entry, _ := r.BackOffRegistry.Get(req.NamespacedName)
return ctrl.Result{
RequeueAfter: entry.NextBackOff(),
Expand Down

0 comments on commit b259b33

Please sign in to comment.