Skip to content

fix: Set debug level for "getting system users secret" output - #330

Merged
bjosv merged 1 commit into
valkey-io:mainfrom
nantiferov:fix--Set-debug-level-for-getting-system-users-secret-output
Jul 24, 2026
Merged

fix: Set debug level for "getting system users secret" output#330
bjosv merged 1 commit into
valkey-io:mainfrom
nantiferov:fix--Set-debug-level-for-getting-system-users-secret-output

Conversation

@nantiferov

Copy link
Copy Markdown
Contributor

This PR closes #328

Summary

This PR sets proper log level for the "getting system users secret" message from internal/controller/users.go, which repeats on every reconcile loop, added in #129

Features / Behaviour Changes

"getting system users secret" message will be shown only if operator started with "--zap-log-level=debug"

Implementation

As sigs.k8s.io/controller-runtime/pkg/log doesn't have method for log.Debug, log.V(1).Info() used instead, like in other parts of operator.

Limitations

No

Testing

No testing required I think.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message explains what changed and why
  • Tests are added or updated.
  • Documentation files are updated.
  • I have run pre-commit locally (pre-commit run --all-files or hooks on commit)

Recreated PR due to malformed branch name in #329

Signed-off-by: Nicolai Antiferov <nicolai.antiferov@bolt.eu>
@nantiferov
nantiferov marked this pull request as ready for review July 24, 2026 06:43
@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR demotes a chatty log line in createSystemUsersAcl from the default Info level to debug verbosity (log.V(1).Info), so it only appears when the operator is started with --zap-log-level=debug. The change is one line and is consistent with how the rest of users.go separates routine operational messages from always-on INFO logs.

  • The fix correctly uses log.V(1) which matches the debug verbosity convention already established throughout the file (see log.V(1).Info("internal ACLs unchanged"), log.V(1).Info("Users secret not found", ...)).
  • The message text itself uses string concatenation rather than structured key-value pairs (e.g., "clusterName", cluster.Name), but this is a pre-existing style issue and not introduced by this PR.

Confidence Score: 5/5

Safe to merge — the change is a one-line verbosity adjustment with no functional impact.

The only modification is swapping log.Info for log.V(1).Info on a single informational log line that fires on every reconcile loop. The chosen verbosity level matches the debug convention used elsewhere in the same file, and no logic, data flow, or error handling is touched.

No files require special attention.

Important Files Changed

Filename Overview
internal/controller/users.go Log verbosity for 'getting system users secret' demoted from Info (V(0)) to Debug (V(1)), consistent with the rest of the file's logging conventions.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[reconcileUsersAcl] --> B[createSystemUsersAcl]
    B --> C{"log.V(1).Info\n'getting system users secret'"}
    C -->|"V(1) — debug only\n--zap-log-level=debug"| D[r.Get system password secret]
    D -->|Found| E[validateSystemUserPasswordSecret]
    D -->|NotFound| F[upsertSystemUsersPasswordSecret]
    F --> E
    E -->|Valid| G[Build ACL strings per system user]
    E -->|errMissingSystemUser| F
    E -->|errUnknownSystemUser| H[log.Error — always visible]
    G --> I[Return ACL string]
Loading

Reviews (1): Last reviewed commit: "fix: Set debug level for "getting system..." | Re-trigger Greptile

@bjosv
bjosv merged commit 1c64d35 into valkey-io:main Jul 24, 2026
9 checks passed
@bjosv

bjosv commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: "getting system users secret:" printed with INFO level on every reconcile loop

2 participants