Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 14de74f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/cleaning/cleanup.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 14de74f

Please sign in to comment.