Skip to content

Commit b58f2db

Browse files
committed
[local-preview] honour DO_NOT_TRACK env variable
Currently, There is no way to disable telemetry for `local-preview` as we run the cronjob manaully during init, when Gitpod is ready. This fixes that by honouring [`DO_NOT_TRACK` envrionment variable](https://consoledonottrack.com/) , which when set prevent the script from triggering the cronjob manually. Signed-off-by: Tarun Pothulapati <[email protected]>
1 parent ef13986 commit b58f2db

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

install/preview/entrypoint.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,12 @@ run_telemetry(){
143143
sleep 100
144144
# indefinitely wait for Gitpod pods to be ready
145145
kubectl wait --timeout=-1s --for=condition=ready pod -l app=gitpod,component!=migrations
146-
# manually tun the cronjob
147-
kubectl create job gitpod-telemetry-init --from=cronjob/gitpod-telemetry
146+
echo "Gitpod pods are ready"
147+
# honour DO_NOT_TRACK if set
148+
if [ -z "${DO_NOT_TRACK}" ] && [ "${DO_NOT_TRACK}" -eq 1 ]; then
149+
# manually tun the cronjob
150+
kubectl create job gitpod-telemetry-init --from=cronjob/gitpod-telemetry
151+
fi
148152
}
149153

150154
run_telemetry 2>&1 &

install/preview/prettylog/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var msgs = []struct {
2424
{Msg: "preparing system", Success: "extracting images to download ahead"},
2525
{Msg: "downloading images", Success: "--output-split-files"},
2626
{Msg: "preparing Gitpod preview installation", Success: "rm -rf /var/lib/rancher/k3s/server/manifests/gitpod"},
27-
{Msg: "starting Gitpod", Success: "gitpod-telemetry-init"},
27+
{Msg: "starting Gitpod", Success: "Gitpod pods are ready"},
2828
{Msg: fmt.Sprintf("Gitpod is running. Visit https://%s to access the dashboard", os.Getenv("DOMAIN"))},
2929
}
3030

0 commit comments

Comments
 (0)