-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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
Fix golint error for pkg/kubelet/types #91178
Conversation
Hi @qw1mb0. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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/test-infra repository. |
/ok-to-test |
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.
Two small grammar nits from me, that would be great to clean up while we're working with this code.
Other than that looks good! Feel free to ping me if you make the change and I'll mark as lgtm.
pkg/kubelet/types/constants.go
Outdated
@@ -17,14 +17,17 @@ limitations under the License. | |||
package types | |||
|
|||
const ( | |||
// system default DNS resolver configuration | |||
// ResolvConfDefault define system default DNS resolver configuration |
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.
Small nit :) For all of these, I think we want to swap define
with defines a
.
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.
fixed
pkg/kubelet/types/labels.go
Outdated
KubernetesPodNameLabel = "io.kubernetes.pod.name" | ||
KubernetesPodNamespaceLabel = "io.kubernetes.pod.namespace" | ||
KubernetesPodUIDLabel = "io.kubernetes.pod.uid" | ||
// KubernetesPodNameLabel specify pod name label |
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.
Small nit :) I think we want to swap specify
for specifies a
.
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.
fixed
9d7b0a6
to
7d0b0ab
Compare
@mattjmcnaughton I corrected the grammatical errors |
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.
Sorry, one last thought and then looks good to me.
I'll mark lgtm once the final change is made.
pkg/kubelet/types/types.go
Outdated
@@ -61,7 +61,7 @@ func (t *Timestamp) GetString() string { | |||
return t.time.Format(time.RFC3339Nano) | |||
} | |||
|
|||
// A type to help sort container statuses based on container names. | |||
// SortedContainerStatuses a type to help sort container statuses based on container names. |
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.
Nit: For this file, I think it could be ConstantName is a...
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.
Nit: For this file, I think it could be
ConstantName is a...
fixed
7d0b0ab
to
8c524e5
Compare
@mattjmcnaughton ping |
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.
Getting close!
Two final thoughts - I clarified one of my earlier comments - I hope it makes sense :) Please lmk if not!
pkg/kubelet/types/types.go
Outdated
@@ -95,8 +95,8 @@ type Reservation struct { | |||
Kubernetes v1.ResourceList | |||
} | |||
|
|||
// A pod UID which has been translated/resolved to the representation known to kubelets. | |||
// ResolvedPodUID a pod UID which has been translated/resolved to the representation known to kubelets. |
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.
Sorry, I wasn't clear in my original comment - we should also add the is a
change for ResolvedPodUID
and MirrorPodUID
similar to SortedContainerStatuses
.
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.
fixed
pkg/kubelet/types/labels.go
Outdated
KubernetesContainerNameLabel = "io.kubernetes.container.name" | ||
) | ||
|
||
// GetContainerName return container name from labels |
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.
Nit: For all the functions in this file, I think we want FuncName returns ...
.
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.
fixed
8c524e5
to
16e3467
Compare
/retest |
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
Thank you for these fixes!
/retest |
/assign @dashpole |
/lgtm |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dashpole, qw1mb0 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @dims |
@@ -25,42 +25,47 @@ import ( | |||
) | |||
|
|||
const ( | |||
ConfigSourceAnnotationKey = "kubernetes.io/config.source" | |||
ConfigMirrorAnnotationKey = v1.MirrorPodAnnotationKey | |||
// ConfigSourceAnnotationKey specifies a annotation key for config source |
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.
nit
// ConfigSourceAnnotationKey specifies a annotation key for config source | |
// ConfigSourceAnnotationKey specifies an annotation key for config source |
ConfigMirrorAnnotationKey = v1.MirrorPodAnnotationKey | ||
// ConfigSourceAnnotationKey specifies a annotation key for config source | ||
ConfigSourceAnnotationKey = "kubernetes.io/config.source" | ||
// ConfigMirrorAnnotationKey specifies a annotation key for config mirror |
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.
// ConfigMirrorAnnotationKey specifies a annotation key for config mirror | |
// ConfigMirrorAnnotationKey specifies an annotation key for config mirror |
|
||
// User visible keys for managing node allocatable enforcement on the node. | ||
// User visible keys for managing node allocatable enforcement on the node. | ||
const ( | ||
NodeAllocatableEnforcementKey = "pods" |
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.
curious why these const
do not require a comment
/priority backlog |
@qw1mb0 would you please rebase this PR? |
@qw1mb0: PR needs rebase. 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/test-infra repository. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
new attempt is here: #97374 /close |
@SergeyKanzhelev: Closed this PR. In response to this:
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/test-infra repository. |
What type of PR is this?
/kind documentation
What this PR does / why we need it:
pkg/kubelet/types
pkg/kubelet/types
fromhack/.golint_failures
;Which issue(s) this PR fixes: #68026
Special notes for your reviewer:
Does this PR introduce a user-facing change?: