Skip to content
Permalink
Browse files
fix: add werf-cleanup command warning when no kube configs available
Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed Feb 22, 2022
1 parent 4a69df9 commit e87261bcfb39cebe4a6d707641579305c3ed84b6
Showing with 5 additions and 0 deletions.
  1. +5 −0 pkg/cleaning/cleanup.go
@@ -23,6 +23,7 @@ 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 {
@@ -120,6 +121,10 @@ 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")
}

deployedDockerImagesNames, err := m.deployedDockerImagesNames(ctx)
if err != nil {
return fmt.Errorf("error getting deployed docker images names from Kubernetes: %s", err)

0 comments on commit e87261b

Please sign in to comment.