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

use CRICheck in "kubeadm reset" #64332

Conversation

bart0sh
Copy link
Contributor

@bart0sh bart0sh commented May 25, 2018

What this PR does / why we need it:

"kubeadm reset" tries to use CRI if it finds crictl in PATH

It's better to use the same approach as in preflight checks:
use CRICheck only if cri socket is provided by user.

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 25, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bart0sh
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: fabriziopandini

Assign the PR to them by writing /assign @fabriziopandini in a comment when ready.

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 requested review from dixudx and kad May 25, 2018 18:47
@k8s-ci-robot k8s-ci-robot added area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. labels May 25, 2018
@kad
Copy link
Member

kad commented May 26, 2018

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 26, 2018
@@ -33,6 +33,7 @@ import (
kubeadmapiv1alpha2 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1alpha2"
"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/validation"
kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants"
kubeadmdefaults "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1alpha1"
Copy link
Member

Choose a reason for hiding this comment

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

why not to use already imported kubeadmapiv1alpha2 ?

@bart0sh
Copy link
Contributor Author

bart0sh commented May 26, 2018

/retest

@bart0sh bart0sh force-pushed the PR0016-kubeadm-reset-check-CRI-correctly branch from 718f4ba to 6cea24e Compare May 28, 2018 07:24
@bart0sh
Copy link
Contributor Author

bart0sh commented May 28, 2018

/test pull-kubernetes-e2e-gce-device-plugin-gpu

2 similar comments
@bart0sh
Copy link
Contributor Author

bart0sh commented May 28, 2018

/test pull-kubernetes-e2e-gce-device-plugin-gpu

@bart0sh
Copy link
Contributor Author

bart0sh commented May 28, 2018

/test pull-kubernetes-e2e-gce-device-plugin-gpu

@dixudx
Copy link
Member

dixudx commented May 29, 2018

/retest

"kubeadm reset" tries to use CRI if it finds crictl in PATH

It's better to use the same approach as in preflight checks:
use CRICheck only if cri socket is provided by user.
@bart0sh bart0sh force-pushed the PR0016-kubeadm-reset-check-CRI-correctly branch from 6cea24e to ab3adbb Compare May 29, 2018 11:11
if err == nil {
resetWithCrictl(execer, dockerCheck, criSocketPath, crictlPath)
func reset(execer utilsexec.Interface, dockerCheck preflight.Checker, criCheck preflight.Checker, criSocketPath string) {
if criSocketPath != kubeadmapiv1alpha2.DefaultCRISocket {
Copy link
Member

Choose a reason for hiding this comment

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

Having a lot of detection for docker vs. crictrl spread across source code is not good in my opinion.
It will be a lot better to refactor this code a bit, move all detection to helper function in preflight/checks.go and here keep only simple code resetWithDocker/resetWithCrictl based on output of helper function.

Copy link
Member

Choose a reason for hiding this comment

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

Agree.

@bart0sh
Copy link
Contributor Author

bart0sh commented Jun 1, 2018

Closing. will address this different way. Thanks for the review!

@bart0sh bart0sh closed this Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note-none Denotes a PR that doesn't merit a release note. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. 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.

None yet

4 participants