Commit 89f99c0
authored
Add TOOLHIVE_SKIP_UPDATE_CHECK env var to disable update checks (#5264)
* Add TOOLHIVE_SKIP_UPDATE_CHECK env var to disable update checks
ShouldSkipUpdateChecks() previously detected only CI environments via a
fixed list of well-known CI env vars. There was no clean way for a user
or downstream distribution to disable update checks in a non-CI runtime
such as the operator.
Add TOOLHIVE_SKIP_UPDATE_CHECK as an explicit opt-out env var. When set
to "true" (case-insensitive), ShouldSkipUpdateChecks() returns true,
which skips update checks from the CLI, the API server middleware, and
the operator telemetry service. Update-derived usage metrics are also
skipped, since usagemetrics.shouldEnableMetrics gates on the same
function -- this is the intended coupling.
* Address review: test, regroup const, document in operator chart
- Add TestShouldSkipUpdateChecks_SkipEnvVar covering true / TRUE / unset
/ false / unrecognized values. Clears CI env vars via t.Setenv so the
opt-out path is exercised regardless of how the test binary is run.
- Move EnvVarSkipUpdateCheck next to ciEnvVars so all "things that
decide skip" live together. Expand the doc comment to spell out the
usage-metrics coupling.
- Document the env var on the operator chart's `operator.env` field so
it is discoverable from values.yaml and the auto-generated chart
README. Run helm-docs.1 parent 9d9604a commit 89f99c0
4 files changed
Lines changed: 45 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
| |||
153 | 159 | | |
154 | 160 | | |
155 | 161 | | |
156 | | - | |
| 162 | + | |
| 163 | + | |
157 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
158 | 168 | | |
159 | 169 | | |
160 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
0 commit comments