Skip to content

Commit

Permalink
Merge pull request #9412 from Asarew/fix-panic-on-updating-mount-afte…
Browse files Browse the repository at this point in the history
…r-creation

fix panic when updating mount-string with KiC driver after cluster creation without mount configuration
  • Loading branch information
medyagh authored Oct 8, 2020
2 parents e573b92 + 93bbf4c commit 32922f4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,15 @@ func runStart(cmd *cobra.Command, args []string) {

if existing != nil && driver.IsKIC(existing.Driver) {
if viper.GetBool(createMount) {
mount := viper.GetString(mountString)
if len(existing.ContainerVolumeMounts) != 1 || existing.ContainerVolumeMounts[0] != mount {
old := ""
if len(existing.ContainerVolumeMounts) > 0 {
old = existing.ContainerVolumeMounts[0]
}
if mount := viper.GetString(mountString); old != mount {
exit.Message(reason.GuestMountConflict, "Sorry, {{.driver}} does not allow mounts to be changed after container creation (previous mount: '{{.old}}', new mount: '{{.new}})'", out.V{
"driver": existing.Driver,
"new": mount,
"old": existing.ContainerVolumeMounts[0],
"old": old,
})
}
}
Expand Down

0 comments on commit 32922f4

Please sign in to comment.