Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ Every switch fails closed, so an opt-out is never read as "on":
`GARDENER_USAGE_REPORTING_ENABLED`, once set (in the environment or
`notify.env`, even blank), keeps reporting on only for `true`, `on`, `yes` or
`1` (any case); anything else — empty, a typo — turns it off, and so does a
`notify.env` that exists but cannot be read. `TRACE_USAGE_REPORTING` set to
`notify.env` that exists but cannot be read, unless the environment variable
itself says on. `TRACE_USAGE_REPORTING` set to
anything but blank or one of those values turns it off, as does `DO_NOT_TRACK`
set to anything but blank, `0`, `false`, `off` or `no`. An opt-out written
under another spelling counts as off too and wins over the real setting:
Expand Down
12 changes: 10 additions & 2 deletions docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,16 @@ loopback `http.server` started in the test (never the real trace
service): the three
`GARDENER_USAGE_REPORTING_*` settings' precedence (env var, then the same
name in `notify.env` under a tmp `GARDENER_STATE_DIR`, then the built-in
default; a blank value falls through, only an explicit `0/false/no/off`
opts out, an unreadable file degrades to a stderr warning), that the
default; a blank value falls through), that the enabled switch fails
closed (in the environment or `notify.env`, only `true/on/yes/1` keeps
reporting on: blank everywhere, a typo or `disabled` is off; a `notify.env`
that exists but cannot be read is off with a stderr warning unless the
environment says on, while endpoint and key fall back to their defaults),
that an opt-out under a near-miss name (`GARDENER_USAGE_REPORTING=off`,
`..._ENABLE=false`, lower-case or hyphenated spellings, `..._DISABLED=true`)
is off and wins over the real switch saying on, while near-miss names that
say on, the endpoint/key settings and other programs' switches in the
environment are not read as an opt-out, that the
`startup` body is exactly `application`/`name`/three tags (`version`,
`service`, `install`) with nothing about the machine or the run in it, that
the installation ID file lives in the state dir and is reused, that
Expand Down
3 changes: 2 additions & 1 deletion gardener/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
setting is read through the client's ``allows_reporting``, so once it is set
(in the environment or in ``notify.env``, even to a blank value) only
true/on/yes/1 keeps reporting on; and a ``notify.env`` that exists but cannot
be read turns reporting off, since it may hold the opt-out. So does an
be read turns reporting off unless the environment variable says on, since it
may hold the opt-out. So does an
opt-out written under another spelling (``GARDENER_USAGE_REPORTING=off``,
``GARDENER_USAGE_REPORTING_ENABLE=false``,
``gardener_usage_reporting_enabled=no``,
Expand Down
Loading