-
Notifications
You must be signed in to change notification settings - Fork 5
650 lines (556 loc) · 25.9 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
name: PR/main branch CI
on:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
APP_SLUG: replicated-sdk-e2e
jobs:
make-tests:
env:
PACT_VERSION: ${{ github.sha }}
PACT_BROKER_BASE_URL: ${{ vars.PACT_BROKER_BASE_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.22'
cache: false
- uses: replicatedhq/action-install-pact@v1
- run: make test
build-and-push-e2e:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.22'
- name: Build replicated image
uses: ./.github/actions/build-push-action
with:
context: deploy
image-name: ttl.sh/automated-${{ github.run_id }}/replicated-sdk:24h
git-tag: ${{ github.sha }}
- name: Build replicated chart
env:
USER: automated-${{ github.run_id }}
run: make -C chart build-ttl.sh
validate-chart:
runs-on: ubuntu-22.04
needs: [ build-and-push-e2e ]
steps:
- uses: actions/checkout@v4
- name: validate chart
run: |
output=$(helm template oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0)
if echo $output | grep -q integration-enabled; then
printf "'integration-enabled' key should not exist if value is not set by the user:\n\n%s\n\n" "$output"
exit 1
fi
if echo $output | grep -q 'kind: ConfigMap'; then
printf "legacy/deprecated configmap should not exist:\n\n%s\n\n" "$output"
exit 1
fi
if ! echo $output | grep -q 'kind: ServiceAccount'; then
printf "default service account should exist if user does not set serviceAccountName:\n\n%s\n\n" "$output"
exit 1
fi
if ! echo $output | grep -q 'kind: Role'; then
printf "default role should exist if user does not set serviceAccountName:\n\n%s\n\n" "$output"
exit 1
fi
if ! echo $output | grep -q 'kind: RoleBinding'; then
printf "default rolebinding should exist if user does not set serviceAccountName:\n\n%s\n\n" "$output"
exit 1
fi
if ! echo $output | grep -q 'statusInformers: null'; then
printf "default statusInformers should be null:\n\n%s\n\n" "$output"
exit 1
fi
output=$(helm template oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --set integration.enabled=true)
if ! echo $output | grep -q integration-enabled; then
printf "'integration-enabled' key should exist if value is set by the user:\n\n%s\n\n" "$output"
exit 1
fi
output=$(helm template oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --set isAirgap=true)
if ! echo $output | grep -q 'name: DISABLE_OUTBOUND_CONNECTIONS value: "true"'; then
printf "'DISABLE_OUTBOUND_CONNECTIONS' env var should be set to to 'true' in airgap mode:\n\n%s\n\n" "$output"
exit 1
fi
output=$(helm template oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --set serviceAccountName=foo)
if echo $output | grep -q 'kind: ServiceAccount'; then
printf "default service account should not exist if user sets serviceAccountName:\n\n%s\n\n" "$output"
exit 1
fi
if echo $output | grep -q 'kind: Role'; then
printf "default role should not exist if user sets serviceAccountName:\n\n%s\n\n" "$output"
exit 1
fi
if echo $output | grep -q 'kind: RoleBinding'; then
printf "default rolebinding should not exist if user sets serviceAccountName:\n\n%s\n\n" "$output"
exit 1
fi
if ! echo $output | grep -q 'serviceAccountName: foo'; then
printf "user-set serviceAccountName reference should exist:\n\n%s\n\n" "$output"
exit 1
fi
cat << EOF > test-values.yaml
extraEnv:
- name: TEST_EXTRA_ENV
value: test-extra-env
EOF
output=$(helm template oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --values test-values.yaml)
if ! echo $output | grep -q 'TEST_EXTRA_ENV'; then
printf "user-set extraEnv should exist:\n\n%s\n\n" "$output"
exit 1
fi
cat << EOF > test-values.yaml
tolerations:
- key: "test-toleration-key"
operator: "Equal"
value: "test-toleration-value"
effect: "NoSchedule"
EOF
output=$(helm template oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --values test-values.yaml)
if ! echo $output | grep -q 'tolerations:'; then
printf "user-set tolerations should exist:\n\n%s\n\n" "$output"
exit 1
fi
if ! echo $output | grep -q 'test-toleration-key'; then
printf "user-set tolerations key should exist:\n\n%s\n\n" "$output"
exit 1
fi
cat << EOF > test-values.yaml
statusInformers: []
EOF
output=$(helm template oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --values test-values.yaml)
if ! echo $output | grep -q 'statusInformers: \[\]'; then
printf "user-set empty statusInformers should exist:\n\n%s\n\n" "$output"
exit 1
fi
create-test-release:
runs-on: ubuntu-22.04
needs: [ build-and-push-e2e ]
outputs:
license-id: ${{ steps.create-customer.outputs.license-id }}
customer-id: ${{ steps.create-customer.outputs.customer-id }}
channel-slug: ${{ steps.create-release.outputs.channel-slug }}
steps:
- uses: actions/checkout@v4
- name: Package test chart
env:
REPLICATED_CHART_NAME: replicated
REPLICATED_REPOSITORY: oci://ttl.sh/automated-${{ github.run_id }}
REPLICATED_CHART_VERSION: 0.0.0
run: |
cd test-chart
envsubst < Chart.yaml.tmpl > Chart.yaml
helm dep update
helm package .
- name: Create release
id: create-release
uses: replicatedhq/replicated-actions/[email protected]
with:
app-slug: ${{ env.APP_SLUG }}
api-token: ${{ secrets.C11Y_MATRIX_TOKEN }}
chart: test-chart/test-chart-0.1.0.tgz
promote-channel: automated-${{ github.run_id }}
version: 0.1.0
- name: Create customer
id: create-customer
uses: replicatedhq/replicated-actions/create-customer@main
with:
app-slug: ${{ env.APP_SLUG }}
api-token: ${{ secrets.C11Y_MATRIX_TOKEN }}
customer-name: automated-${{ github.run_id }}
customer-email: [email protected]
license-type: dev
channel-slug: ${{ steps.create-release.outputs.channel-slug }}
entitlements: |
- name: "num_seats"
value: "10"
is-kots-install-enabled: "false"
validate-e2e:
runs-on: ubuntu-22.04
needs: [ create-test-release ]
strategy:
fail-fast: false
matrix:
cluster: [
{distribution: k3s, version: 1.26},
{distribution: kind, version: 1.27},
{distribution: gke, version: 1.28},
{distribution: eks, version: 1.29},
{distribution: openshift, version: 4.14.0-okd}
]
env:
LICENSE_ID: ${{ needs.create-test-release.outputs.license-id }}
CHANNEL_SLUG: ${{ needs.create-test-release.outputs.channel-slug }}
LICENSE_FIELDS: '[{"name":"expires_at","value": ""},{"name":"num_seats","value":"10"}]'
steps:
- uses: actions/checkout@v4
- name: Create cluster
id: create-cluster
uses: replicatedhq/replicated-actions/[email protected]
with:
api-token: ${{ secrets.C11Y_MATRIX_TOKEN }}
kubernetes-distribution: ${{ matrix.cluster.distribution }}
kubernetes-version: ${{ matrix.cluster.version }}
cluster-name: automated-${{ github.run_id }}-${{ matrix.cluster.distribution }}-${{ matrix.cluster.version }}
ttl: 2h
export-kubeconfig: true
- name: Install via Helm as standalone in integration mode
run: helm install replicated oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --set integration.licenseID=$LICENSE_ID --wait --timeout 2m
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
integration-enabled: 'true'
- name: Uninstall replicated via Helm
run: helm uninstall replicated --wait --timeout 2m
- name: Install via kubectl as standalone in integration mode
run: |
helm template replicated oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --set integration.licenseID=$LICENSE_ID | kubectl apply -f -
kubectl rollout status deployment replicated --timeout=2m
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
integration-enabled: 'true'
deployed-via-kubectl: 'true'
- name: Uninstall replicated via kubectl
run: |
helm template replicated oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --set integration.licenseID=$LICENSE_ID | kubectl delete -f -
kubectl wait --for=delete deployment/replicated --timeout=2m
- name: Login to registry
run: helm registry login registry.replicated.com --username $LICENSE_ID --password $LICENSE_ID
- name: Install via Helm as subchart in integration mode
run: helm install test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --wait --timeout 2m
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
integration-enabled: 'true'
- name: Uninstall test-chart via Helm
run: helm uninstall test-chart --wait --timeout 2m
- name: Install via kubectl as subchart in integration mode
run: |
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart | kubectl apply -f -
kubectl rollout status deployment test-chart --timeout=2m
kubectl rollout status deployment replicated --timeout=2m
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
integration-enabled: 'true'
deployed-via-kubectl: 'true'
- name: Uninstall test-chart via kubectl
run: |
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart | kubectl delete -f -
kubectl wait --for=delete deployment/test-chart --timeout=2m
kubectl wait --for=delete deployment/replicated --timeout=2m
# we have to explicitly disable integration mode here because we're using a "dev" license
- name: Install via Helm as subchart in production mode
run: helm install test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --wait --timeout 2m
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
integration-enabled: 'false'
- name: Upgrade via Helm as subchart in production mode to a new version
run: |
oldpodname=$(kubectl get pods -l app.kubernetes.io/name=replicated -o jsonpath='{.items[0].metadata.name}')
helm upgrade test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --set replicated.versionLabel=1.0.0 --wait --timeout 2m
COUNTER=1
while kubectl get pods -l app.kubernetes.io/name=replicated -o jsonpath='{.items[0].metadata.name}' | grep -q $oldpodname; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Pod did not restart after upgrade"
exit 1
fi
sleep 1
done
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
version-label: '1.0.0'
integration-enabled: 'false'
- name: Uninstall test-chart via Helm
run: helm uninstall test-chart --wait --timeout 2m
# we have to explicitly disable integration mode here because we're using a "dev" license
- name: Install via kubectl as subchart in production mode
run: |
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false | kubectl apply -f -
kubectl rollout status deployment test-chart --timeout=2m
kubectl rollout status deployment replicated --timeout=2m
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
integration-enabled: 'false'
deployed-via-kubectl: 'true'
- name: Upgrade via kubectl as subchart in production mode
run: |
oldpodname=$(kubectl get pods -l app.kubernetes.io/name=replicated -o jsonpath='{.items[0].metadata.name}')
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --set replicated.versionLabel=1.0.0 | kubectl apply -f -
kubectl rollout status deployment test-chart --timeout=2m
kubectl rollout status deployment replicated --timeout=2m
COUNTER=1
while kubectl get pods -l app.kubernetes.io/name=replicated -o jsonpath='{.items[0].metadata.name}' | grep -q $oldpodname; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Pod did not restart after upgrade"
exit 1
fi
sleep 1
done
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
integration-enabled: 'false'
version-label: '1.0.0'
deployed-via-kubectl: 'true'
- name: Uninstall test-chart via kubectl
run: |
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false | kubectl delete -f -
kubectl wait --for=delete deployment/test-chart --timeout=2m
kubectl wait --for=delete deployment/replicated --timeout=2m
# validate status informers
- name: Create empty status informers for validation
run: |
cat << EOF > test-values.yaml
replicated:
statusInformers: []
EOF
- name: Install via Helm as subchart in production mode and pass empty status informers
run: |
helm install test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false -f test-values.yaml --wait --timeout 2m
COUNTER=1
while ! kubectl logs deploy/replicated | grep -qv 'Generating status informers from Helm release'; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Did not receive empty status informers"
kubectl logs deploy/replicated
exit 1
fi
sleep 1
done
- name: Upgrade via Helm as subchart in production mode to use default status informers
run: |
helm upgrade test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --wait --timeout 2m
COUNTER=1
while ! kubectl logs deploy/replicated | grep -q 'Generating status informers from Helm release'; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Did not receive default status informers"
kubectl logs deploy/replicated
exit 1
fi
sleep 1
done
- name: Uninstall test-chart via Helm
run: helm uninstall test-chart --wait --timeout 2m
- name: Install via kubectl as subchart in production mode and pass empty status informers
run: |
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false -f test-values.yaml | kubectl apply -f -
kubectl rollout status deployment test-chart --timeout=2m
kubectl rollout status deployment replicated --timeout=2m
COUNTER=1
while ! kubectl logs deploy/replicated | grep -qv 'Generating status informers from Helm release'; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Did not receive empty status informers"
kubectl logs deploy/replicated
exit 1
fi
sleep 1
done
- name: Uninstall test-chart via kubectl
run: |
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false -f test-values.yaml | kubectl delete -f -
kubectl wait --for=delete deployment/test-chart --timeout=2m
kubectl wait --for=delete deployment/replicated --timeout=2m
# validate airgap
- name: Download support-bundle binary
run: |
RELEASE="$(
curl -sfL https://api.github.com/repos/replicatedhq/troubleshoot/releases/latest | \
grep '"tag_name":' | \
sed -E 's/.*"(v[^"]+)".*/\1/'
)"
curl -fsLO "https://github.com/replicatedhq/troubleshoot/releases/download/${RELEASE}/support-bundle_linux_amd64.tar.gz"
tar xzf support-bundle_linux_amd64.tar.gz
- name: Install via Helm as subchart in production airgap mode
run: |
helm install test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --set replicated.isAirgap=true --wait --timeout 2m
COUNTER=1
while ! kubectl get secret/replicated-instance-report; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Did not create replicated-instance-report secret"
exit 1
fi
sleep 1
done
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
integration-enabled: 'false'
is-airgap: 'true'
- name: Validate support bundle contents
run: |
./support-bundle --load-cluster-specs --interactive=false
tar xzf support-bundle-*.tar.gz
if ! ls support-bundle-*/secrets/*/replicated-instance-report/report.json; then
echo "Did not find replicated-instance-report in support bundle"
exit 1
fi
if ! ls support-bundle-*/secrets/*/replicated-custom-app-metrics-report/report.json; then
echo "Did not find replicated-custom-app-metrics-report in support bundle"
exit 1
fi
if ! ls support-bundle-*/replicated/logs/*/*.log; then
echo "Did not find replicated pod logs in support bundle"
exit 1
fi
if ! ls support-bundle-*/replicated-sdk/*/*/replicated-app-history-stdout.txt; then
echo "Did not find replicated-app-history-stdout.txt in support bundle"
exit 1
fi
if ! ls support-bundle-*/replicated-sdk/*/*/replicated-app-updates-stdout.txt; then
echo "Did not find replicated-app-updates-stdout.txt in support bundle"
exit 1
fi
if ! ls support-bundle-*/replicated-sdk/*/*/replicated-app-info-stdout.txt; then
echo "Did not find replicated-app-info-stdout.txt in support bundle"
exit 1
fi
if ! ls support-bundle-*/replicated-sdk/*/*/replicated-license-info-stdout.txt; then
echo "Did not find replicated-license-info-stdout.txt in support bundle"
exit 1
fi
rm -rf support-bundle-*
- name: Uninstall test-chart via Helm
run: |
helm uninstall test-chart --wait --timeout 2m
COUNTER=1
while kubectl get secret/replicated-instance-report; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Did not delete replicated-instance-report secret"
exit 1
fi
sleep 1
done
- name: Install via kubectl as subchart in production airgap mode
run: |
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --set replicated.isAirgap=true | kubectl apply -f -
kubectl rollout status deployment test-chart --timeout=2m
kubectl rollout status deployment replicated --timeout=2m
COUNTER=1
while ! kubectl get secret/replicated-instance-report; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Did not create replicated-instance-report secret"
exit 1
fi
sleep 1
done
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
integration-enabled: 'false'
deployed-via-kubectl: 'true'
is-airgap: 'true'
- name: Validate support bundle contents
run: |
./support-bundle --load-cluster-specs --interactive=false
tar xzf support-bundle-*.tar.gz
if ! ls support-bundle-*/secrets/*/replicated-instance-report/report.json; then
echo "Did not find replicated-instance-report in support bundle"
exit 1
fi
if ! ls support-bundle-*/secrets/*/replicated-custom-app-metrics-report/report.json; then
echo "Did not find replicated-custom-app-metrics-report in support bundle"
exit 1
fi
if ! ls support-bundle-*/replicated/logs/*/*.log; then
echo "Did not find replicated pod logs in support bundle"
exit 1
fi
if ! ls support-bundle-*/replicated-sdk/*/*/replicated-app-history-stdout.txt; then
echo "Did not find replicated-app-history-stdout.txt in support bundle"
exit 1
fi
if ! ls support-bundle-*/replicated-sdk/*/*/replicated-app-updates-stdout.txt; then
echo "Did not find replicated-app-updates-stdout.txt in support bundle"
exit 1
fi
if ! ls support-bundle-*/replicated-sdk/*/*/replicated-app-info-stdout.txt; then
echo "Did not find replicated-app-info-stdout.txt in support bundle"
exit 1
fi
if ! ls support-bundle-*/replicated-sdk/*/*/replicated-license-info-stdout.txt; then
echo "Did not find replicated-license-info-stdout.txt in support bundle"
exit 1
fi
rm -rf support-bundle-*
- name: Uninstall test-chart via kubectl
run: |
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --set replicated.isAirgap=true | kubectl delete -f -
kubectl wait --for=delete deployment/test-chart --timeout=2m
kubectl wait --for=delete deployment/replicated --timeout=2m
COUNTER=1
while kubectl get secret/replicated-instance-report; do
((COUNTER += 1))
if [ $COUNTER -gt 60 ]; then
echo "Did not delete replicated-instance-report secret"
exit 1
fi
sleep 1
done
- name: Remove Cluster
uses: replicatedhq/replicated-actions/[email protected]
if: ${{ success() || cancelled() }}
with:
api-token: ${{ secrets.C11Y_MATRIX_TOKEN }}
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}
cleanup-test-release:
runs-on: ubuntu-22.04
needs: [ create-test-release, validate-e2e ]
steps:
- name: Archive Customer
if: ${{ needs.create-test-release.outputs.customer-id != '' }}
uses: replicatedhq/replicated-actions/[email protected]
with:
api-token: ${{ secrets.C11Y_MATRIX_TOKEN }}
customer-id: ${{ needs.create-test-release.outputs.customer-id }}
- name: Archive Channel
if: ${{ needs.create-test-release.outputs.channel-slug != '' }}
uses: replicatedhq/replicated-actions/[email protected]
with:
app-slug: ${{ env.APP_SLUG }}
api-token: ${{ secrets.C11Y_MATRIX_TOKEN }}
channel-slug: ${{ needs.create-test-release.outputs.channel-slug }}