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 failures of e2e/framework/util.go - part2 #76488

Conversation

atoato88
Copy link
Contributor

@atoato88 atoato88 commented Apr 12, 2019

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This is a part of a series for fixing golint failures for util.go.

  • fixes golint failures from line 1395 to line 2353 at original util.go

This fixes golint failures of the following file:

  • test/e2e/framework/util.go

This changes following files because of change function name
in above file.

  • test/e2e/apps/rc.go
  • test/e2e/apps/replica_set.go

Special notes for your reviewer:

The others of this series are following:

Does this PR introduce a user-facing change?:

NONE

Ref: #68026

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. 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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 12, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @atoato88. 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 the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 12, 2019
@k8s-ci-robot k8s-ci-robot added area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 12, 2019
@xichengliudui
Copy link
Contributor

/ok-to-test

@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 Apr 12, 2019
@xichengliudui
Copy link
Contributor

/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 Apr 12, 2019
@xichengliudui
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 12, 2019
@@ -1515,7 +1516,7 @@ func podRunning(c clientset.Interface, podName, namespace string) wait.Condition
}
}

// WaitTimeoutForPodEvent waits for an event to occur for a pod
// WaitTimeoutForPodEvent waits for an event to occur for a pod.
Copy link
Member

Choose a reason for hiding this comment

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

added some minor comments.

Suggested change
// WaitTimeoutForPodEvent waits for an event to occur for a pod.
// WaitTimeoutForPodEvent waits the given timeout duration for a pod event to occur.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for comment.
I've fixed this.

@@ -1856,13 +1859,14 @@ type podProxyResponseChecker struct {
pods *v1.PodList
}

func PodProxyResponseChecker(c clientset.Interface, ns string, label labels.Selector, controllerName string, respondName bool, pods *v1.PodList) podProxyResponseChecker {
return podProxyResponseChecker{c, ns, label, controllerName, respondName, pods}
// GetPodProxyResponseChecker returns a context for checking a pods responses.
Copy link
Member

Choose a reason for hiding this comment

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

Is there a grammatical problem here?

Suggested change
// GetPodProxyResponseChecker returns a context for checking a pods responses.
// GetPodProxyResponseChecker returns a context for checking pods responses.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@@ -2098,6 +2109,7 @@ func ServiceResponding(c clientset.Interface, ns, name string) error {
})
}

// RestclientConfig returns a config holds the information needed to build connect to kubernetes clusters.
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
// RestclientConfig returns a config holds the information needed to build connect to kubernetes clusters.
// RestclientConfig returns a config holds the information needed to build connection to kubernetes clusters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@atoato88 atoato88 force-pushed the fix-golint-e2e-framework-util-go-part2 branch from 1eee2d6 to c2346c9 Compare April 12, 2019 14:48
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 12, 2019
func PodProxyResponseChecker(c clientset.Interface, ns string, label labels.Selector, controllerName string, respondName bool, pods *v1.PodList) podProxyResponseChecker {
return podProxyResponseChecker{c, ns, label, controllerName, respondName, pods}
// GetPodProxyResponseChecker returns a context for checking pods responses.
func GetPodProxyResponseChecker(c clientset.Interface, ns string, label labels.Selector, controllerName string, respondName bool, pods *v1.PodList) PodProxyResponseChecker {
Copy link
Member

Choose a reason for hiding this comment

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

Is prepending this method with Get something that golint enforces?

Copy link
Member

Choose a reason for hiding this comment

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

Looks like this is a constructor method, what are your thoughts on NewPodProxyResponseChecker instead?

Copy link
Member

Choose a reason for hiding this comment

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

This renaming seems for avoiding duplicated names between struct name (PodProxyResponseChecker which is returned with this method) and this method name.
NewPodProxyResponseChecker is also a good option for us I feel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

func NewKubectlCommand(args ...string) *kubectlBuilder {
b := new(kubectlBuilder)
// GetNewKubectlCommand returns a KubectlBuilder for running kubectl.
func GetNewKubectlCommand(args ...string) *KubectlBuilder {
Copy link
Member

Choose a reason for hiding this comment

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

I liked NewKubectlCommand actually, was golint complaining about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for comment.
I've fixed this.

@atoato88 atoato88 force-pushed the fix-golint-e2e-framework-util-go-part2 branch from c2346c9 to 0a56fe4 Compare April 17, 2019 09:51
@atoato88
Copy link
Contributor Author

I rebased with current master(commit: b359b6b).

This is a part of a series for fixing golint failures for util.go.
- fixes golint failures from line 1395 to line 2353 at original util.go

This fixes golint failures of the following file:
- test/e2e/framework/util.go

This changes following files because of change function name
in above file.
- test/e2e/apps/rc.go
- test/e2e/apps/replica_set.go
Copy link
Member

@oomichi oomichi left a comment

Choose a reason for hiding this comment

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

Thanks for updating

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 17, 2019
@oomichi
Copy link
Member

oomichi commented Apr 23, 2019

/approve

Copy link
Member

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

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: atoato88, oomichi, timothysc

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 23, 2019
@k8s-ci-robot k8s-ci-robot merged commit 4098347 into kubernetes:master Apr 23, 2019
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. area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", 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. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/testing Categorizes an issue or PR as relevant to SIG Testing. 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.

None yet

7 participants