@cryptotaxi247 / netdata-1 / commits / d692a5130

Treat auto-updates as a tristate internally. (#12634)

If no options are specified, use the value `default` to indicate that the default behavior is requested. Long-term, this will allow us to easily have different defaults depending on other installation parameters. Shorter term, it allows us to explicitly indicate in telemetry events whether the user asked for auto updates, asked for no auto updates, or just went with the default.

Austin S. Hemmelgarn committed Apr 27, 2022 at 10:12 UTC d692a513030951e374e77af41c28c68a270f137c
1 file changed +9 -2
packaging/installer/kickstart.sh
+9 -2
@@ -27,7 +27,7 @@ DRY_RUN=0
27 SELECTED_INSTALL_METHOD="none"
28 INSTALL_TYPE="unknown"
29 INSTALL_PREFIX=""
30 -NETDATA_AUTO_UPDATES="1"
30 +NETDATA_AUTO_UPDATES="default"
31 NETDATA_CLAIM_ONLY=0
32 NETDATA_CLAIM_URL="${PUBLIC_CLOUD_URL}"
33 NETDATA_DISABLE_CLOUD=0
@@ -223,6 +223,7 @@ telemetry_event() {
223 "error_message": "${2}",
224 "install_options": "${KICKSTART_OPTIONS}",
225 "install_interactivity": "${INTERACTIVE}",
226 + "install_auto_updates": "${NETDATA_AUTO_UPDATES}",
227 "total_runtime": "${total_duration}",
228 "selected_install_method": "${SELECTED_INSTALL_METHOD}",
229 "netdata_release_channel": "${RELEASE_CHANNEL:-null}",
@@ -1085,7 +1086,7 @@ set_auto_updates() {
1086 return 0
1087 fi
1088
1088 - if [ "${NETDATA_AUTO_UPDATES}" = "1" ]; then
1089 + if [ "${AUTO_UPDATE}" -eq 1 ]; then
1090 if [ "${DRY_RUN}" -eq 1 ]; then
1091 progress "Would have attempted to enable automatic updates."
1092 # This first case is for catching using a new kickstart script with an old build. It can be safely removed after v1.34.0 is released.
@@ -1831,6 +1832,12 @@ if [ -n "${STATIC_INSTALL_OPTIONS}" ]; then
1832 fi
1833 fi
1834
1835 +if [ "${NETDATA_AUTO_UPDATES}" = "default" ] || [ "${NETDATA_AUTO_UPDATES}" = "1" ]; then
1836 + AUTO_UPDATE=1
1837 +else
1838 + AUTO_UPDATE=0
1839 +fi
1840 +
1841 check_claim_opts
1842 confirm_root_support
1843 get_system_info