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

Add a check for crio service before starting node e2e tests #94760

Merged
merged 1 commit into from Sep 21, 2020

Conversation

harche
Copy link
Contributor

@harche harche commented Sep 14, 2020

What type of PR is this?
/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #94759

Special notes for your reviewer:
None

Does this PR introduce a user-facing change?:

None

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

None

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. 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 Sep 14, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @harche. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 14, 2020
@k8s-ci-robot k8s-ci-robot added area/test sig/node Categorizes an issue or PR as relevant to SIG Node. 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 Sep 14, 2020
@harche
Copy link
Contributor Author

harche commented Sep 14, 2020

/assign @ConnorDoyle

@harche harche changed the title Crio tests fix Crio node e2e test fix Sep 14, 2020
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.

/cc @oomichi

@@ -70,7 +70,8 @@ func GetHostnameOrIP(hostname string) string {
host = ip
}

if *sshUser == "" {
// Do no ignore the KUBE_SSH_USER if it's set explicitly
if os.Getenv("KUBE_SSH_USER") != "" {
Copy link
Member

Choose a reason for hiding this comment

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

I think the specified sshUser should be used instead of the env variable if specifying --ssh-user option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@oomichi Thanks for your reply. For the Fedora CoreOS host, the only user available on host is core. We have seen failures like,

prow@104.199.120.168: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

The prow user doesn't exist on the Fedora CoreOS. In fact, KUBE_SSH_USER was introduced to handle Fedora CoreOS hosts (which will be used extensively for CRI-O testing as well as in future RuntimeClass tests)

This PR doesn't prevent the existing flow, it's just that for Fedora CoreOS we want to make sure we use the username that we know works.

cc @dims

Copy link
Member

Choose a reason for hiding this comment

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

@harche Thanks for your response. I see your point.
I guess that comes from https://github.com/kubernetes/test-infra/blob/master/kubetest/e2e.go#L575 which gets the specified username on --ssh-user option from the env value USER.
I feel it is better to get the username from the env value KUBE_SSH-USER if existing. If not existing, get the username from the env value USER as current implementation.

I'd like to get help from @BenTheElder for the above idea.

Copy link
Member

Choose a reason for hiding this comment

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

I agree that if --ssh-user is set we should respect that.
It also seems like https://github.com/kubernetes/test-infra/blob/feccbf60454db394d955e00977a9e2829712f050/kubetest/e2e.go#L575 could handle KUBE_SSH_USER overridding USER

Copy link
Contributor Author

Choose a reason for hiding this comment

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

kubernetes/test-infra#19273 making kubetest/e2e.go handle KUBE_SSH_USER overridding USER.

cc @oomichi @BenTheElder

@dims
Copy link
Member

dims commented Sep 17, 2020

/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 Sep 17, 2020
@dims
Copy link
Member

dims commented Sep 17, 2020

@oomichi let's unblock the CRI-O folks as we know this works. We can log a follow up issue to tweak if needed. How does that sound?

@harche
Copy link
Contributor Author

harche commented Sep 17, 2020

/test pull-kubernetes-conformance-kind-ipv6-parallel

@oomichi
Copy link
Member

oomichi commented Sep 17, 2020

@oomichi let's unblock the CRI-O folks as we know this works. We can log a follow up issue to tweak if needed. How does that sound?

As you know, for example kubectl tries reading the specified kubeconfig at first. If not specified, the env value KUBECONFIG is read. Such behavior seems pretty straightforward and that is the same as the existing one.
And current PR changes the above behavior like makes the env value stronger than the specified option value.
I'd like to see opinions from other people.

@@ -70,7 +70,8 @@ func GetHostnameOrIP(hostname string) string {
host = ip
}

if *sshUser == "" {
// Do no ignore the KUBE_SSH_USER if it's set explicitly
if os.Getenv("KUBE_SSH_USER") != "" {
*sshUser = os.Getenv("KUBE_SSH_USER")
Copy link
Member

@neolit123 neolit123 Sep 18, 2020

Choose a reason for hiding this comment

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

as discussed above the flag should take precedence over the environment variable.

please change the logic to something like:

var user string
if *sshUser != "" {
	user = *sshUser
	goto add_user
}
if os.Getenv("KUBE_SSH_USER") != "" {
	user = os.Getenv("KUBE_SSH_USER")
	goto add_user
}
return host
add_user:
	return fmt.Sprintf("%s@%s", user, host)

or ....

if *sshUser != "" {
	return fmt.Sprintf("%s@%s", *sshUser, host)
}
user := os.Getenv("KUBE_SSH_USER")
if user != "" {
	return fmt.Sprintf("%s@%s", user, host)
}
return host

Signed-off-by: Harshal Patil <harpatil@redhat.com>
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 18, 2020
@harche harche changed the title Crio node e2e test fix Add a check for crio service before starting node e2e tests Sep 18, 2020
@harche
Copy link
Contributor Author

harche commented Sep 18, 2020

@oomichi @BenTheElder @dims based on the feedback, I have created kubernetes/test-infra#19273 to set the ssh username.

The only change in this PR now is just to add the check to see if the remote node is running crio.service or not.

Thanks everyone for taking time out for reviewing this PR.

Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 18, 2020
@neolit123
Copy link
Member

i've commented on the test-infra PR.
/priority important-longterm

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 18, 2020
@oomichi
Copy link
Member

oomichi commented Sep 18, 2020

Thanks for your work @harche

/lgtm

@dims
Copy link
Member

dims commented Sep 20, 2020

/approve
/lgtm
/milestone v1.20

@k8s-ci-robot k8s-ci-robot added this to the v1.20 milestone Sep 20, 2020
@harche
Copy link
Contributor Author

harche commented Sep 20, 2020

/assign @ConnorDoyle

1 similar comment
@harche
Copy link
Contributor Author

harche commented Sep 20, 2020

/assign @ConnorDoyle

@harche
Copy link
Contributor Author

harche commented Sep 20, 2020

/approve
/lgtm
/milestone v1.20

Thanks @dims, it seem for some reason the approve label is not getting assigned.

@dims dims removed their assignment Sep 20, 2020
@dims
Copy link
Member

dims commented Sep 20, 2020

/assign @sjenning @dashpole

@dims
Copy link
Member

dims commented Sep 20, 2020

@harche i don't have approval rights for this directory :)

@harche
Copy link
Contributor Author

harche commented Sep 21, 2020

@harche i don't have approval rights for this directory :)

oh ok. @sjenning do you have the approval rights?

@neolit123
Copy link
Member

neolit123 commented Sep 21, 2020 via email

@sjenning
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, harche, sjenning

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 Sep 21, 2020
@k8s-ci-robot k8s-ci-robot merged commit cdc7a29 into kubernetes:master Sep 21, 2020
@harche harche deleted the crio_tests_fix branch September 21, 2020 17:11
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/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. 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/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. 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. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crio node e2e test fails
9 participants