Skip to content

Add option to skip upgrade check via env variable #64

@mszostok

Description

@mszostok

Description

Add option to skip upgrade check via env variable. It should be done via option, so such thing:

// when set environment HELMFILE_UPGRADE_NOTICE_DISABLED any value, skip upgrade notice.
var versionOpts []extension.CobraOption
if os.Getenv("HELMFILE_UPGRADE_NOTICE_DISABLED") == "" {
	versionOpts = append(versionOpts, extension.WithUpgradeNotice("helmfile", "helmfile"))
}

// ...
extension.NewVersionCobraCmd(
	versionOpts...,
),

can be optimized to:

extension.NewVersionCobraCmd(
  extension.WithUpgradeNotice("helmfile", "helmfile",
    upgrade.WithSkipOnEnv("HELMFILE_UPGRADE_NOTICE_DISABLED"),
  ),
)

By default, setting below envs to any value should also disable the update check:

  • {CLI_NAME}_NO_UPDATE_NOTIFIER - matches the gh CLI style
  • {CLI_NAME}_UPGRADE_NOTICE_DISABLED - matches the helmfile style

See the helmfile usage: helmfile/helmfile#412

Reasons

Enhance UX

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/customizationEnables default behavior customizationarea/documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions