Skip to content

Commit

Permalink
fix: ssa e2e tests failing after updating to kubectl 1.26 (#11753)
Browse files Browse the repository at this point in the history
* fix: ssa e2e test failing after updating to kubectl 1.26

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Remove pinned kubectl version

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Cleaner approach to fix e2e test

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
  • Loading branch information
leoluz authored and crenshaw-dev committed Dec 20, 2022
1 parent ea15d38 commit f479187
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,6 @@ jobs:
- name: GH actions workaround - Kill XSP4 process
run: |
sudo pkill mono || true
# ubuntu-22.04 comes with kubectl, but the version is not pinned. The version as of 2022-12-05 is 1.26.0 which
# breaks the `TestNamespacedResourceDiffing` e2e test. So we'll pin to 1.25 and then fix the underlying issue.
- name: Install kubectl
run: |
rm /usr/local/bin/kubectl
curl -LO https://dl.k8s.io/release/v1.25.4/bin/linux/amd64/kubectl
mv kubectl /usr/local/bin/kubectl
chmod +x /usr/local/bin/kubectl
- name: Install K3S
env:
INSTALL_K3S_VERSION: ${{ matrix.k3s-version }}+k3s1
Expand Down
11 changes: 11 additions & 0 deletions test/e2e/app_management_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,17 @@ func TestResourceDiffing(t *testing.T) {
}).
Given().
When().
// Now we migrate from client-side apply to server-side apply
// This is necessary, as starting with kubectl 1.26, all previously
// client-side owned fields have ownership migrated to the manager from
// the first ssa.
// More details: https://github.com/kubernetes/kubectl/issues/1337
PatchApp(`[{
"op": "add",
"path": "/spec/syncPolicy",
"value": { "syncOptions": ["ServerSideApply=true"] }
}]`).
Sync().
And(func() {
output, err := RunWithStdin(testdata.SSARevisionHistoryDeployment, "", "kubectl", "apply", "-n", DeploymentNamespace(), "--server-side=true", "--field-manager=revision-history-manager", "--validate=false", "--force-conflicts", "-f", "-")
assert.NoError(t, err)
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/testdata/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ import _ "embed"
var (
//go:embed ssa-revision-history/deployment.yaml
SSARevisionHistoryDeployment string

//go:embed guestbook/guestbook-ui-deployment.yaml
GuestbookDeployment string
)

0 comments on commit f479187

Please sign in to comment.