From 96cbb8792031d5093495eb0e0e5dd0622ed4ef3b Mon Sep 17 00:00:00 2001 From: Andrew Roskuski Date: Tue, 6 Feb 2024 16:36:42 -0500 Subject: [PATCH] update software used in build (#703) * update software used in build * update test for newer k8s * update test for new k8s * add version notes --- .github/workflows/github-actions-build.yml | 16 ++++++++-------- terratest/src/test/pega/pega-tier-pdb_test.go | 18 ++++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index 59206e93b..64bb19ea0 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -2,9 +2,9 @@ name: Pega Chart Build env: HELM_URL: https://get.helm.sh - HELM_TGZ: helm-v3.6.3-linux-amd64.tar.gz - YAMLLINT_VERSION: 1.15.0 - GO_VERSION: 1.18.3 + HELM_TGZ: helm-v3.11.3-linux-amd64.tar.gz + YAMLLINT_VERSION: 1.34.0 + GO_VERSION: 1.21.6 on: @@ -23,7 +23,7 @@ concurrency: jobs: run-supplemental-validation-job: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Check out repository code uses: actions/checkout@v3 @@ -31,7 +31,7 @@ jobs: run : | sh validate_supplementals.sh run-lint-job: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Check out repository code uses: actions/checkout@v3 @@ -72,7 +72,7 @@ jobs: sh validatexml.sh run-remark-job: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Check out repository code uses: actions/checkout@v3 @@ -91,7 +91,7 @@ jobs: remark -i .remark_ignore -f -u validate-links . run-go-tests-job: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Check out repository code uses: actions/checkout@v3 @@ -144,7 +144,7 @@ jobs: go test ./backingservices | grep "FAIL" -A 8 || true ; test ${PIPESTATUS[0]} -eq 0 run-deploy-job: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: [run-lint-job, run-remark-job, run-go-tests-job] if: ( github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') ) && success() steps: diff --git a/terratest/src/test/pega/pega-tier-pdb_test.go b/terratest/src/test/pega/pega-tier-pdb_test.go index 0997267ce..3b25f4cee 100644 --- a/terratest/src/test/pega/pega-tier-pdb_test.go +++ b/terratest/src/test/pega/pega-tier-pdb_test.go @@ -11,6 +11,10 @@ import ( "k8s.io/api/policy/v1beta1" ) +// Leaving the k8s.io import at v1beta1 for now because it doesn't impact the test and upgrading seems like it would probably require going +// through all the Go dependencies. If this test starts failing in the future due to new features not being supported, we should probably +// actually go through and do the upgrade + // TestPegaTierPDBEnabled - verify that a PodDisruptionBudget is created when global.tier.pdb.enabled=true func TestPegaTierPDBEnabled(t *testing.T) { var supportedVendors = []string{"k8s", "openshift", "eks", "gke", "aks", "pks"} @@ -44,19 +48,19 @@ func TestPegaTierPDBEnabled(t *testing.T) { { name: getObjName(options, "-web-pdb"), kind: "PodDisruptionBudget", - apiversion: "policy/v1beta1", + apiversion: "policy/v1", minAvailable: 1, }, { name: getObjName(options, "-batch-pdb"), kind: "PodDisruptionBudget", - apiversion: "policy/v1beta1", + apiversion: "policy/v1", minAvailable: 1, }, { name: getObjName(options, "-stream-pdb"), kind: "PodDisruptionBudget", - apiversion: "policy/v1beta1", + apiversion: "policy/v1", minAvailable: 1, }, }) @@ -100,21 +104,21 @@ func TestPegaTierPDBWithCustomLabels(t *testing.T) { { name: getObjName(options, "-web-pdb"), kind: "PodDisruptionBudget", - apiversion: "policy/v1beta1", + apiversion: "policy/v1", labels: webPDBLabels, minAvailable: 1, }, { name: getObjName(options, "-batch-pdb"), kind: "PodDisruptionBudget", - apiversion: "policy/v1beta1", + apiversion: "policy/v1", labels: batchPDBLabels, minAvailable: 1, }, { name: getObjName(options, "-stream-pdb"), kind: "PodDisruptionBudget", - apiversion: "policy/v1beta1", + apiversion: "policy/v1", minAvailable: 1, }, }) @@ -175,8 +179,6 @@ func verifyPegaPDBs(t *testing.T, yamlContent string, options *helm.Options, exp // verifyPegaPdb - Performs Pega PDB assertions with the values as provided func verifyPegaPdb(t *testing.T, pegaPdbObj *v1beta1.PodDisruptionBudget, expectedPdb pdb) { require.Equal(t, pegaPdbObj.TypeMeta.Kind, expectedPdb.kind) - //if the below fails it means that the helm version used in testing is compiled against - //kubernetes 1.21 or higher, and we should adjust this test to use the policy/v1 API version require.Equal(t, pegaPdbObj.TypeMeta.APIVersion, expectedPdb.apiversion) require.Equal(t, expectedPdb.minAvailable, pegaPdbObj.Spec.MinAvailable.IntVal)