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
all: convert package level vars to consts where possible #10329
Conversation
@@ -27,12 +27,12 @@ import ( | |||
) | |||
|
|||
const ( | |||
minimalPodRestartInterval = 5 * time.Minute | |||
minimalPodRestartInterval = 5 * time.Minute | |||
unmanagedKubeDnsMinimalAge = 30 * time.Second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const unmanagedKubeDnsMinimalAge should be unmanagedKubeDNSMinimalAge
@@ -27,12 +27,12 @@ import ( | |||
) | |||
|
|||
const ( | |||
minimalPodRestartInterval = 5 * time.Minute | |||
minimalPodRestartInterval = 5 * time.Minute | |||
unmanagedKubeDnsMinimalAge = 30 * time.Second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const unmanagedKubeDnsMinimalAge should be unmanagedKubeDNSMinimalAge
pkg/maps/eppolicymap/eppolicymap.go
Outdated
|
||
const ( | ||
MapName = "cilium_ep_to_policy" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported const MapName should have comment (or a comment on this block) or be unexported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, there are at least 1 var that is changed when we are linking which is [0] so we can't move that one to const
[0]
Line 38 in 5accb00
var Version string |
Also, is there any lint to check for this or are you doing it sort of manually?
Yes, I noticed that one and intentionally didn't change it. There are also others like
I've done this manually (mainly looking through |
test-me-please
|
Maybe this would help?
That's still 1203 lines to go through though 😥 |
b7d2073
to
1ef5c8b
Compare
Also unexport them if they're not used outside the package. Also remove unused global var RetryInterval, it's unused since commit 7ccf877 ("kvstore: New kvstore abstraction API"). Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
1ef5c8b
to
0ceff80
Compare
test-me-please |
Also unexport them if they're not used outside the package.
Also remove unused global var RetryInterval, it's unused since commit
7ccf877 ("kvstore: New kvstore abstraction API").
This change is