Skip to content

Commit

Permalink
Revert some debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohan Tandon committed Nov 4, 2024
1 parent 1b7740a commit 96762bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ func (r *Rotator) SetSecret(ctx context.Context, event map[string]string) error
Step: "setSecret",
Time: r.startTime,
})
logger.Info("DB is already set to AWSPENDING version of secret, no action")
logger.Info("DB is already set to AWSPENDING version of secret, no action needed")
return nil
}

Expand All @@ -436,7 +436,8 @@ func (r *Rotator) SetSecret(ctx context.Context, event map[string]string) error
// 2. Secret Manager secret is changed manually
logger.Debug("Verifying if AWSCURRENT version of secret is valid")
if err := r.db.VerifyPassword(ctx, db.NewPassword{Current: curCred, New: curCred}); err != nil {
logger.Error(fmt.Sprintf("ERROR: DB is not set to AWSCURRENT version of secret, attempting to verify AWSPREVIOUS version: %v", err))
// This is also a normal state of affairs.
logger.Debug("DB is not set to AWSCURRENT version of secret, attempting to verify AWSPREVIOUS version")
// the current version of secret is out of sync with db. check if db is in sync with
// the previous version of the secret
_, prevVals, err := r.getSecret(AWSPREVIOUS)
Expand Down Expand Up @@ -475,7 +476,8 @@ func (r *Rotator) SetSecret(ctx context.Context, event map[string]string) error
Current: prevCred,
New: newCred,
}
logger.Warn("DB is set to AWSPREVIOUS version of secret")
// DB set to AWSPREVIOUS is the normal state - we do not want to log this unless we're debugging
logger.Debug("DB is set to AWSPREVIOUS version of secret")
}

// Have user-provided PasswordSetter set database password to new value.
Expand Down

0 comments on commit 96762bc

Please sign in to comment.