-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Removed systemd dependency from minikube, updated none driver to refl… #1592
Removed systemd dependency from minikube, updated none driver to refl… #1592
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1592 +/- ##
==========================================
- Coverage 38.66% 38.63% -0.03%
==========================================
Files 51 51
Lines 2607 2658 +51
==========================================
+ Hits 1008 1027 +19
- Misses 1421 1450 +29
- Partials 178 181 +3
Continue to review full report at Codecov.
|
pkg/minikube/cluster/commands.go
Outdated
@@ -76,6 +92,26 @@ func GetStartCommand(kubernetesConfig KubernetesConfig) (string, error) { | |||
return buf.String(), nil | |||
} | |||
|
|||
func GetStartCommandNone(kubernetesConfig KubernetesConfig, localkubeStartCmd string) (string, error) { |
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.
Maybe rename this to GetStartCommandNoSystemd
or something like that
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.
Done
a4c4827
to
7859cc3
Compare
@@ -96,10 +91,19 @@ func (d *Driver) GetURL() (string, error) { | |||
} | |||
|
|||
func (d *Driver) GetState() (state.State, error) { | |||
command := `sudo systemctl is-active localkube 2>&1 1>/dev/null && echo "Running" || echo "Stopped"` | |||
var localkubeStatusCommand = fmt.Sprintf("if [[ `systemctl` =~ -\\.mount ]] &>/dev/null; "+`then |
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.
This might be out of scope for this fix, but why do we have this variable in two places?
ef3c5d5
to
12d1604
Compare
12d1604
to
6639b2d
Compare
@@ -246,3 +247,34 @@ func KillMountProcess() error { | |||
} | |||
return mountProc.Kill() | |||
} | |||
|
|||
func MaybeChownDirRecursiveToMinikubeUser(dir string) error { | |||
if os.Getenv("CHANGE_MINIKUBE_NONE_USER") != "" && os.Getenv("SUDO_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.
Do you need this first os.Getenv check? It looks like you only call this if CHANGE_MINIKUBE_NONE_USER is true.
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.
there is a case with the kubeconfig that it is not called prior: https://github.com/kubernetes/minikube/pull/1592/files/6639b2d91b950e37263651cd5754580f4df641ae#diff-e6d872db86cdf946b7845146b021f711R170
@@ -577,15 +574,20 @@ func EnsureMinikubeRunningOrExit(api libmachine.API, exitStatus int) { | |||
// RunCommand executes commands for both the local and driver implementations | |||
func RunCommand(h *host.Host, command string, sudo bool) (string, error) { | |||
if h.Driver.DriverName() == "none" { | |||
cmd := exec.Command("/bin/sh", "-c", command) | |||
cmd := exec.Command("/bin/bash", "-c", command) |
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 just checked and we do have bash. Nice.
we can probably remove |
ref #1616 |
…ect this