@@ -9,19 +9,16 @@ import (
99 "regexp"
1010 "time"
1111
12+ "github.com/gookit/color"
1213 "github.com/samber/lo"
1314 "github.com/spf13/cobra"
1415 helm_v3 "helm.sh/helm/v3/cmd/helm"
1516 "helm.sh/helm/v3/pkg/action"
1617 "helm.sh/helm/v3/pkg/chart"
1718 "helm.sh/helm/v3/pkg/chart/loader"
18- "helm.sh/helm/v3/pkg/chartutil"
1919 "helm.sh/helm/v3/pkg/cli/values"
20- kubefake "helm.sh/helm/v3/pkg/kube/fake"
2120 "helm.sh/helm/v3/pkg/postrender"
2221 "helm.sh/helm/v3/pkg/registry"
23- "helm.sh/helm/v3/pkg/storage"
24- "helm.sh/helm/v3/pkg/storage/driver"
2522 "helm.sh/helm/v3/pkg/werf/chrttree"
2623 helmcommon "helm.sh/helm/v3/pkg/werf/common"
2724 "helm.sh/helm/v3/pkg/werf/kubeclnt"
@@ -566,16 +563,17 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
566563 chartPathOptions := action.ChartPathOptions {}
567564 chartPathOptions .SetRegistryClient (actionConfig .RegistryClient )
568565
569- // FIXME(ilya-lesikov): allow local mode
570- // TODO(ilya-lesikov): allow specifying kube version and additional capabilities manually
571566 actionConfig .Releases .MaxHistory = * commonCmdData .ReleasesHistoryMax
572- if false {
573- actionConfig .Capabilities = chartutil .DefaultCapabilities .Copy ()
574- actionConfig .KubeClient = & kubefake.PrintingKubeClient {Out : ioutil .Discard }
575- mem := driver .NewMemory ()
576- mem .SetNamespace (releaseNamespace .Name ())
577- actionConfig .Releases = storage .Init (mem )
578- }
567+
568+ // FIXME(ilya-lesikov): for local commands (lint, ...)
569+ // if false {
570+ // // allow specifying kube version and additional capabilities manually
571+ // actionConfig.Capabilities = chartutil.DefaultCapabilities.Copy()
572+ // actionConfig.KubeClient = &kubefake.PrintingKubeClient{Out: ioutil.Discard}
573+ // mem := driver.NewMemory()
574+ // mem.SetNamespace(releaseNamespace.Name())
575+ // actionConfig.Releases = storage.Init(mem)
576+ // }
579577
580578 tracker := resrctracker .NewResourceTracker (clientFactory .Static (), clientFactory .Dynamic (), clientFactory .Discovery (), clientFactory .Mapper ())
581579
@@ -727,7 +725,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
727725 if useless , err := plan .Useless (); err != nil {
728726 return fmt .Errorf ("error checking if deploy plan will do nothing useful: %w" , err )
729727 } else if useless {
730- log .Default .Info (ctx , "Skipped release %q in namespace %q: cluster resources already as desired. " , releaseName , releaseNamespace .Name ())
728+ log .Default .Info (ctx , color. Style { color . Bold , color . Green }. Render ( "Skipped release" ) + " %q ( namespace: %q) : cluster resources already as desired" , releaseName , releaseNamespace .Name ())
731729 return nil
732730 }
733731
@@ -855,7 +853,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
855853 } else if len (finalErrs ) > 0 {
856854 return utls .Multierrorf ("succeeded release %q (namespace: %q), but errors encountered" , finalErrs , releaseName , releaseNamespace .Name ())
857855 } else {
858- log .Default .Info (ctx , "Succeeded release %q (namespace: %q)" , releaseName , releaseNamespace .Name ())
856+ log .Default .Info (ctx , color. Style { color . Bold , color . Green }. Render ( "Succeeded release" ) + " %q (namespace: %q)" , releaseName , releaseNamespace .Name ())
859857 return nil
860858 }
861859 })
0 commit comments