Skip to content

Commit

Permalink
fix: add werf-cleanup command warning when no kube configs available
Browse files Browse the repository at this point in the history
Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed Feb 22, 2022
1 parent 4a69df9 commit e87261b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/cleaning/cleanup.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e87261b

Please sign in to comment.