Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable logger development mode to avoid panicking #3660

Closed
4 tasks done
AndiDog opened this issue Aug 28, 2024 · 1 comment
Closed
4 tasks done

Disable logger development mode to avoid panicking #3660

AndiDog opened this issue Aug 28, 2024 · 1 comment
Assignees
Labels
team/bigmac Team BigMac team/shield Team Shield

Comments

@AndiDog
Copy link

AndiDog commented Aug 28, 2024

zap is used as default logger for kubebuilder-generated operators. By default, its main.go uses Development: true logging mode, meaning it will panic on logic errors such as odd number of arguments in structured logging calls (example: logger.Info("the message", "key without value argument")).

To rectify:

  • Set Development: false in zap options struct of main.go
  • If applicable: use dev mode in tests (e.g. logger := zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
  • If applicable: ensure zap is even used as controller-runtime logger (ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))) – we found a few spots where klogr was still used

Example PR that does all this

From a GitHub code search in the original issue of Phoenix, we found that these repos of your team are affected:

  • dex-operator
  • organization-operator
  • teleport-operator
  • teleport-agent-operator (I guess rather archive, it’s a 2-year-old stub)
@AndiDog AndiDog added the team/bigmac Team BigMac label Aug 28, 2024
@AndiDog AndiDog added this to Roadmap Aug 28, 2024
@github-project-automation github-project-automation bot moved this to Inbox 📥 in Roadmap Aug 28, 2024
@ssyno ssyno added the team/shield Team Shield label Sep 18, 2024
@ssyno ssyno self-assigned this Sep 18, 2024
@ssyno
Copy link

ssyno commented Sep 20, 2024

teleport-agent-operator can be archived
Issue to be resolved after merging the following PRs:
dex-operator
organization-operator
teleport-operator

@ssyno ssyno moved this from In Progress ⛏️ to Validation ☑️ in Roadmap Sep 23, 2024
@stone-z stone-z closed this as completed Sep 25, 2024
@github-project-automation github-project-automation bot moved this from Validation ☑️ to Done ✅ in Roadmap Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team/bigmac Team BigMac team/shield Team Shield
Projects
Archived in project
Development

No branches or pull requests

3 participants