Skip to content

Conversation

@makhov
Copy link
Contributor

@makhov makhov commented Jan 8, 2025

Currently, the log level is hardcoded and konnectivity is usually quite noisy

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @makhov!

It looks like this is your first PR to kubernetes-sigs/apiserver-network-proxy 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/apiserver-network-proxy has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @makhov. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 8, 2025
@cheftako
Copy link
Contributor

cheftako commented Jan 8, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2025
@cheftako
Copy link
Contributor

cheftako commented Jan 8, 2025

/test pull-apiserver-network-proxy-test-master

@cheftako
Copy link
Contributor

/retest

@cheftako
Copy link
Contributor

/test pull-apiserver-network-proxy-test-master

4 similar comments
@cheftako
Copy link
Contributor

/test pull-apiserver-network-proxy-test-master

@cheftako
Copy link
Contributor

/test pull-apiserver-network-proxy-test-master

@cheftako
Copy link
Contributor

/test pull-apiserver-network-proxy-test-master

@cheftako
Copy link
Contributor

/test pull-apiserver-network-proxy-test-master

@cheftako
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 26, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheftako, makhov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 26, 2025
@k8s-ci-robot k8s-ci-robot merged commit 014374a into kubernetes-sigs:master Jan 26, 2025
5 checks passed
@makhov
Copy link
Contributor Author

makhov commented Jan 27, 2025

Great to see it merged, thank you! Do you have any plans for a new release with the fix?

ipochi pushed a commit to kinvolk/apiserver-network-proxy that referenced this pull request Aug 21, 2025
…from-args

🐛 Respect log level from the command-line arguments

(cherry picked from commit 014374a)
@ipochi
Copy link
Contributor

ipochi commented Sep 18, 2025

@makhov @cheftako

This PR introduced a condition (if local.Lookup("v") == nil) before setting the default klog verbosity level. This condition was incorrect because klog.InitFlags() always defines the -v flag, meaning the default verbosity was never being applied. This caused the effective log level to fall back to klog's default of 0 instead of the intended 4.

to test:

  1. build proxy-server image on release-0.30 branch
  2. run the image passing v=4 or v=0 etc or any other level and you'll find the the explicit value of v is respected.

to test that this PR introduced an error

  1. build on latest master or 0.31, 0.32, or 0.33 branches (where this fix is backported)
  2. DO NOT pass any flag, according to code, it should take up the default value of 4. Yet, it doesn't it takes the default of klog called during InitFlags() is 0 and hence local.Lookup("v") == nil is never true.

ipochi added a commit to kinvolk/apiserver-network-proxy that referenced this pull request Sep 18, 2025
…g-level-from-args"

This reverts commit 4ce5f06.

This commit reverts a previous modification to the flag handling logic
in the agent and server's main() functions.

A prior change introduced a condition (`if local.Lookup("v") == nil`)
before setting the default klog verbosity level. This condition was
incorrect because `klog.InitFlags()` always defines the `-v` flag,
meaning the default verbosity was never being applied. This caused the
effective log level to fall back to klog's default of `0` instead of the
intended `4`.

This change restores the original, correct behavior by unconditionally
setting the verbosity to `4`. This ensures logs are visible by default
while still allowing the user to override the setting via the command
line.
ipochi added a commit to kinvolk/apiserver-network-proxy that referenced this pull request Sep 18, 2025
…g-level-from-args"

This reverts commit 4ce5f06.

This commit reverts a previous modification to the flag handling logic
in the agent and server's main() functions.

A prior change introduced a condition (`if local.Lookup("v") == nil`)
before setting the default klog verbosity level. This condition was
incorrect because `klog.InitFlags()` always defines the `-v` flag,
meaning the default verbosity was never being applied. This caused the
effective log level to fall back to klog's default of `0` instead of the
intended `4`.

This change restores the original, correct behavior by unconditionally
setting the verbosity to `4`. This ensures logs are visible by default
while still allowing the user to override the setting via the command
line.
ipochi added a commit to kinvolk/apiserver-network-proxy that referenced this pull request Sep 18, 2025
…g-level-from-args"

This reverts commit 4ce5f06.

This commit reverts a previous modification to the flag handling logic
in the agent and server's main() functions.

A prior change introduced a condition (`if local.Lookup("v") == nil`)
before setting the default klog verbosity level. This condition was
incorrect because `klog.InitFlags()` always defines the `-v` flag,
meaning the default verbosity was never being applied. This caused the
effective log level to fall back to klog's default of `0` instead of the
intended `4`.

This change restores the original, correct behavior by unconditionally
setting the verbosity to `4`. This ensures logs are visible by default
while still allowing the user to override the setting via the command
line.
ipochi added a commit to kinvolk/apiserver-network-proxy that referenced this pull request Sep 18, 2025
…g-level-from-args"

This reverts commit 4ce5f06.

This commit reverts a previous modification to the flag handling logic
in the agent and server's main() functions.

A prior change introduced a condition (`if local.Lookup("v") == nil`)
before setting the default klog verbosity level. This condition was
incorrect because `klog.InitFlags()` always defines the `-v` flag,
meaning the default verbosity was never being applied. This caused the
effective log level to fall back to klog's default of `0` instead of the
intended `4`.

This change restores the original, correct behavior by unconditionally
setting the verbosity to `4`. This ensures logs are visible by default
while still allowing the user to override the setting via the command
line.
k8s-ci-robot added a commit that referenced this pull request Sep 19, 2025
Revert "Merge pull request #685 from makhov/respect-log-level-from-args"
k8s-ci-robot added a commit that referenced this pull request Sep 19, 2025
Backport to release-0.31 Revert "Merge pull request #685 from makhov/respect-log-level-from-args"
k8s-ci-robot added a commit that referenced this pull request Sep 19, 2025
Backport to release-0.33 Revert "Merge pull request #685 from makhov/respect-log-level-from-args"
k8s-ci-robot added a commit that referenced this pull request Sep 19, 2025
Backport to release-0.32 Revert "Merge pull request #685 from makhov/respect-log-level-from-args"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants