Skip to content
Permalink
Browse files
fix(cleanup): fail when no kubernetes configs available and no --with…
…out-kube option specified

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed Mar 23, 2022
1 parent 5b118f4 commit 14de74f57d85bc79a6d5408c70ce183d25554c4a
Showing with 1 addition and 2 deletions.
  1. +1 −2 pkg/cleaning/cleanup.go
@@ -23,7 +23,6 @@ import (
"github.com/werf/werf/pkg/storage"
"github.com/werf/werf/pkg/storage/manager"
"github.com/werf/werf/pkg/util"
"github.com/werf/werf/pkg/werf/global_warnings"
)

type CleanupOptions struct {
@@ -121,7 +120,7 @@ func (m *cleanupManager) run(ctx context.Context) error {
if m.LocalGit != nil {
if !m.WithoutKube {
if len(m.KubernetesContextClients) == 0 {
global_warnings.GlobalWarningLn(ctx, "No kubernetes configs found to skip images being used in the Kubernetes, pass --without-kube option (or WERF_WITHOUT_KUBE env var) to silence this warning")
return fmt.Errorf("no kubernetes configs found to skip images being used in the Kubernetes, pass --without-kube option (or WERF_WITHOUT_KUBE env var) to suppress this error")
}

deployedDockerImagesNames, err := m.deployedDockerImagesNames(ctx)

0 comments on commit 14de74f

Please sign in to comment.