From efa404e2750868e7ecc70641bc22c26113019e94 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Sun, 9 May 2021 12:09:58 +0900 Subject: [PATCH] Make `--skip-needs=true` the default option (#1835) Ref https://github.com/roboll/helmfile/issues/1830#issuecomment-835632716 Ref #1692 Follow-up for #1772 --- main.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index fe8e4158..69b1d7a4 100644 --- a/main.go +++ b/main.go @@ -199,9 +199,9 @@ func main() { Name: "include-tests", Usage: "enable the diffing of the helm test hooks", }, - cli.BoolFlag{ + cli.BoolTFlag{ Name: "skip-needs", - Usage: `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided`, + Usage: `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided. Defaults to true when --include-needs is not provided`, }, cli.BoolFlag{ Name: "include-needs", @@ -403,9 +403,9 @@ func main() { Name: "skip-deps", Usage: `skip running "helm repo update" and "helm dependency build"`, }, - cli.BoolFlag{ + cli.BoolTFlag{ Name: "skip-needs", - Usage: `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided`, + Usage: `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided. Defaults to true when --include-needs is not provided`, }, cli.BoolFlag{ Name: "include-needs", @@ -472,9 +472,9 @@ func main() { Name: "skip-crds", Usage: "if set, no CRDs will be installed on sync. By default, CRDs are installed if not already present", }, - cli.BoolFlag{ + cli.BoolTFlag{ Name: "skip-needs", - Usage: `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided`, + Usage: `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided. Defaults to true when --include-needs is not provided`, }, cli.BoolFlag{ Name: "include-needs", @@ -761,7 +761,11 @@ func (c configImpl) HasCommandName(name string) bool { } func (c configImpl) SkipNeeds() bool { - return c.c.Bool("skip-needs") + if !c.IncludeNeeds() { + return c.c.Bool("skip-needs") + } + + return false } func (c configImpl) IncludeNeeds() bool {