Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to skip upgrade check via env variable #64

Open
mszostok opened this issue Oct 10, 2022 · 0 comments
Open

Add option to skip upgrade check via env variable #64

mszostok opened this issue Oct 10, 2022 · 0 comments
Labels
area/customization Enables default behavior customization area/documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@mszostok
Copy link
Owner

mszostok commented Oct 10, 2022

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

@mszostok mszostok added this to the v1.2.0 milestone Oct 10, 2022
@mszostok mszostok added area/documentation Improvements or additions to documentation enhancement New feature or request area/customization Enables default behavior customization labels Oct 10, 2022
@mszostok mszostok modified the milestones: v1.2.0, v1.3.0 May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/customization Enables default behavior customization area/documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant