chore: remove the leftovers of the act runner deployment
changelog / changelog (push) Successful in 16s
Bash / bash-unittest (push) Successful in 27s
Helm / helm-unittest (push) Successful in 1m12s
Helm / helm-lint (push) Successful in 10s
Markdown linter / markdown-link-checker (push) Failing after 37s
Markdown linter / markdown-lint (push) Successful in 15s
changelog / changelog (push) Successful in 16s
Bash / bash-unittest (push) Successful in 27s
Helm / helm-unittest (push) Successful in 1m12s
Helm / helm-lint (push) Successful in 10s
Markdown linter / markdown-link-checker (push) Failing after 37s
Markdown linter / markdown-lint (push) Successful in 15s
`scripts/act_runner/token.sh` bootstrapped the registration token of an act runner by patching a Kubernetes Secret with kubectl. The deployment it belonged to is long gone, and no glob picked the file up either: the chart only ships `scripts/init-containers/config/*.sh` and `scripts/init-containers/init/*.sh`, so the script was not even part of the packaged chart. The label helpers `gitea.labels.actRunner` and `gitea.selectorLabels.actRunner` were orphaned the same way. The former is referenced by no template at all and the latter only by the former, which left them as a closed loop without an entry point. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -1,43 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
timeout_delay=15
|
|
||||||
|
|
||||||
check_token() {
|
|
||||||
set +e
|
|
||||||
|
|
||||||
echo "Checking for existing token..."
|
|
||||||
token="$(kubectl get secret "$SECRET_NAME" -o jsonpath="{.data['token']}" 2> /dev/null)"
|
|
||||||
[ $? -ne 0 ] && return 1
|
|
||||||
[ -z "$token" ] && return 2
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
create_token() {
|
|
||||||
echo "Waiting for new token to be generated..."
|
|
||||||
begin=$(date +%s)
|
|
||||||
end=$((begin + timeout_delay))
|
|
||||||
while true; do
|
|
||||||
[ -f /data/actions/token ] && return 0
|
|
||||||
[ "$(date +%s)" -gt $end ] && return 1
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
store_token() {
|
|
||||||
echo "Storing the token in Kubernetes secret..."
|
|
||||||
kubectl patch secret "$SECRET_NAME" -p "{\"data\":{\"token\":\"$(base64 /data/actions/token | tr -d '\n')\"}}"
|
|
||||||
}
|
|
||||||
|
|
||||||
if check_token; then
|
|
||||||
echo "Key already in place, exiting."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! create_token; then
|
|
||||||
echo "Checking for an existing act runner token in secret $SECRET_NAME timed out after $timeout_delay"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
store_token
|
|
||||||
@@ -166,15 +166,6 @@ version: {{ .Values.deployment.gitea.image.tag | default .Chart.AppVersion | quo
|
|||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "gitea.labels.actRunner" -}}
|
|
||||||
helm.sh/chart: {{ include "gitea.chart" . }}
|
|
||||||
app: {{ include "gitea.name" . }}-act-runner
|
|
||||||
{{ include "gitea.selectorLabels.actRunner" . }}
|
|
||||||
app.kubernetes.io/version: {{ .Values.deployment.gitea.image.tag | default .Chart.AppVersion | quote }}
|
|
||||||
version: {{ .Values.deployment.gitea.image.tag | default .Chart.AppVersion | quote }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Selector labels
|
Selector labels
|
||||||
*/}}
|
*/}}
|
||||||
@@ -183,11 +174,6 @@ app.kubernetes.io/name: {{ include "gitea.name" . }}
|
|||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "gitea.selectorLabels.actRunner" -}}
|
|
||||||
app.kubernetes.io/name: {{ include "gitea.name" . }}-act-runner
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- define "postgresql-ha.dns" -}}
|
{{- define "postgresql-ha.dns" -}}
|
||||||
{{- if (index .Values "postgresql-ha").enabled -}}
|
{{- if (index .Values "postgresql-ha").enabled -}}
|
||||||
{{- printf "%s-postgresql-ha-pgpool.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain (index .Values "postgresql-ha" "service" "ports" "postgresql") -}}
|
{{- printf "%s-postgresql-ha-pgpool.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain (index .Values "postgresql-ha" "service" "ports" "postgresql") -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user