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

remove klog v1 #3785

Merged
merged 1 commit into from
Oct 22, 2024
Merged

remove klog v1 #3785

merged 1 commit into from
Oct 22, 2024

Conversation

hwdef
Copy link
Member

@hwdef hwdef commented Oct 21, 2024

klog v1 is no longer needed, we have klog v2

@volcano-sh-bot volcano-sh-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 21, 2024
@hwdef hwdef force-pushed the remove-klogv1 branch 2 times, most recently from e6cdd1f to 3f0b4e0 Compare October 21, 2024 11:37
@volcano-sh-bot volcano-sh-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 21, 2024
Copy link
Collaborator

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

/lgtm

There is a tool in golangci-lint called dep-guard can be used to prevent importing this pkg again

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 21, 2024
@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu

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

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 21, 2024
@volcano-sh-bot volcano-sh-bot removed the lgtm Indicates that a PR is ready to be merged. label Oct 21, 2024
@hwdef hwdef force-pushed the remove-klogv1 branch 5 times, most recently from 48d56f5 to d1d0947 Compare October 22, 2024 00:51
@hwdef
Copy link
Member Author

hwdef commented Oct 22, 2024

@hzxuzhonghu
I tried some methods, but they all failed to import klog/v2. Do you have any suggestions?

@hzxuzhonghu
Copy link
Collaborator

Error: pkg/controllers/framework/factory.go:22:2: import 'k8s.io/klog/v2' is not allowed from list 'main': klog is deprecated, use k8s.io/klog/v2 instead (depguard)
	"k8s.io/klog/v2"
	^
Error: pkg/scheduler/util/assert/assert.go:8:2: import 'k8s.io/klog/v2' is not allowed from list 'main': klog is deprecated, use k8s.io/klog/v2 instead (depguard)
	"k8s.io/klog/v2"
	^
Error: pkg/controllers/job/plugins/svc/svc.go:30:2: import 'k8s.io/klog/v2' is not allowed from list 'main': klog is deprecated, use k8s.io/klog/v2 instead (depguard)
	"k8s.io/klog/v2"
	^

.golangci.yml Outdated
main:
list-mode: strict
deny:
- pkg: "k8s.io/klog"
Copy link
Collaborator

Choose a reason for hiding this comment

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

looks like this is prefix match, is there a option

Copy link
Collaborator

Choose a reason for hiding this comment

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

Allow is a prefix of packages to allow. A dollar sign $ can be used at the end of a package to specify it must be exact match only.

Deny is a map where the key is a prefix of the package to deny, and the value is a suggestion on what to use instead. A dollar sign $ can be used at the end of a package to specify it must be exact match only.

A Prefix List just means that a package will match a value, if the value is a prefix of the package. Example github.com/OpenPeeDeeP/depguard package will match a value of github.com/OpenPeeDeeP but won't match github.com/OpenPeeDeeP/depguard/v2.

https://github.com/OpenPeeDeeP/depguard

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for your guidance. It works now.

Signed-off-by: hwdef <hwdefcom@outlook.com>
@hwdef
Copy link
Member Author

hwdef commented Oct 22, 2024

/ok-to-test

@volcano-sh-bot volcano-sh-bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Oct 22, 2024
@hzxuzhonghu
Copy link
Collaborator

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 22, 2024
@volcano-sh-bot volcano-sh-bot merged commit 26a7538 into volcano-sh:master Oct 22, 2024
17 checks passed
@hwdef hwdef deleted the remove-klogv1 branch October 22, 2024 03:40
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. lgtm 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants