Skip to content

Commit 97249bb

Browse files
committed
don't install gwapi in target cluster
1 parent 5bd63bf commit 97249bb

File tree

4 files changed

+27
-29
lines changed

4 files changed

+27
-29
lines changed

.github/workflows/integration.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,10 @@ jobs:
336336
fail-fast: false
337337
matrix:
338338
cases:
339-
- {k8s: "v1.23", manage-controllers: false}
340-
- {k8s: "v1.34", manage-controllers: false}
341-
- {k8s: "v1.34", manage-controllers: true}
339+
- {k8s: "v1.23", manage-controllers: false, install-gwapi: true}
340+
# for v1.34 onwards, gwapi gets installed by Traefik on the target cluster
341+
- {k8s: "v1.34", manage-controllers: false, install-gwapi: false}
342+
- {k8s: "v1.34", manage-controllers: true, install-gwapi: false}
342343
name: "test-multicluster(${{ matrix.cases.k8s }}, ${{ matrix.cases.manage-controllers && 'managed-controllers' || 'unmanaged-controllers' }})"
343344
steps:
344345
- uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff
@@ -370,11 +371,20 @@ jobs:
370371
done
371372
- run: docker image ls
372373
- run: just mc-test-build
373-
- name: Run just mc-test-load
374+
- name: Run just mc-load
374375
run: |
375376
just linkerd-tag='${{ needs.meta.outputs.tag }}' \
376377
k3d-k8s='${{ matrix.cases.k8s }}' \
377-
mc-test-load
378+
mc-load
379+
- run: just mc-install-gwapi-source
380+
- name: Run just mc-target-load
381+
run: |
382+
just linkerd-tag='${{ needs.meta.outputs.tag }}' \
383+
k3d-k8s='${{ matrix.cases.k8s }}' \
384+
mc-target-load
385+
- run: just mc-install-gwapi-target
386+
if: ${{ matrix.cases.install-gwapi }}
387+
- run: just mc-flat-network-init
378388
- name: Run just mc-test-run
379389
run: |
380390
just linkerd-tag='${{ needs.meta.outputs.tag }}' \
@@ -426,12 +436,6 @@ jobs:
426436
echo 'needs.test-ext.result: ${{ needs.test-ext.result }}'
427437
echo 'needs.test-viz.result: ${{ needs.test-viz.result }}'
428438
echo 'needs.test-multicluster.result: ${{ needs.test-multicluster.result }}'
429-
echo "-------- SOURCE -----"
430-
kubectl --context k3d-l5d-test get po -A
431-
kubectl --context k3d-l5d-test -n linkerd-multicluster describe po
432-
echo "-------- TARGET -----"
433-
kubectl --context k3d-l5d-test-target get po -A
434-
kubectl --context k3d-l5d-test-target -n linkerd-multicluster describe po
435439
- name: Verify jobs
436440
# All jobs must succeed or be skipped.
437441
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')

justfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,9 @@ mc-target-k3d-delete:
490490
k3d-delete
491491
fi
492492

493-
_mc-load: _k3d-init linkerd-load
493+
mc-load: _k3d-init linkerd-load
494494

495-
_mc-target-load:
495+
mc-target-load:
496496
@{{ just_executable() }} \
497497
k3d-name='{{ k3d-name }}-target' \
498498
k3d-k8s='{{ k3d-k8s }}' \
@@ -505,17 +505,22 @@ _mc-target-load:
505505
linkerd-exec='{{ linkerd-exec }}' \
506506
linkerd-tag='{{ linkerd-tag }}' \
507507
_pause-load \
508-
_mc-load
508+
mc-load
509509

510-
# Run the multicluster tests with cluster setup
511-
mc-test: mc-test-load mc-test-run
510+
mc-install-gwapi-source: _mc-install-gwapi
511+
512+
mc-install-gwapi-target:
513+
@{{ just_executable() }} \
514+
k3d-name='{{ k3d-name }}-target' \
515+
_mc-install-gwapi
516+
517+
_mc-install-gwapi:
518+
{{ _kubectl }} apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/experimental-install.yaml
512519

513520
mc-test-build:
514521
go build --mod=readonly \
515522
./test/integration/multicluster/...
516523

517-
mc-test-load: _mc-load _mc-target-load mc-flat-network-init
518-
519524
k3d-source-server := "k3d-" + k3d-name + "-server-0"
520525
k3d-target-server := "k3d-" + k3d-name + "-target-server-0"
521526

test/integration/multicluster/install_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,6 @@ func TestInstall(t *testing.T) {
9494
// Global state to keep track of clusters
9595
contexts = TestHelper.GetMulticlusterContexts()
9696
for _, ctx := range contexts {
97-
err = TestHelper.InstallGatewayAPIWithContext(ctx)
98-
if err != nil {
99-
testutil.AnnotatedFatal(t, "failed to install gateway-api", err)
100-
}
101-
10297
// Pipe cmd & args to `linkerd`
10398
cmd := append([]string{"--context=" + ctx}, cmd...)
10499
out, err := TestHelper.LinkerdRun(cmd...)

testutil/test_helper.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -749,12 +749,6 @@ func (h *TestHelper) InstallGatewayAPI() error {
749749
return err
750750
}
751751

752-
func (h *TestHelper) InstallGatewayAPIWithContext(ctx string) error {
753-
url := fmt.Sprintf("https://github.com/kubernetes-sigs/gateway-api/releases/download/%s/experimental-install.yaml", GATEWAY_API_VERSION)
754-
_, err := h.KubectlWithContext("", ctx, "apply", "-f", url)
755-
return err
756-
}
757-
758752
// ReadFile reads a file from disk and returns the contents as a string.
759753
func ReadFile(file string) (string, error) {
760754
b, err := os.ReadFile(file)

0 commit comments

Comments
 (0)