diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 9a7915bc2..8edb6b6b2 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -17,6 +17,7 @@ runs: uses: actions/setup-go@v4 with: go-version: 1.21.4 + cache: false - name: Disable default go problem matcher run: echo "::remove-matcher owner=go::" diff --git a/.github/workflows/pre-main.yaml b/.github/workflows/pre-main.yaml index ea06fc86d..fb41f596e 100644 --- a/.github/workflows/pre-main.yaml +++ b/.github/workflows/pre-main.yaml @@ -451,7 +451,7 @@ jobs: run: | curl -X POST --data "{ \"text\": \"🚨⚠️ Failed to create \`unstable\` container image from commit \<$GITHUB_REPO/commit/$COMMIT_SHA|$COMMIT_SHA\>, job ID \<$GITHUB_REPO/actions/runs/$JOB_RUN_ID/attempts/$JOB_RUN_ATTEMPT|$JOB_RUN_ID\> \" - }" -H 'Content-type: application/json; charset=UTF-8' ${{ secrets.GCHAT_WEBHOOK_URL }} + }" -H 'Content-type: application/json; charset=UTF-8' '${{ secrets.GCHAT_WEBHOOK_URL }}' # Push the new unstable TNF image to Quay.io. - name: (if on main and upstream) Authenticate against Quay.io diff --git a/.github/workflows/qe-hosted.yml b/.github/workflows/qe-hosted.yml index 833d8e910..ae00fbdc4 100644 --- a/.github/workflows/qe-hosted.yml +++ b/.github/workflows/qe-hosted.yml @@ -1,8 +1,8 @@ name: QE Testing (Ubuntu-hosted) on: - # pull_request: - # branches: [ main ] + pull_request: + branches: [ main ] workflow_dispatch: # Schedule a daily cron at midnight UTC schedule: @@ -26,6 +26,7 @@ jobs: TEST_TNF_IMAGE_NAME: quay.io/testnetworkfunction/cnf-certification-test TEST_TNF_IMAGE_TAG: localtest DOCKER_CONFIG_DIR: '/home/runner/.docker/' + SKIP_PRELOAD_IMAGES: true steps: - name: Free Disk Space (Ubuntu) @@ -40,20 +41,6 @@ jobs: swap-storage: true continue-on-error: true - - name: Write temporary docker file - run: | - mkdir -p /home/runner/.docker - touch ${PFLT_DOCKERCONFIG} - echo '{ "auths": {} }' >> ${PFLT_DOCKERCONFIG} - - - name: Set up Go 1.21 - uses: actions/setup-go@v4 - with: - go-version: 1.21.4 - - - name: Disable default go problem matcher - run: echo "::remove-matcher owner=go::" - - name: Check out code uses: actions/checkout@v4 with: @@ -103,10 +90,12 @@ jobs: repository: ${{ env.QE_REPO }} path: cnfcert-tests-verification - # Setup is complete. Time to run the QE tests. - name: Run the tests - run: FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=true ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true make test-features - working-directory: cnfcert-tests-verification + uses: nick-fields/retry@v2 + with: + timeout_minutes: 60 + max_attempts: 3 + command: cd ${GITHUB_WORKSPACE}/cnfcert-tests-verification; FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=true ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true make test-features - name: (if on main and upstream) Send chat msg to dev team if failed to run QE tests if: ${{ failure() && github.ref == 'refs/heads/main' && github.repository_owner == 'test-network-function' }} @@ -118,4 +107,4 @@ jobs: run: | curl -X POST --data "{ \"text\": \"🚨⚠️ Failed to run Github hosted QE tests from commit \<$GITHUB_REPO/commit/$COMMIT_SHA|$COMMIT_SHA\>, job ID \<$GITHUB_REPO/actions/runs/$JOB_RUN_ID/attempts/$JOB_RUN_ATTEMPT|$JOB_RUN_ID\> \" - }" -H 'Content-type: application/json; charset=UTF-8' ${{ secrets.QE_NIGHTLY_WEBHOOK }} + }" -H 'Content-type: application/json; charset=UTF-8' '${{ secrets.QE_NIGHTLY_WEBHOOK }}' diff --git a/.github/workflows/qe-ocp-413-intrusive.yaml b/.github/workflows/qe-ocp-413-intrusive.yaml index bee1a95c6..f6187b0a7 100644 --- a/.github/workflows/qe-ocp-413-intrusive.yaml +++ b/.github/workflows/qe-ocp-413-intrusive.yaml @@ -62,10 +62,12 @@ jobs: sudo rm -rf /tmp/tnf_config/ sudo rm -rf /tmp/tnf_report/ - # Setup is complete. Time to run the QE tests. - name: Run the tests - run: FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=false ENABLE_PARALLEL=false ENABLE_FLAKY_RETRY=true make test-features - working-directory: cnfcert-tests-verification + uses: nick-fields/retry@v2 + with: + timeout_minutes: 60 + max_attempts: 3 + command: cd ${GITHUB_WORKSPACE}/cnfcert-tests-verification; FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=false ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true make test-features - name: (if on main and upstream) Send chat msg to dev team if failed to run QE tests if: ${{ failure() && github.ref == 'refs/heads/main' && github.repository_owner == 'test-network-function' }} @@ -77,4 +79,4 @@ jobs: run: | curl -X POST --data "{ \"text\": \"🚨⚠️ Failed to run intrusive OCP 4.13 QE tests from commit \<$GITHUB_REPO/commit/$COMMIT_SHA|$COMMIT_SHA\>, job ID \<$GITHUB_REPO/actions/runs/$JOB_RUN_ID/attempts/$JOB_RUN_ATTEMPT|$JOB_RUN_ID\> \" - }" -H 'Content-type: application/json; charset=UTF-8' ${{ secrets.QE_NIGHTLY_WEBHOOK }} + }" -H 'Content-type: application/json; charset=UTF-8' '${{ secrets.QE_NIGHTLY_WEBHOOK }}' diff --git a/.github/workflows/qe-ocp-413.yaml b/.github/workflows/qe-ocp-413.yaml index 152b186b9..09c3e8266 100644 --- a/.github/workflows/qe-ocp-413.yaml +++ b/.github/workflows/qe-ocp-413.yaml @@ -61,10 +61,12 @@ jobs: sudo rm -rf /tmp/tnf_config/ sudo rm -rf /tmp/tnf_report/ - # Setup is complete. Time to run the QE tests. - name: Run the tests - run: FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=true ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true make test-features - working-directory: cnfcert-tests-verification + uses: nick-fields/retry@v2 + with: + timeout_minutes: 60 + max_attempts: 3 + command: cd ${GITHUB_WORKSPACE}/cnfcert-tests-verification; FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=true ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true make test-features - name: (if on main and upstream) Send chat msg to dev team if failed to run QE tests if: ${{ failure() && github.ref == 'refs/heads/main' && github.repository_owner == 'test-network-function' }} @@ -76,4 +78,4 @@ jobs: run: | curl -X POST --data "{ \"text\": \"🚨⚠️ Failed to run non-intrusive OCP 4.13 QE tests from commit \<$GITHUB_REPO/commit/$COMMIT_SHA|$COMMIT_SHA\>, job ID \<$GITHUB_REPO/actions/runs/$JOB_RUN_ID/attempts/$JOB_RUN_ATTEMPT|$JOB_RUN_ID\> \" - }" -H 'Content-type: application/json; charset=UTF-8' ${{ secrets.QE_NIGHTLY_WEBHOOK }} + }" -H 'Content-type: application/json; charset=UTF-8' '${{ secrets.QE_NIGHTLY_WEBHOOK }}' diff --git a/.github/workflows/qe-ocp-414-intrusive.yaml b/.github/workflows/qe-ocp-414-intrusive.yaml index 22e340a9a..6a87d0f1b 100644 --- a/.github/workflows/qe-ocp-414-intrusive.yaml +++ b/.github/workflows/qe-ocp-414-intrusive.yaml @@ -62,10 +62,12 @@ jobs: sudo rm -rf /tmp/tnf_config/ sudo rm -rf /tmp/tnf_report/ - # Setup is complete. Time to run the QE tests. - name: Run the tests - run: FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=false ENABLE_PARALLEL=false ENABLE_FLAKY_RETRY=true make test-features - working-directory: cnfcert-tests-verification + uses: nick-fields/retry@v2 + with: + timeout_minutes: 60 + max_attempts: 3 + command: cd ${GITHUB_WORKSPACE}/cnfcert-tests-verification; FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=false ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true make test-features - name: (if on main and upstream) Send chat msg to dev team if failed to run QE tests if: ${{ failure() && github.ref == 'refs/heads/main' && github.repository_owner == 'test-network-function' }} @@ -77,4 +79,4 @@ jobs: run: | curl -X POST --data "{ \"text\": \"🚨⚠️ Failed to run intrusive OCP 4.14 QE tests from commit \<$GITHUB_REPO/commit/$COMMIT_SHA|$COMMIT_SHA\>, job ID \<$GITHUB_REPO/actions/runs/$JOB_RUN_ID/attempts/$JOB_RUN_ATTEMPT|$JOB_RUN_ID\> \" - }" -H 'Content-type: application/json; charset=UTF-8' ${{ secrets.QE_NIGHTLY_WEBHOOK }} + }" -H 'Content-type: application/json; charset=UTF-8' '${{ secrets.QE_NIGHTLY_WEBHOOK }}' diff --git a/.github/workflows/qe-ocp-414.yaml b/.github/workflows/qe-ocp-414.yaml index eed2acbba..2b0da85a6 100644 --- a/.github/workflows/qe-ocp-414.yaml +++ b/.github/workflows/qe-ocp-414.yaml @@ -61,10 +61,12 @@ jobs: sudo rm -rf /tmp/tnf_config/ sudo rm -rf /tmp/tnf_report/ - # Setup is complete. Time to run the QE tests. - name: Run the tests - run: FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=true ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true make test-features - working-directory: cnfcert-tests-verification + uses: nick-fields/retry@v2 + with: + timeout_minutes: 60 + max_attempts: 3 + command: cd ${GITHUB_WORKSPACE}/cnfcert-tests-verification; FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=true ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true make test-features - name: (if on main and upstream) Send chat msg to dev team if failed to run QE tests if: ${{ failure() && github.ref == 'refs/heads/main' && github.repository_owner == 'test-network-function' }} @@ -76,4 +78,4 @@ jobs: run: | curl -X POST --data "{ \"text\": \"🚨⚠️ Failed to run non-intrusive OCP 4.14 QE tests from commit \<$GITHUB_REPO/commit/$COMMIT_SHA|$COMMIT_SHA\>, job ID \<$GITHUB_REPO/actions/runs/$JOB_RUN_ID/attempts/$JOB_RUN_ATTEMPT|$JOB_RUN_ID\> \" - }" -H 'Content-type: application/json; charset=UTF-8' ${{ secrets.QE_NIGHTLY_WEBHOOK }} + }" -H 'Content-type: application/json; charset=UTF-8' '${{ secrets.QE_NIGHTLY_WEBHOOK }}' diff --git a/.github/workflows/qe.yaml b/.github/workflows/qe.yaml index 1b46c4a87..094a40e6a 100644 --- a/.github/workflows/qe.yaml +++ b/.github/workflows/qe.yaml @@ -10,8 +10,6 @@ on: env: QE_REPO: test-network-function/cnfcert-tests-verification - - jobs: qe-testing: runs-on: qe-runner @@ -105,10 +103,12 @@ jobs: run: ./scripts/delete-namespaces.sh working-directory: cnfcert-tests-verification - # Setup is complete. Time to run the QE tests. - name: Run the tests - run: FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=true ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true make test-features - working-directory: cnfcert-tests-verification + uses: nick-fields/retry@v2 + with: + timeout_minutes: 60 + max_attempts: 3 + command: cd ${GITHUB_WORKSPACE}/cnfcert-tests-verification; FEATURES=${{matrix.suite}} TNF_REPO_PATH=${GITHUB_WORKSPACE} TNF_IMAGE=${{env.TEST_TNF_IMAGE_NAME}} TNF_IMAGE_TAG=${{env.TEST_TNF_IMAGE_TAG}} DISABLE_INTRUSIVE_TESTS=true ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true make test-features - name: (if on main and upstream) Send chat msg to dev team if failed to run QE tests if: ${{ failure() && github.ref == 'refs/heads/main' && github.repository_owner == 'test-network-function' }} @@ -120,4 +120,4 @@ jobs: run: | curl -X POST --data "{ \"text\": \"🚨⚠️ Failed to run Kind-based non-intrusive QE tests from commit \<$GITHUB_REPO/commit/$COMMIT_SHA|$COMMIT_SHA\>, job ID \<$GITHUB_REPO/actions/runs/$JOB_RUN_ID/attempts/$JOB_RUN_ATTEMPT|$JOB_RUN_ID\> \" - }" -H 'Content-type: application/json; charset=UTF-8' ${{ secrets.QE_NIGHTLY_WEBHOOK }} + }" -H 'Content-type: application/json; charset=UTF-8' '${{ secrets.QE_NIGHTLY_WEBHOOK }}' diff --git a/.github/workflows/tnf-image.yaml b/.github/workflows/tnf-image.yaml index 58c32979c..9c972e033 100644 --- a/.github/workflows/tnf-image.yaml +++ b/.github/workflows/tnf-image.yaml @@ -144,4 +144,4 @@ jobs: run: | curl -X POST --data "{ \"text\": \"🚨⚠️ Failed to create container image version \`$TNF_VERSION\` from commit \<$GITHUB_REPO/commit/$COMMIT_SHA|$COMMIT_SHA\>, job ID \<$GITHUB_REPO/actions/runs/$JOB_RUN_ID/attempts/$JOB_RUN_ATTEMPT|$JOB_RUN_ID\> \" - }" -H 'Content-type: application/json; charset=UTF-8' ${{ secrets.GCHAT_WEBHOOK_URL }} + }" -H 'Content-type: application/json; charset=UTF-8' '${{ secrets.GCHAT_WEBHOOK_URL }}' diff --git a/Dockerfile b/Dockerfile index a34ad2809..b3e25e058 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/ubi:8.8-1067.1698056881 AS build +FROM registry.access.redhat.com/ubi8/ubi:8.9-1028 AS build ENV TNF_DIR=/usr/tnf ENV \ TNF_SRC_DIR=${TNF_DIR}/tnf-src \ @@ -99,7 +99,7 @@ FROM quay.io/testnetworkfunction/oct:latest AS db # Copy the state into a new flattened image to reduce size. # TODO run as non-root -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8-1072.1697626218 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9-1029 ENV \ TNF_DIR=/usr/tnf \ diff --git a/cnf-certification-test/platform/operatingsystem/files/rhcos_version_map b/cnf-certification-test/platform/operatingsystem/files/rhcos_version_map index 61db0b362..2a777aa7c 100644 --- a/cnf-certification-test/platform/operatingsystem/files/rhcos_version_map +++ b/cnf-certification-test/platform/operatingsystem/files/rhcos_version_map @@ -189,6 +189,7 @@ 4.12.41 / 412.86.202310210217-0 4.12.42 / 412.86.202310302215-0 4.12.43 / 412.86.202311051457-0 +4.12.44 / 412.86.202311092041-0 4.12.5 / 412.86.202302170236-0 4.12.6 / 412.86.202302282003-0 4.12.7 / 412.86.202303011010-0 @@ -220,6 +221,8 @@ 4.13.19 / 413.92.202310210500-0 4.13.2 / 413.92.202305302312-0 4.13.21 / 413.92.202310210500-0 +4.13.22 / 413.92.202311061658-0 +4.13.23 / 413.92.202311151359-0 4.13.3 / 413.92.202306070210-0 4.13.4 / 413.92.202306141213-0 4.13.5 / 413.92.202307140015-0 @@ -243,6 +246,7 @@ 4.14.0-rc.7 / 414.92.202310210434-0 4.14.1 / 414.92.202310270216-0 4.14.2 / 414.92.202311061957-0 +4.14.3 / 414.92.202311150705-0 4.4.0 / 44.81.202004260825-0 4.4.0-rc.0 / 44.81.202003110830-0 4.4.0-rc.1 / 44.81.202003130330-0 diff --git a/go.mod b/go.mod index cdc7af259..0aa4b02ce 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect ) -require k8s.io/client-go v0.28.3 +require k8s.io/client-go v0.28.4 require ( github.com/kelseyhightower/envconfig v1.4.0 @@ -24,8 +24,8 @@ require ( github.com/operator-framework/operator-lifecycle-manager v0.20.0 github.com/pkg/errors v0.9.1 // indirect helm.sh/helm/v3 v3.13.2 - k8s.io/api v0.28.3 - k8s.io/apimachinery v0.28.3 + k8s.io/api v0.28.4 + k8s.io/apimachinery v0.28.4 k8s.io/klog/v2 v2.100.1 // indirect ) @@ -182,8 +182,8 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect k8s.io/apiserver v0.28.3 // indirect - k8s.io/cli-runtime v0.28.3 // indirect - k8s.io/component-base v0.28.3 // indirect + k8s.io/cli-runtime v0.28.4 // indirect + k8s.io/component-base v0.28.4 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect modernc.org/libc v1.22.5 // indirect @@ -216,11 +216,11 @@ require ( github.com/openshift/machine-config-operator v0.0.1-0.20230515070935-49f32d46538e github.com/redhat-openshift-ecosystem/openshift-preflight v0.0.0-20231018165107-f04b78186455 github.com/robert-nix/ansihtml v1.0.1 - github.com/test-network-function/oct v0.0.3 + github.com/test-network-function/oct v0.0.4 github.com/test-network-function/privileged-daemonset v1.0.15 gopkg.in/yaml.v3 v3.0.1 gotest.tools/v3 v3.5.1 - k8s.io/kubectl v0.28.3 + k8s.io/kubectl v0.28.4 ) replace github.com/redhat-openshift-ecosystem/openshift-preflight => github.com/redhat-openshift-ecosystem/openshift-preflight v0.0.0-20231018165107-f04b78186455 diff --git a/go.sum b/go.sum index daf7ab9c5..e1d2d9d37 100644 --- a/go.sum +++ b/go.sum @@ -573,8 +573,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/test-network-function/oct v0.0.3 h1:jcVf+LVhN7FhKXjSqNUG1hsH6FrNwD9I/i6xowEZhB4= -github.com/test-network-function/oct v0.0.3/go.mod h1:Sz+lcJPXHge6VVs7bPtz9s0q8wcrMeQ4WA2PUGCyeok= +github.com/test-network-function/oct v0.0.4 h1:rU4kps/gbAHkR0rc5WzVtTOcJt/NBcse85RaG7WTuYw= +github.com/test-network-function/oct v0.0.4/go.mod h1:oOPuUMnX6YR+cl3usBJfwCllsv7Hphw9jVi7VtniAzo= github.com/test-network-function/privileged-daemonset v1.0.15 h1:Jgjf3sa4d9OuhZRTj3oLhaaGV7PtQLVeLK/LSd9YgdE= github.com/test-network-function/privileged-daemonset v1.0.15/go.mod h1:rDiFimleKbW2E501cNgHMYCrR52+w5Sg0a6trF2HZTo= github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8= @@ -1012,26 +1012,26 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.28.3 h1:Gj1HtbSdB4P08C8rs9AR94MfSGpRhJgsS+GF9V26xMM= -k8s.io/api v0.28.3/go.mod h1:MRCV/jr1dW87/qJnZ57U5Pak65LGmQVkKTzf3AtKFHc= +k8s.io/api v0.28.4 h1:8ZBrLjwosLl/NYgv1P7EQLqoO8MGQApnbgH8tu3BMzY= +k8s.io/api v0.28.4/go.mod h1:axWTGrY88s/5YE+JSt4uUi6NMM+gur1en2REMR7IRj0= k8s.io/apiextensions-apiserver v0.28.3 h1:Od7DEnhXHnHPZG+W9I97/fSQkVpVPQx2diy+2EtmY08= k8s.io/apiextensions-apiserver v0.28.3/go.mod h1:NE1XJZ4On0hS11aWWJUTNkmVB03j9LM7gJSisbRt8Lc= -k8s.io/apimachinery v0.28.3 h1:B1wYx8txOaCQG0HmYF6nbpU8dg6HvA06x5tEffvOe7A= -k8s.io/apimachinery v0.28.3/go.mod h1:uQTKmIqs+rAYaq+DFaoD2X7pcjLOqbQX2AOiO0nIpb8= +k8s.io/apimachinery v0.28.4 h1:zOSJe1mc+GxuMnFzD4Z/U1wst50X28ZNsn5bhgIIao8= +k8s.io/apimachinery v0.28.4/go.mod h1:wI37ncBvfAoswfq626yPTe6Bz1c22L7uaJ8dho83mgg= k8s.io/apiserver v0.28.3 h1:8Ov47O1cMyeDzTXz0rwcfIIGAP/dP7L8rWbEljRcg5w= k8s.io/apiserver v0.28.3/go.mod h1:YIpM+9wngNAv8Ctt0rHG4vQuX/I5rvkEMtZtsxW2rNM= -k8s.io/cli-runtime v0.28.3 h1:lvuJYVkwCqHEvpS6KuTZsUVwPePFjBfSGvuaLl2SxzA= -k8s.io/cli-runtime v0.28.3/go.mod h1:jeX37ZPjIcENVuXDDTskG3+FnVuZms5D9omDXS/2Jjc= -k8s.io/client-go v0.28.3 h1:2OqNb72ZuTZPKCl+4gTKvqao0AMOl9f3o2ijbAj3LI4= -k8s.io/client-go v0.28.3/go.mod h1:LTykbBp9gsA7SwqirlCXBWtK0guzfhpoW4qSm7i9dxo= -k8s.io/component-base v0.28.3 h1:rDy68eHKxq/80RiMb2Ld/tbH8uAE75JdCqJyi6lXMzI= -k8s.io/component-base v0.28.3/go.mod h1:fDJ6vpVNSk6cRo5wmDa6eKIG7UlIQkaFmZN2fYgIUD8= +k8s.io/cli-runtime v0.28.4 h1:IW3aqSNFXiGDllJF4KVYM90YX4cXPGxuCxCVqCD8X+Q= +k8s.io/cli-runtime v0.28.4/go.mod h1:MLGRB7LWTIYyYR3d/DOgtUC8ihsAPA3P8K8FDNIqJ0k= +k8s.io/client-go v0.28.4 h1:Np5ocjlZcTrkyRJ3+T3PkXDpe4UpatQxj85+xjaD2wY= +k8s.io/client-go v0.28.4/go.mod h1:0VDZFpgoZfelyP5Wqu0/r/TRYcLYuJ2U1KEeoaPa1N4= +k8s.io/component-base v0.28.4 h1:c/iQLWPdUgI90O+T9TeECg8o7N3YJTiuz2sKxILYcYo= +k8s.io/component-base v0.28.4/go.mod h1:m9hR0uvqXDybiGL2nf/3Lf0MerAfQXzkfWhUY58JUbU= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= -k8s.io/kubectl v0.28.3 h1:H1Peu1O3EbN9zHkJCcvhiJ4NUj6lb88sGPO5wrWIM6k= -k8s.io/kubectl v0.28.3/go.mod h1:RDAudrth/2wQ3Sg46fbKKl4/g+XImzvbsSRZdP2RiyE= +k8s.io/kubectl v0.28.4 h1:gWpUXW/T7aFne+rchYeHkyB8eVDl5UZce8G4X//kjUQ= +k8s.io/kubectl v0.28.4/go.mod h1:CKOccVx3l+3MmDbkXtIUtibq93nN2hkDR99XDCn7c/c= k8s.io/utils v0.0.0-20230505201702-9f6742963106 h1:EObNQ3TW2D+WptiYXlApGNLVy0zm/JIBVY9i+M4wpAU= k8s.io/utils v0.0.0-20230505201702-9f6742963106/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE= diff --git a/pkg/provider/isolation.go b/pkg/provider/isolation.go index e14bdb3e8..b47760a00 100644 --- a/pkg/provider/isolation.go +++ b/pkg/provider/isolation.go @@ -58,21 +58,20 @@ func AreCPUResourcesWholeUnits(p *Pod) bool { // Pods may contain more than one container. All containers must conform to the CPU isolation requirements. for _, cut := range p.Containers { // Resources must be specified - if len(cut.Resources.Requests) == 0 || len(cut.Resources.Limits) == 0 { + cpuRequestsMillis := cut.Resources.Requests.Cpu().MilliValue() + cpuLimitsMillis := cut.Resources.Limits.Cpu().MilliValue() + + if cpuRequestsMillis == 0 || cpuLimitsMillis == 0 { logrus.Debugf("%s has been found with undefined requests or limits.", cut.String()) return false } - // Gather the values - cpuRequests := cut.Resources.Requests.Cpu().MilliValue() - cpuLimits := cut.Resources.Limits.Cpu().MilliValue() - - if !isInteger(cpuRequests) { - logrus.Debugf("%s has CPU requests %d (milli) that has to be a whole unit.", cut.String(), cpuRequests) + if !isInteger(cpuRequestsMillis) { + logrus.Debugf("%s has CPU requests %d (milli) that has to be a whole unit.", cut.String(), cpuRequestsMillis) return false } - if !isInteger(cpuLimits) { - logrus.Debugf("%s has CPU limits %d (milli) that has to be a whole unit.", cut.String(), cpuLimits) + if !isInteger(cpuLimitsMillis) { + logrus.Debugf("%s has CPU limits %d (milli) that has to be a whole unit.", cut.String(), cpuLimitsMillis) return false } } diff --git a/pkg/provider/isolation_test.go b/pkg/provider/isolation_test.go index 91b79ac6f..ffd4bba33 100644 --- a/pkg/provider/isolation_test.go +++ b/pkg/provider/isolation_test.go @@ -218,6 +218,39 @@ func TestCPUIsolation(t *testing.T) { runtimeClassNameResult: true, loadBalancingResult: false, }, + { // Test Case #6 - Mem reqs/limit set, but no Cpu limits/reqs set. + testPod: &Pod{ + Containers: []*Container{ + { + Container: &corev1.Container{ + Resources: corev1.ResourceRequirements{ + Requests: corev1.ResourceList{ + "memory": resource.MustParse(validMemLimit), + }, + Limits: corev1.ResourceList{ + "memory": resource.MustParse(validMemLimit), + }, + }, + }, + }, + }, + Pod: &corev1.Pod{ + Spec: corev1.PodSpec{ + RuntimeClassName: &testClassName, + }, + ObjectMeta: metav1.ObjectMeta{ + Annotations: map[string]string{ + "cpu-load-balancing.crio.io": "disable", + "irq-load-balancing.crio.io": "disable", + }, + }, + }, + }, + resourcesIdenticalResult: true, + wholeUnitsResult: false, + runtimeClassNameResult: true, + loadBalancingResult: true, + }, } for _, tc := range testCases {