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

Fix golint error for pkg/kubelet/types #91178

Closed
wants to merge 1 commit into from

Conversation

qw1mb0
Copy link

@qw1mb0 qw1mb0 commented May 17, 2020

What type of PR is this?
/kind documentation

What this PR does / why we need it:

  • Fix lint errors for the whole directory pkg/kubelet/types
  • Remove pkg/kubelet/types from hack/.golint_failures;
  • Fix some typo from comments.

Which issue(s) this PR fixes: #68026

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added kind/documentation Categorizes issue or PR as related to documentation. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 17, 2020
@k8s-ci-robot
Copy link
Contributor

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 /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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 17, 2020
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels May 17, 2020
@hwdef
Copy link
Member

hwdef commented May 17, 2020

/ok-to-test
/lgtm for hack

@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 May 17, 2020
Copy link
Contributor

@mattjmcnaughton mattjmcnaughton left a 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.

@@ -17,14 +17,17 @@ limitations under the License.
package types

const (
// system default DNS resolver configuration
// ResolvConfDefault define system default DNS resolver configuration
Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

KubernetesPodNameLabel = "io.kubernetes.pod.name"
KubernetesPodNamespaceLabel = "io.kubernetes.pod.namespace"
KubernetesPodUIDLabel = "io.kubernetes.pod.uid"
// KubernetesPodNameLabel specify pod name label
Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@qw1mb0
Copy link
Author

qw1mb0 commented May 17, 2020

@mattjmcnaughton I corrected the grammatical errors

Copy link
Contributor

@mattjmcnaughton mattjmcnaughton left a 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.

@@ -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.
Copy link
Contributor

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...

Copy link
Author

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

@qw1mb0
Copy link
Author

qw1mb0 commented May 26, 2020

@mattjmcnaughton ping

Copy link
Contributor

@mattjmcnaughton mattjmcnaughton left a 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!

@@ -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.
Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

KubernetesContainerNameLabel = "io.kubernetes.container.name"
)

// GetContainerName return container name from labels
Copy link
Contributor

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 ....

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@qw1mb0
Copy link
Author

qw1mb0 commented May 29, 2020

/retest

Copy link
Contributor

@mattjmcnaughton mattjmcnaughton left a 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!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 1, 2020
@sijocherian
Copy link

/retest

@SergeyKanzhelev
Copy link
Member

/assign @dashpole

@dashpole
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dashpole, qw1mb0
To complete the pull request process, please assign vishh
You can assign the PR to them by writing /assign @vishh in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@SergeyKanzhelev
Copy link
Member

/assign @dims

@@ -25,42 +25,47 @@ import (
)

const (
ConfigSourceAnnotationKey = "kubernetes.io/config.source"
ConfigMirrorAnnotationKey = v1.MirrorPodAnnotationKey
// ConfigSourceAnnotationKey specifies a annotation key for config source
Copy link
Member

Choose a reason for hiding this comment

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

nit

Suggested change
// 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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// 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"
Copy link
Member

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

@SergeyKanzhelev
Copy link
Member

/priority backlog

@k8s-ci-robot k8s-ci-robot added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 25, 2020
@dims dims removed their assignment Jul 26, 2020
@SergeyKanzhelev
Copy link
Member

@qw1mb0 would you please rebase this PR?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 14, 2020
@k8s-ci-robot
Copy link
Contributor

@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.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 13, 2020
@SergeyKanzhelev
Copy link
Member

new attempt is here: #97374

/close

@k8s-ci-robot
Copy link
Contributor

@SergeyKanzhelev: Closed this PR.

In response to this:

new attempt is here: #97374

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/documentation Categorizes issue or PR as related to documentation. lgtm "Looks good to me", indicates that a PR is ready to be merged. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix golint failures
9 participants