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
Conversation
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 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. |
/assign @ConnorDoyle |
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.
/cc @oomichi
test/e2e_node/remote/ssh.go
Outdated
@@ -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") != "" { |
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.
I think the specified sshUser should be used instead of the env variable if specifying --ssh-user
option.
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.
@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
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.
@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.
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.
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
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.
kubernetes/test-infra#19273 making kubetest/e2e.go
handle KUBE_SSH_USER overridding USER.
/ok-to-test |
@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? |
/test pull-kubernetes-conformance-kind-ipv6-parallel |
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. |
test/e2e_node/remote/ssh.go
Outdated
@@ -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") |
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.
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>
@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 Thanks everyone for taking time out for reviewing this PR. |
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
i've commented on the test-infra PR. |
Thanks for your work @harche /lgtm |
/approve |
/assign @ConnorDoyle |
1 similar comment
/assign @ConnorDoyle |
Thanks @dims, it seem for some reason the |
@harche i don't have approval rights for this directory :) |
Ideally someone from #sig-node (k8s slack)should approve.
|
/approve |
[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 |
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?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: