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

feat(operator): allow to set log level #1849

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

carlosrodfern
Copy link
Contributor

Fixes: #1566

Purpose of PR?:

To allow the operator and the snitch to receive a log level flag from the command line arguments.

Fixes #1566

Does this PR introduce a breaking change? No

If the changes in this PR are manually verified, list down the scenarios covered:: deployed the operator and tested that info and error level do work as expected.

Additional information for reviewer? :

Checklist:

  • Bug fix. Fixes #
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • PR Title follows the convention of <type>(<scope>): <subject>
  • Commit has unit tests
  • Commit has integration tests

Fixes: kubearmor#1566

Signed-off-by: Carlos Rodriguez-Fernandez <[email protected]>
@carlosrodfern
Copy link
Contributor Author

carlosrodfern commented Aug 19, 2024

The cmd argument naming conventions I see used in the operator and snitch are "alllowecase" and "camelCase", but since the camelCase is used the most I went with loglevel. However, the controller uses the "kebab-case" for logs since it just lets the SIG zap (not the uber zap used in the operator and snitch) parse it, e.g., --zap-log-level.

On a different note, once this is merged and the new operator released, the corresponding helm chart will need updates to allow set those log level values in the values.yaml. I'll provide a PR for that one as well.

@carlosrodfern
Copy link
Contributor Author

The ci is failing because kube is failed to apply the kubearmor-policy in the test to an existing pod. It doesn't appear to be related with this PR change.

Copy link
Member

@DelusionalOptimist DelusionalOptimist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@DelusionalOptimist DelusionalOptimist merged commit bed86b5 into kubearmor:main Aug 21, 2024
18 checks passed
Aryan-sharma11 pushed a commit to Aryan-sharma11/KubeArmor that referenced this pull request Aug 24, 2024
feat(operator): allow to set log level
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.

Ability to reduce log level
3 participants