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

Should not accept zap-log-level flag value denied by CR #56

Open
erikgb opened this issue Dec 22, 2022 · 0 comments
Open

Should not accept zap-log-level flag value denied by CR #56

erikgb opened this issue Dec 22, 2022 · 0 comments

Comments

@erikgb
Copy link
Member

erikgb commented Dec 22, 2022

It seems like controller-runtime (CR) accepts ['debug', 'info', 'error'] for the zap-log-level flag, but in this project, we also accept 'panic'. Our ambition is to be a "drop-in replacement for controller-runtime zap package", so this should not differ.

See https://github.com/kubernetes-sigs/controller-runtime/blob/ffa8c5001e6afb386877ecacdbe6975245c5ca2c/pkg/log/zap/flags.go#L31-L41 for details.

I tried to fix this "the weasel way" (removing 'panic' from https://github.com/statnett/controller-runtime-viper/blob/main/pkg/zap/zap.go#L127-L132), but that broke tests. The main issue seems to be that we cannot distinguish the decoding of fields of the same type.

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

No branches or pull requests

1 participant