File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11apiVersion : v2
22description : A Helm chart with Keda scalable Azure Devops build agent for Kubernetes
33name : charts-ado-build-agents
4- version : 3.6.0
4+ version : 3.6.1
55appVersion : " 1.0"
Original file line number Diff line number Diff line change @@ -145,11 +145,19 @@ spec:
145145 preStop :
146146 exec :
147147 command :
148- - " powershell.exe"
149- - " -NoLogo"
150- - " -NoProfile"
151- - " -Command"
152- - " Start-Sleep -Seconds {{ .Values.agent.terminationGracePeriodSeconds }}"
148+ - powershell.exe
149+ - -NoLogo
150+ - -NoProfile
151+ - -Command
152+ - |
153+ $token = Get-Content C:\azp\.token
154+ while($true) {
155+ C:\azp\agent\config.cmd remove --unattended --auth PAT --token $token >> C:\azp\cleanup.log 2>&1
156+ if ($LASTEXITCODE -eq 0) {
157+ break
158+ }
159+ Start-Sleep -Seconds 30
160+ }
153161 {{- end }}
154162 imagePullPolicy : IfNotPresent
155163 {{- with .Values.agent.securityContext }}
Original file line number Diff line number Diff line change @@ -144,11 +144,19 @@ spec:
144144 preStop :
145145 exec :
146146 command :
147- - " powershell.exe"
148- - " -NoLogo"
149- - " -NoProfile"
150- - " -Command"
151- - " Start-Sleep -Seconds {{ .Values.agent.terminationGracePeriodSeconds }}"
147+ - powershell.exe
148+ - -NoLogo
149+ - -NoProfile
150+ - -Command
151+ - |
152+ $token = Get-Content C:\azp\.token
153+ while($true) {
154+ C:\azp\agent\config.cmd remove --unattended --auth PAT --token $token >> C:\azp\cleanup.log 2>&1
155+ if ($LASTEXITCODE -eq 0) {
156+ break
157+ }
158+ Start-Sleep -Seconds 30
159+ }
152160 {{- end }}
153161 imagePullPolicy : IfNotPresent
154162 {{- with .Values.agent.securityContext }}
You can’t perform that action at this time.
0 commit comments