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

Enable klog in dynamic test #3330

Merged

Conversation

maqiuyujoyce
Copy link
Collaborator

Change description

Followed this guide to enable klog in dynamic test: https://github.com/kubernetes/klog?tab=readme-ov-file#coexisting-with-glog

Now we can see the logs from direct controllers with -v=2.

Tests you have done

  • [N/A] Run make ready-pr to ensure this PR is ready for review.
  • Perform necessary E2E testing for changed resources.

@maqiuyujoyce
Copy link
Collaborator Author

Though still need to figure out how to enable the logs in the unified test.

@jingyih
Copy link
Collaborator

jingyih commented Dec 6, 2024

Thank you for fixing the klog setup in this test!

go.mod Outdated
@@ -79,6 +79,7 @@ require (
k8s.io/apiextensions-apiserver v0.27.9
k8s.io/apimachinery v0.27.11
k8s.io/client-go v0.27.11
k8s.io/klog/examples v0.0.0-20241125110655-fa118f5f4770
Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting. Why do we need to directly import this lib?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed.

@@ -27,6 +28,8 @@ import (
testenvironment "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/test/environment"
"github.com/GoogleCloudPlatform/k8s-config-connector/pkg/test/webhook"
cnrmwebhook "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/webhook"
"k8s.io/klog/examples/util/require"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest we do not import the examples lib. It is used for sample purposes but not used as a library. If it changes, Config Connector will break.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed.

Copy link
Collaborator

@yuwenma yuwenma left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yuwenma

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

@google-oss-prow google-oss-prow bot merged commit c3a37f7 into GoogleCloudPlatform:master Dec 13, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants