Skip to content

Commit

Permalink
clusterct: support disable version check
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuvaraj Kakaraparthi committed Apr 27, 2022
1 parent 09e7790 commit ec23ca9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/clusterctl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ var RootCmd = &cobra.Command{
if err != nil {
return err
}
disable, err := configClient.Variables().Get("CLUSTERCTL_DISABLE_VERSIONCHECK")
if err == nil && disable == "true" {
// version check is disabled. Return early.
return nil
}
output, err := newVersionChecker(configClient.Variables()).Check()
if err != nil {
return errors.Wrap(err, "unable to verify clusterctl version")
Expand Down
5 changes: 5 additions & 0 deletions docs/book/src/clusterctl/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,8 @@ images:
To have more verbose logs you can use the `-v` flag when running the `clusterctl` and set the level of the logging verbose with a positive integer number, ie. `-v 3`.

If you do not want to use the flag every time you issue a command you can set the environment variable `CLUSTERCTL_LOG_LEVEL` or set the variable in the `clusterctl` config file located by default at `$HOME/.cluster-api/clusterctl.yaml`.


## Skip checking for updates

`clusterctl` automatically checks for new versions every time it is used. If you do not want `clusterctl` to check for new updates you can set the environment variable `CLUSTERCTL_DISABLE_VERSIONCHECK` to `"true"` or set the variable in the `clusterctl` config file located by default at `$HOME/.cluster-api/clusterctl.yaml`.

0 comments on commit ec23ca9

Please sign in to comment.