Merge pull request #4689 from palnabarun/4664-fix

Fixes the issue which caused all containers to be deleted on minikube delete
pull/4732/head
Medya Ghazizadeh 2019-07-09 15:23:39 -07:00 committed by GitHub
commit 57f6d877ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,9 @@ import (
"k8s.io/minikube/pkg/minikube/console"
)
// KubernetesContainerPrefix is the prefix of each kubernetes container
const KubernetesContainerPrefix = "k8s_"
// Docker contains Docker runtime state
type Docker struct {
Socket string
@ -102,6 +105,7 @@ func (r *Docker) KubeletOptions() map[string]string {
// ListContainers returns a list of containers
func (r *Docker) ListContainers(filter string) ([]string, error) {
filter = KubernetesContainerPrefix + filter
content, err := r.Runner.CombinedOutput(fmt.Sprintf(`docker ps -a --filter="name=%s" --format="{{.ID}}"`, filter))
if err != nil {
return nil, err