diff --git a/go.mod b/go.mod index d81b5e4323..cfd521c244 100644 --- a/go.mod +++ b/go.mod @@ -24,13 +24,13 @@ require ( google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 google.golang.org/protobuf v1.35.1 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.31.2 - k8s.io/apimachinery v0.31.2 - k8s.io/client-go v0.31.2 - k8s.io/code-generator v0.31.2 + k8s.io/api v0.31.3 + k8s.io/apimachinery v0.31.3 + k8s.io/client-go v0.31.3 + k8s.io/code-generator v0.31.3 k8s.io/kube-openapi v0.0.0-20240816214639-573285566f34 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 - sigs.k8s.io/controller-runtime v0.19.1 + sigs.k8s.io/controller-runtime v0.19.2 sigs.k8s.io/controller-tools v0.16.5 ) @@ -208,14 +208,14 @@ require ( gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.31.2 // indirect - k8s.io/apiserver v0.31.2 // indirect + k8s.io/apiextensions-apiserver v0.31.3 // indirect + k8s.io/apiserver v0.31.3 // indirect k8s.io/cli-runtime v0.31.0 // indirect - k8s.io/component-base v0.31.2 // indirect + k8s.io/component-base v0.31.3 // indirect k8s.io/gengo/v2 v2.0.0-20240812201722-3b05ca7b6e59 // indirect k8s.io/klog v1.0.0 // indirect k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kms v0.31.2 // indirect + k8s.io/kms v0.31.3 // indirect k8s.io/kube-aggregator v0.31.2 // indirect k8s.io/kubectl v0.31.0 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect diff --git a/go.sum b/go.sum index 3bec1289c8..2d175200ea 100644 --- a/go.sum +++ b/go.sum @@ -3071,27 +3071,27 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= k8s.io/api v0.18.0/go.mod h1:q2HRQkfDzHMBZL9l/y9rH63PkQl4vae0xRT+8prbrK8= k8s.io/api v0.21.0-rc.0/go.mod h1:Dkc/ZauWJrgZhjOjeBgW89xZQiTBJA2RaBKYHXPsi2Y= -k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= -k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= -k8s.io/apiextensions-apiserver v0.31.2 h1:W8EwUb8+WXBLu56ser5IudT2cOho0gAKeTOnywBLxd0= -k8s.io/apiextensions-apiserver v0.31.2/go.mod h1:i+Geh+nGCJEGiCGR3MlBDkS7koHIIKWVfWeRFiOsUcM= +k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8= +k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE= +k8s.io/apiextensions-apiserver v0.31.3 h1:+GFGj2qFiU7rGCsA5o+p/rul1OQIq6oYpQw4+u+nciE= +k8s.io/apiextensions-apiserver v0.31.3/go.mod h1:2DSpFhUZZJmn/cr/RweH1cEVVbzFw9YBu4T+U3mf1e4= k8s.io/apimachinery v0.18.0/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apimachinery v0.21.0-rc.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= -k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= -k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= -k8s.io/apiserver v0.31.2 h1:VUzOEUGRCDi6kX1OyQ801m4A7AUPglpsmGvdsekmcI4= -k8s.io/apiserver v0.31.2/go.mod h1:o3nKZR7lPlJqkU5I3Ove+Zx3JuoFjQobGX1Gctw6XuE= +k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4= +k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apiserver v0.31.3 h1:+1oHTtCB+OheqFEz375D0IlzHZ5VeQKX1KGXnx+TTuY= +k8s.io/apiserver v0.31.3/go.mod h1:PrxVbebxrxQPFhJk4powDISIROkNMKHibTg9lTRQ0Qg= k8s.io/cli-runtime v0.31.0 h1:V2Q1gj1u3/WfhD475HBQrIYsoryg/LrhhK4RwpN+DhA= k8s.io/cli-runtime v0.31.0/go.mod h1:vg3H94wsubuvWfSmStDbekvbla5vFGC+zLWqcf+bGDw= k8s.io/client-go v0.18.0/go.mod h1:uQSYDYs4WhVZ9i6AIoEZuwUggLVEF64HOD37boKAtF8= -k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc= -k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs= +k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4= +k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs= k8s.io/code-generator v0.18.0/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.21.0-rc.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= -k8s.io/code-generator v0.31.2 h1:xLWxG0HEpMSHfcM//3u3Ro2Hmc6AyyLINQS//Z2GEOI= -k8s.io/code-generator v0.31.2/go.mod h1:eEQHXgBU/m7LDaToDoiz3t97dUUVyOblQdwOr8rivqc= -k8s.io/component-base v0.31.2 h1:Z1J1LIaC0AV+nzcPRFqfK09af6bZ4D1nAOpWsy9owlA= -k8s.io/component-base v0.31.2/go.mod h1:9PeyyFN/drHjtJZMCTkSpQJS3U9OXORnHQqMLDz0sUQ= +k8s.io/code-generator v0.31.3 h1:Pj0fYOBms+ZrsulLi4DMsCEx1jG8fWKRLy44onHsLBI= +k8s.io/code-generator v0.31.3/go.mod h1:/umCIlT84g1+Yu5ZXtP1KGSRTnGiIzzX5AzUAxsNlts= +k8s.io/component-base v0.31.3 h1:DMCXXVx546Rfvhj+3cOm2EUxhS+EyztH423j+8sOwhQ= +k8s.io/component-base v0.31.3/go.mod h1:xME6BHfUOafRgT0rGVBGl7TuSg8Z9/deT7qq6w7qjIU= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -3107,8 +3107,8 @@ k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kms v0.31.2 h1:pyx7l2qVOkClzFMIWMVF/FxsSkgd+OIGH7DecpbscJI= -k8s.io/kms v0.31.2/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= +k8s.io/kms v0.31.3 h1:XCFmiJn5CCKs8xoOLpCmu42Ubm/KW85wNHybGFcSAYc= +k8s.io/kms v0.31.3/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= k8s.io/kube-aggregator v0.31.2 h1:Uw1zUP2D/4wiSjKWVVzSOcCGLuW/+IdRwjjC0FJooYU= k8s.io/kube-aggregator v0.31.2/go.mod h1:41/VIXH+/Qcg9ERNAY6bRF/WQR6xL1wFgYagdHac1X4= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= @@ -3186,8 +3186,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk= -sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/controller-runtime v0.19.2 h1:3sPrF58XQEPzbE8T81TN6selQIMGbtYwuaJ6eDssDF8= +sigs.k8s.io/controller-runtime v0.19.2/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/controller-tools v0.16.5 h1:5k9FNRqziBPwqr17AMEPPV/En39ZBplLAdOwwQHruP4= sigs.k8s.io/controller-tools v0.16.5/go.mod h1:8vztuRVzs8IuuJqKqbXCSlXcw+lkAv/M2sTpg55qjMY= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/staging/operator-lifecycle-manager/.github/workflows/e2e-tests.yml b/staging/operator-lifecycle-manager/.github/workflows/e2e-tests.yml index aa4a4c4bcd..8dd4ff9b91 100644 --- a/staging/operator-lifecycle-manager/.github/workflows/e2e-tests.yml +++ b/staging/operator-lifecycle-manager/.github/workflows/e2e-tests.yml @@ -92,12 +92,12 @@ jobs: # run non-flakes if matrix-id is not 'flakes' - name: Run e2e tests - # calculate the number of chunks as the number of parallel jobs minus 1 (flakes job) + # calculate the number of chunks as the number of parallel jobs # use the split tool to split the test suite into chunks and run the chunk corresponding to the matrix-id # focus on those tests and skip tests marked as FLAKE run: | - E2E_TEST_NUM_CHUNKS=$(( ${{ strategy.job-total }} - 1 )) \ - GINKGO_OPTS="${GINKGO_OPTS} -focus '$(go run ./test/e2e/split/... -chunks $E2E_TEST_NUM_CHUNKS -print-chunk $E2E_TEST_CHUNK ./test/e2e)' -skip '\[FLAKE\]'" \ + E2E_TEST_NUM_CHUNKS=$(( ${{ strategy.job-total }} )) \ + GINKGO_OPTS="${GINKGO_OPTS} -label-filter '$(go run ./test/e2e/split/... -chunks $E2E_TEST_NUM_CHUNKS -print-chunk $E2E_TEST_CHUNK ./test/e2e)' -skip '\[FLAKE\]'" \ make e2e; # archive test results diff --git a/staging/operator-lifecycle-manager/go.mod b/staging/operator-lifecycle-manager/go.mod index 5a666d0d7a..793241ece4 100644 --- a/staging/operator-lifecycle-manager/go.mod +++ b/staging/operator-lifecycle-manager/go.mod @@ -40,19 +40,19 @@ require ( golang.org/x/time v0.8.0 google.golang.org/grpc v1.67.1 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.31.2 - k8s.io/apiextensions-apiserver v0.31.2 - k8s.io/apimachinery v0.31.2 - k8s.io/apiserver v0.31.2 - k8s.io/client-go v0.31.2 - k8s.io/code-generator v0.31.2 - k8s.io/component-base v0.31.2 + k8s.io/api v0.31.3 + k8s.io/apiextensions-apiserver v0.31.3 + k8s.io/apimachinery v0.31.3 + k8s.io/apiserver v0.31.3 + k8s.io/client-go v0.31.3 + k8s.io/code-generator v0.31.3 + k8s.io/component-base v0.31.3 k8s.io/klog v1.0.0 k8s.io/klog/v2 v2.130.1 k8s.io/kube-aggregator v0.31.2 k8s.io/kube-openapi v0.0.0-20240816214639-573285566f34 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 - sigs.k8s.io/controller-runtime v0.19.1 + sigs.k8s.io/controller-runtime v0.19.2 sigs.k8s.io/controller-tools v0.16.5 ) @@ -177,7 +177,7 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/gengo/v2 v2.0.0-20240812201722-3b05ca7b6e59 // indirect - k8s.io/kms v0.31.2 // indirect + k8s.io/kms v0.31.3 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect diff --git a/staging/operator-lifecycle-manager/go.sum b/staging/operator-lifecycle-manager/go.sum index 3f360a070f..192e3725a6 100644 --- a/staging/operator-lifecycle-manager/go.sum +++ b/staging/operator-lifecycle-manager/go.sum @@ -2830,28 +2830,28 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt 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= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= -k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= -k8s.io/apiextensions-apiserver v0.31.2 h1:W8EwUb8+WXBLu56ser5IudT2cOho0gAKeTOnywBLxd0= -k8s.io/apiextensions-apiserver v0.31.2/go.mod h1:i+Geh+nGCJEGiCGR3MlBDkS7koHIIKWVfWeRFiOsUcM= -k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= -k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= -k8s.io/apiserver v0.31.2 h1:VUzOEUGRCDi6kX1OyQ801m4A7AUPglpsmGvdsekmcI4= -k8s.io/apiserver v0.31.2/go.mod h1:o3nKZR7lPlJqkU5I3Ove+Zx3JuoFjQobGX1Gctw6XuE= -k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc= -k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs= -k8s.io/code-generator v0.31.2 h1:xLWxG0HEpMSHfcM//3u3Ro2Hmc6AyyLINQS//Z2GEOI= -k8s.io/code-generator v0.31.2/go.mod h1:eEQHXgBU/m7LDaToDoiz3t97dUUVyOblQdwOr8rivqc= -k8s.io/component-base v0.31.2 h1:Z1J1LIaC0AV+nzcPRFqfK09af6bZ4D1nAOpWsy9owlA= -k8s.io/component-base v0.31.2/go.mod h1:9PeyyFN/drHjtJZMCTkSpQJS3U9OXORnHQqMLDz0sUQ= +k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8= +k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE= +k8s.io/apiextensions-apiserver v0.31.3 h1:+GFGj2qFiU7rGCsA5o+p/rul1OQIq6oYpQw4+u+nciE= +k8s.io/apiextensions-apiserver v0.31.3/go.mod h1:2DSpFhUZZJmn/cr/RweH1cEVVbzFw9YBu4T+U3mf1e4= +k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4= +k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apiserver v0.31.3 h1:+1oHTtCB+OheqFEz375D0IlzHZ5VeQKX1KGXnx+TTuY= +k8s.io/apiserver v0.31.3/go.mod h1:PrxVbebxrxQPFhJk4powDISIROkNMKHibTg9lTRQ0Qg= +k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4= +k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs= +k8s.io/code-generator v0.31.3 h1:Pj0fYOBms+ZrsulLi4DMsCEx1jG8fWKRLy44onHsLBI= +k8s.io/code-generator v0.31.3/go.mod h1:/umCIlT84g1+Yu5ZXtP1KGSRTnGiIzzX5AzUAxsNlts= +k8s.io/component-base v0.31.3 h1:DMCXXVx546Rfvhj+3cOm2EUxhS+EyztH423j+8sOwhQ= +k8s.io/component-base v0.31.3/go.mod h1:xME6BHfUOafRgT0rGVBGl7TuSg8Z9/deT7qq6w7qjIU= k8s.io/gengo/v2 v2.0.0-20240812201722-3b05ca7b6e59 h1:PfhT3P5Y7psqhl0D77Rj2B7RH77eid/wBttxlMTxXag= k8s.io/gengo/v2 v2.0.0-20240812201722-3b05ca7b6e59/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kms v0.31.2 h1:pyx7l2qVOkClzFMIWMVF/FxsSkgd+OIGH7DecpbscJI= -k8s.io/kms v0.31.2/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= +k8s.io/kms v0.31.3 h1:XCFmiJn5CCKs8xoOLpCmu42Ubm/KW85wNHybGFcSAYc= +k8s.io/kms v0.31.3/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= k8s.io/kube-aggregator v0.31.2 h1:Uw1zUP2D/4wiSjKWVVzSOcCGLuW/+IdRwjjC0FJooYU= k8s.io/kube-aggregator v0.31.2/go.mod h1:41/VIXH+/Qcg9ERNAY6bRF/WQR6xL1wFgYagdHac1X4= k8s.io/kube-openapi v0.0.0-20240816214639-573285566f34 h1:/amS69DLm09mtbFtN3+LyygSFohnYGMseF8iv+2zulg= @@ -2924,8 +2924,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk= -sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/controller-runtime v0.19.2 h1:3sPrF58XQEPzbE8T81TN6selQIMGbtYwuaJ6eDssDF8= +sigs.k8s.io/controller-runtime v0.19.2/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/controller-tools v0.16.5 h1:5k9FNRqziBPwqr17AMEPPV/En39ZBplLAdOwwQHruP4= sigs.k8s.io/controller-tools v0.16.5/go.mod h1:8vztuRVzs8IuuJqKqbXCSlXcw+lkAv/M2sTpg55qjMY= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/staging/operator-lifecycle-manager/test/e2e/bundle_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/bundle_e2e_test.go index d52c348edc..9accdbb9c0 100644 --- a/staging/operator-lifecycle-manager/test/e2e/bundle_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/bundle_e2e_test.go @@ -26,7 +26,7 @@ import ( //go:embed testdata/vpa/crd.yaml var vpaCRDRaw []byte -var _ = Describe("Installing bundles with new object types", func() { +var _ = Describe("Installing bundles with new object types", Label("ObjectTypes"), func() { var ( kubeClient operatorclient.ClientInterface operatorClient versioned.Interface diff --git a/staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go index b22893b48a..39fa0497d7 100644 --- a/staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go @@ -43,7 +43,7 @@ const ( badCSVDir = "bad-csv" ) -var _ = Describe("Starting CatalogSource e2e tests", func() { +var _ = Describe("Starting CatalogSource e2e tests", Label("CatalogSource"), func() { var ( generatedNamespace corev1.Namespace c operatorclient.ClientInterface diff --git a/staging/operator-lifecycle-manager/test/e2e/catalog_exclusion_test.go b/staging/operator-lifecycle-manager/test/e2e/catalog_exclusion_test.go index 78fd617e9a..81ad98798c 100644 --- a/staging/operator-lifecycle-manager/test/e2e/catalog_exclusion_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/catalog_exclusion_test.go @@ -20,7 +20,7 @@ import ( const magicCatalogDir = "magiccatalog" -var _ = Describe("Global Catalog Exclusion", func() { +var _ = Describe("Global Catalog Exclusion", Label("CatalogExclusion"), func() { var ( generatedNamespace corev1.Namespace determinedE2eClient *util.DeterminedE2EClient diff --git a/staging/operator-lifecycle-manager/test/e2e/catsrc_pod_config_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/catsrc_pod_config_e2e_test.go index a37f8ca69e..50930d5e64 100644 --- a/staging/operator-lifecycle-manager/test/e2e/catsrc_pod_config_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/catsrc_pod_config_e2e_test.go @@ -18,7 +18,7 @@ const catalogSourceLabel = "olm.catalogSource" var _ = By -var _ = Describe("CatalogSource Grpc Pod Config", func() { +var _ = Describe("CatalogSource Grpc Pod Config", Label("CatalogSourcePodConfig"), func() { var ( generatedNamespace corev1.Namespace diff --git a/staging/operator-lifecycle-manager/test/e2e/crd_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/crd_e2e_test.go index 79091b6faf..dc1d9c5126 100644 --- a/staging/operator-lifecycle-manager/test/e2e/crd_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/crd_e2e_test.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -var _ = Describe("CRD Versions", func() { +var _ = Describe("CRD Versions", Label("CRDs"), func() { var ( generatedNamespace corev1.Namespace c operatorclient.ClientInterface diff --git a/staging/operator-lifecycle-manager/test/e2e/csv_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/csv_e2e_test.go index 7934c339c1..872707e436 100644 --- a/staging/operator-lifecycle-manager/test/e2e/csv_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/csv_e2e_test.go @@ -34,7 +34,7 @@ import ( "github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx" ) -var _ = Describe("ClusterServiceVersion", func() { +var _ = Describe("ClusterServiceVersion", Label("ClusterServiceVersion"), func() { var ( generatedNamespace corev1.Namespace c operatorclient.ClientInterface diff --git a/staging/operator-lifecycle-manager/test/e2e/deprecated_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/deprecated_e2e_test.go index 49c618e2cb..d11b274c5e 100644 --- a/staging/operator-lifecycle-manager/test/e2e/deprecated_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/deprecated_e2e_test.go @@ -18,7 +18,7 @@ import ( var missingAPI = `{"apiVersion":"verticalpodautoscalers.autoscaling.k8s.io/v1","kind":"VerticalPodAutoscaler","metadata":{"name":"my.thing","namespace":"foo"}}` -var _ = Describe("Not found APIs", func() { +var _ = Describe("Not found APIs", Label("APIDeprecation"), func() { var generatedNamespace corev1.Namespace BeforeEach(func() { diff --git a/staging/operator-lifecycle-manager/test/e2e/disabling_copied_csv_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/disabling_copied_csv_e2e_test.go index ddb0a62aa9..7757986beb 100644 --- a/staging/operator-lifecycle-manager/test/e2e/disabling_copied_csv_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/disabling_copied_csv_e2e_test.go @@ -26,7 +26,7 @@ const ( protectedCopiedCSVNamespacesRuntimeFlag = "--protectedCopiedCSVNamespaces" ) -var _ = Describe("Disabling copied CSVs", func() { +var _ = Describe("Disabling copied CSVs", Label("DisablingCopiedCSVs"), func() { var ( generatedNamespace corev1.Namespace csv operatorsv1alpha1.ClusterServiceVersion diff --git a/staging/operator-lifecycle-manager/test/e2e/dynamic_resource_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/dynamic_resource_e2e_test.go index cd7e7c92b8..8bd2583057 100644 --- a/staging/operator-lifecycle-manager/test/e2e/dynamic_resource_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/dynamic_resource_e2e_test.go @@ -20,7 +20,7 @@ import ( // This test was disabled because both of its tests are currently being skipped // We need to understand why and whether this test is even needed: // https://github.com/operator-framework/operator-lifecycle-manager/issues/3402 -var _ = XDescribe("Subscriptions create required objects from Catalogs", func() { +var _ = XDescribe("Subscriptions create required objects from Catalogs", Label("DynamicResource"), func() { var ( crc versioned.Interface generatedNamespace corev1.Namespace diff --git a/staging/operator-lifecycle-manager/test/e2e/fail_forward_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/fail_forward_e2e_test.go index 76a6462ea4..69f4e329ca 100644 --- a/staging/operator-lifecycle-manager/test/e2e/fail_forward_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/fail_forward_e2e_test.go @@ -123,7 +123,7 @@ func updateCatalogSource(namespace, name string, packages ...string) (func(), er return deployCatalogSource(namespace, name, packages...) } -var _ = Describe("Fail Forward Upgrades", func() { +var _ = Describe("Fail Forward Upgrades", Label("FailForward"), func() { var ( generatedNamespace corev1.Namespace diff --git a/staging/operator-lifecycle-manager/test/e2e/gc_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/gc_e2e_test.go index 927844f095..2a9c2bf3c9 100644 --- a/staging/operator-lifecycle-manager/test/e2e/gc_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/gc_e2e_test.go @@ -23,7 +23,7 @@ import ( "github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx" ) -var _ = Describe("Garbage collection for dependent resources", func() { +var _ = Describe("Garbage collection for dependent resources", Label("GarbageCollection"), func() { var ( kubeClient operatorclient.ClientInterface operatorClient versioned.Interface diff --git a/staging/operator-lifecycle-manager/test/e2e/installplan_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/installplan_e2e_test.go index 8110d4e534..4fe1419fd6 100644 --- a/staging/operator-lifecycle-manager/test/e2e/installplan_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/installplan_e2e_test.go @@ -50,7 +50,7 @@ const ( deprecatedCRDDir = "deprecated-crd" ) -var _ = Describe("Install Plan", func() { +var _ = Describe("Install Plan", Label("InstallPlan"), func() { var ( c operatorclient.ClientInterface crc versioned.Interface diff --git a/staging/operator-lifecycle-manager/test/e2e/magic_catalog_test.go b/staging/operator-lifecycle-manager/test/e2e/magic_catalog_test.go index 9e583b8ed3..c437d67a4f 100644 --- a/staging/operator-lifecycle-manager/test/e2e/magic_catalog_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/magic_catalog_test.go @@ -13,7 +13,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" ) -var _ = Describe("MagicCatalog", func() { +var _ = Describe("MagicCatalog", Label("MagicCatalog"), func() { var ( generatedNamespace corev1.Namespace c client.Client diff --git a/staging/operator-lifecycle-manager/test/e2e/metrics_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/metrics_e2e_test.go index 7a98593a41..fecefd7334 100644 --- a/staging/operator-lifecycle-manager/test/e2e/metrics_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/metrics_e2e_test.go @@ -27,7 +27,7 @@ import ( "github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx" ) -var _ = Describe("Metrics are generated for OLM managed resources", func() { +var _ = Describe("Metrics are generated for OLM managed resources", Label("Metrics"), func() { var ( c operatorclient.ClientInterface crc versioned.Interface diff --git a/staging/operator-lifecycle-manager/test/e2e/operator_condition_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/operator_condition_e2e_test.go index bc53ca2acd..f4c7857347 100644 --- a/staging/operator-lifecycle-manager/test/e2e/operator_condition_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/operator_condition_e2e_test.go @@ -19,7 +19,7 @@ import ( "github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx" ) -var _ = Describe("Operator Condition", func() { +var _ = Describe("Operator Condition", Label("OperatorCondition"), func() { var ( generatedNamespace corev1.Namespace ) diff --git a/staging/operator-lifecycle-manager/test/e2e/operator_groups_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/operator_groups_e2e_test.go index e32f44b1f0..a8739f58db 100644 --- a/staging/operator-lifecycle-manager/test/e2e/operator_groups_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/operator_groups_e2e_test.go @@ -35,7 +35,7 @@ import ( "github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx" ) -var _ = Describe("Operator Group", func() { +var _ = Describe("Operator Group", Label("OperatorGroup"), func() { var ( c operatorclient.ClientInterface crc versioned.Interface diff --git a/staging/operator-lifecycle-manager/test/e2e/operator_test.go b/staging/operator-lifecycle-manager/test/e2e/operator_test.go index 90caea0f1f..e1ff314ec0 100644 --- a/staging/operator-lifecycle-manager/test/e2e/operator_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/operator_test.go @@ -31,7 +31,7 @@ import ( ) // Describes test specs for the Operator resource. -var _ = Describe("Operator API", func() { +var _ = Describe("Operator API", Label("Operator"), func() { var ( clientCtx context.Context scheme *runtime.Scheme diff --git a/staging/operator-lifecycle-manager/test/e2e/packagemanifest_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/packagemanifest_e2e_test.go index d3a9cf971f..5e3e5a7cc1 100644 --- a/staging/operator-lifecycle-manager/test/e2e/packagemanifest_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/packagemanifest_e2e_test.go @@ -23,7 +23,7 @@ import ( "github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx" ) -var _ = Describe("Package Manifest API lists available Operators from Catalog Sources", func() { +var _ = Describe("Package Manifest API lists available Operators from Catalog Sources", Label("PackageManifest"), func() { var ( crc versioned.Interface pmc pmversioned.Interface diff --git a/staging/operator-lifecycle-manager/test/e2e/resource_manager_test.go b/staging/operator-lifecycle-manager/test/e2e/resource_manager_test.go index 702aaaecf2..234fe0164f 100644 --- a/staging/operator-lifecycle-manager/test/e2e/resource_manager_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/resource_manager_test.go @@ -14,7 +14,7 @@ import ( "github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx" ) -var _ = Describe("ResourceManager", func() { +var _ = Describe("ResourceManager", Label("ResourceManager"), func() { var generatedNamespace corev1.Namespace BeforeEach(func() { diff --git a/staging/operator-lifecycle-manager/test/e2e/scoped_client_test.go b/staging/operator-lifecycle-manager/test/e2e/scoped_client_test.go index 3b201d3c67..5800055fda 100644 --- a/staging/operator-lifecycle-manager/test/e2e/scoped_client_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/scoped_client_test.go @@ -18,7 +18,7 @@ import ( "github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx" ) -var _ = Describe("Scoped Client bound to a service account can be used to make API calls", func() { +var _ = Describe("Scoped Client bound to a service account can be used to make API calls", Label("ScopedClient"), func() { // TestScopedClient ensures that we can create a scoped client bound to a // service account and then we can use the scoped client to make API calls. var ( diff --git a/staging/operator-lifecycle-manager/test/e2e/split/integration_test.sh b/staging/operator-lifecycle-manager/test/e2e/split/integration_test.sh index 1c4b315433..1d2d17b061 100755 --- a/staging/operator-lifecycle-manager/test/e2e/split/integration_test.sh +++ b/staging/operator-lifecycle-manager/test/e2e/split/integration_test.sh @@ -5,8 +5,8 @@ function get_total_specs() { } unfocused_specs=$(get_total_specs) -regexp=$(go run ./test/e2e/split/... -chunks 1 -print-chunk 0 ./test/e2e) -focused_specs=$(get_total_specs -focus "$regexp") +label_filter=$(go run ./test/e2e/split/... -chunks 1 -print-chunk 0 ./test/e2e) +focused_specs=$(get_total_specs -label-filter "$label_filter") if ! [ $unfocused_specs -eq $focused_specs ]; then echo "expected number of unfocused specs $unfocused_specs to equal focus specs $focused_specs" diff --git a/staging/operator-lifecycle-manager/test/e2e/split/main.go b/staging/operator-lifecycle-manager/test/e2e/split/main.go index 1637fdb567..fdaf90eec9 100644 --- a/staging/operator-lifecycle-manager/test/e2e/split/main.go +++ b/staging/operator-lifecycle-manager/test/e2e/split/main.go @@ -3,18 +3,27 @@ package main import ( "flag" "fmt" + "go/ast" + "go/parser" + "go/token" "io" "log" "math" "os" "path/filepath" - "regexp" "sort" "strings" "github.com/sirupsen/logrus" ) +const ( + ginkgoDescribeFunctionName = "Describe" + ginkgoLabelFunctionName = "Label" +) + +var logger = logrus.New() + type options struct { numChunks int printChunk int @@ -34,54 +43,57 @@ func main() { flag.Parse() if opts.printChunk >= opts.numChunks { - exitIfErr(fmt.Errorf("the chunk to print (%d) must be a smaller number than the number of chunks (%d)", opts.printChunk, opts.numChunks)) + log.Fatal(fmt.Errorf("the chunk to print (%d) must be a smaller number than the number of chunks (%d)", opts.printChunk, opts.numChunks)) } dir := flag.Arg(0) if dir == "" { - exitIfErr(fmt.Errorf("test directory required as the argument")) + log.Fatal(fmt.Errorf("test directory required as the argument")) } - // Clean dir. var err error - dir, err = filepath.Abs(dir) - exitIfErr(err) - wd, err := os.Getwd() - exitIfErr(err) - dir, err = filepath.Rel(wd, dir) - exitIfErr(err) - - exitIfErr(opts.run(dir)) -} + level, err := logrus.ParseLevel(opts.logLevel) + if err != nil { + log.Fatal(err) + } + logger.SetLevel(level) -func exitIfErr(err error) { + dir, err = getPathRelativeToCwd(dir) if err != nil { log.Fatal(err) } + + if err := opts.run(dir); err != nil { + log.Fatal(err) + } } -func (opts options) run(dir string) error { - level, err := logrus.ParseLevel(opts.logLevel) +func getPathRelativeToCwd(path string) (string, error) { + path, err := filepath.Abs(path) if err != nil { - return fmt.Errorf("failed to parse the %s log level: %v", opts.logLevel, err) + return "", err } - logger := logrus.New() - logger.SetLevel(level) - describes, err := findDescribes(logger, dir) + wd, err := os.Getwd() if err != nil { - return err + return "", err } + return filepath.Rel(wd, path) +} - // Find minimal prefixes for all spec strings so no spec runs are duplicated across chunks. - prefixes := findMinimalWordPrefixes(describes) - sort.Strings(prefixes) +func (opts options) run(dir string) error { + // Get all test labels + labels, err := findLabels(dir) + if err != nil { + return err + } + sort.Strings(labels) var out string if opts.printDebug { - out = strings.Join(prefixes, "\n") + out = strings.Join(labels, "\n") } else { - out, err = createChunkRegexp(opts.numChunks, opts.printChunk, prefixes) + out, err = createFilterLabelChunk(opts.numChunks, opts.printChunk, labels) if err != nil { return err } @@ -91,52 +103,53 @@ func (opts options) run(dir string) error { return nil } -// TODO: this is hacky because top-level tests may be defined elsewise. -// A better strategy would be to use the output of `ginkgo -noColor -dryRun` -// like https://github.com/operator-framework/operator-lifecycle-manager/pull/1476 does. -var topDescribeRE = regexp.MustCompile(`var _ = Describe\("(.+)", func\(.*`) - -func findDescribes(logger logrus.FieldLogger, dir string) ([]string, error) { - // Find all Ginkgo specs in dir's test files. - // These can be grouped independently. - describeTable := make(map[string]struct{}) +func findLabels(dir string) ([]string, error) { + var labels []string + logger.Infof("Finding labels for ginkgo tests in path: %s", dir) matches, err := filepath.Glob(filepath.Join(dir, "*_test.go")) if err != nil { return nil, err } for _, match := range matches { - b, err := os.ReadFile(match) - if err != nil { - return nil, err - } - specNames := topDescribeRE.FindAllSubmatch(b, -1) - if len(specNames) == 0 { - logger.Warnf("%s: found no top level describes, skipping", match) - continue - } - for _, possibleNames := range specNames { - if len(possibleNames) != 2 { - logger.Debugf("%s: expected to find 2 submatch, found %d:", match, len(possibleNames)) - for _, name := range possibleNames { - logger.Debugf("\t%s\n", string(name)) + labels = append(labels, extractLabelsFromFile(match)...) + } + return labels, nil +} + +func extractLabelsFromFile(filename string) []string { + var labels []string + + // Create a Go source file set + fs := token.NewFileSet() + node, err := parser.ParseFile(fs, filename, nil, parser.AllErrors) + if err != nil { + fmt.Printf("Error parsing file %s: %v\n", filename, err) + return labels + } + + ast.Inspect(node, func(n ast.Node) bool { + if callExpr, ok := n.(*ast.CallExpr); ok { + if fun, ok := callExpr.Fun.(*ast.Ident); ok && fun.Name == ginkgoDescribeFunctionName { + for _, arg := range callExpr.Args { + if ce, ok := arg.(*ast.CallExpr); ok { + if labelFunc, ok := ce.Fun.(*ast.Ident); ok && labelFunc.Name == ginkgoLabelFunctionName { + for _, arg := range ce.Args { + if lit, ok := arg.(*ast.BasicLit); ok && lit.Kind == token.STRING { + labels = append(labels, strings.Trim(lit.Value, "\"")) + } + } + } + } } - continue } - describe := strings.TrimSpace(string(possibleNames[1])) - describeTable[describe] = struct{}{} } - } + return true + }) - describes := make([]string, len(describeTable)) - i := 0 - for describeKey := range describeTable { - describes[i] = describeKey - i++ - } - return describes, nil + return labels } -func createChunkRegexp(numChunks, printChunk int, specs []string) (string, error) { +func createFilterLabelChunk(numChunks, printChunk int, specs []string) (string, error) { numSpecs := len(specs) if numSpecs < numChunks { return "", fmt.Errorf("have more desired chunks (%d) than specs (%d)", numChunks, numSpecs) @@ -162,72 +175,16 @@ func createChunkRegexp(numChunks, printChunk int, specs []string) (string, error // Write out the regexp to focus chunk specs via `ginkgo -focus `. var reStr string if len(chunk) == 1 { - reStr = fmt.Sprintf("%s .*", chunk[0]) + reStr = fmt.Sprintf("%s", chunk[0]) } else { sb := strings.Builder{} sb.WriteString(chunk[0]) for _, test := range chunk[1:] { - sb.WriteString("|") + sb.WriteString(" || ") sb.WriteString(test) } - reStr = fmt.Sprintf("(%s) .*", sb.String()) + reStr = fmt.Sprintf("%s", sb.String()) } return reStr, nil } - -func findMinimalWordPrefixes(specs []string) (prefixes []string) { - // Create a word trie of all spec strings. - t := make(wordTrie) - for _, spec := range specs { - t.push(spec) - } - - // Now find the first branch point for each path in the trie by DFS. - for word, node := range t { - var prefixElements []string - next: - if word != "" { - prefixElements = append(prefixElements, word) - } - if len(node.children) == 1 { - for nextWord, nextNode := range node.children { - word, node = nextWord, nextNode - } - goto next - } - // TODO: this might need to be joined by "\s+" - // in case multiple spaces were used in the spec name. - prefixes = append(prefixes, strings.Join(prefixElements, " ")) - } - - return prefixes -} - -// wordTrie is a trie of word nodes, instead of individual characters. -type wordTrie map[string]*wordTrieNode - -type wordTrieNode struct { - word string - children map[string]*wordTrieNode -} - -// push creates s branch of the trie from each word in s. -func (t wordTrie) push(s string) { - split := strings.Split(s, " ") - - curr := &wordTrieNode{word: "", children: t} - for _, sp := range split { - if sp = strings.TrimSpace(sp); sp == "" { - continue - } - next, hasNext := curr.children[sp] - if !hasNext { - next = &wordTrieNode{word: sp, children: make(map[string]*wordTrieNode)} - curr.children[sp] = next - } - curr = next - } - // Add termination node so "foo" and "foo bar" have a branching point of "foo". - curr.children[""] = &wordTrieNode{} -} diff --git a/staging/operator-lifecycle-manager/test/e2e/split/main_test.go b/staging/operator-lifecycle-manager/test/e2e/split/main_test.go index ec2a5410fa..2c95a13b54 100644 --- a/staging/operator-lifecycle-manager/test/e2e/split/main_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/split/main_test.go @@ -3,12 +3,14 @@ package main import ( "os" "os/exec" + "path/filepath" + "runtime" "testing" "github.com/stretchr/testify/require" ) -func TestMain(t *testing.T) { +func TestCmd(t *testing.T) { // This test makes sure that every spec gets run. cmd := exec.Command("./test/e2e/split/integration_test.sh") @@ -19,7 +21,7 @@ func TestMain(t *testing.T) { require.NoError(t, err) } -func TestCreateChunkRegexp(t *testing.T) { +func TestCreateFilterLabelChunk(t *testing.T) { type spec struct { name string numChunks int @@ -34,25 +36,25 @@ func TestCreateChunkRegexp(t *testing.T) { name: "singlePrefix1", numChunks: 1, printChunk: 0, specs: []string{"foo"}, - expRE: "foo .*", + expRE: "foo", }, { name: "multiplePrefixes1", numChunks: 1, printChunk: 0, specs: []string{"bar foo", "baz", "foo"}, - expRE: "(bar foo|baz|foo) .*", + expRE: "bar foo || baz || foo", }, { name: "multiplePrefixes2", numChunks: 3, printChunk: 0, specs: []string{"bar foo", "baz", "foo"}, - expRE: "bar foo .*", + expRE: "bar foo", }, { name: "multiplePrefixes3", numChunks: 3, printChunk: 2, specs: []string{"bar foo", "baz", "foo"}, - expRE: "foo .*", + expRE: "foo", }, { name: "empty", @@ -76,7 +78,7 @@ func TestCreateChunkRegexp(t *testing.T) { for _, c := range cases { t.Run(c.name, func(t *testing.T) { - re, err := createChunkRegexp(c.numChunks, c.printChunk, c.specs) + re, err := createFilterLabelChunk(c.numChunks, c.printChunk, c.specs) if c.expError != "" { require.EqualError(t, err, c.expError) } else { @@ -87,55 +89,17 @@ func TestCreateChunkRegexp(t *testing.T) { } } -func TestFindMinimalWordPrefixes(t *testing.T) { - type spec struct { - name string - specs []string - expPrefixes []string - } - - cases := []spec{ - { - name: "empty", - specs: nil, - expPrefixes: nil, - }, - { - name: "singleSpec", - specs: []string{"foo"}, - expPrefixes: []string{"foo"}, - }, - { - name: "twoSpecsSingleWordPrefix", - specs: []string{"foo", "foo bar"}, - expPrefixes: []string{"foo"}, - }, - { - name: "twoMultiWordSpecsSingleWordPrefix", - specs: []string{"foo bar", "foo baz"}, - expPrefixes: []string{"foo"}, - }, - { - name: "twoMultiWordSpecsLongPrefix", - specs: []string{"foo bar", "foo bar baz"}, - expPrefixes: []string{"foo bar"}, - }, - { - name: "threeSpecsSingleWordPrefix", - specs: []string{"foo", "foo bar", "foo baz"}, - expPrefixes: []string{"foo"}, - }, - { - name: "multiplePrefixes", - specs: []string{"foo", "foo bar", "foo bar baz", "bar foo", "baz buf", "baz bar foo"}, - expPrefixes: []string{"foo", "bar foo", "baz"}, - }, +func TestExtractLabels(t *testing.T) { + // Determine the directory of this test file + _, filename, _, ok := runtime.Caller(0) + if !ok { + t.Fatalf("Unable to determine the current file location") } + testDir := filepath.Join(filepath.Dir(filename), "testdata") + relPath, err := getPathRelativeToCwd(testDir) + require.NoError(t, err) - for _, c := range cases { - t.Run(c.name, func(t *testing.T) { - prefixes := findMinimalWordPrefixes(c.specs) - require.ElementsMatch(t, c.expPrefixes, prefixes) - }) - } + labels, err := findLabels(relPath) + require.NoError(t, err) + require.ElementsMatch(t, labels, []string{"SomeTest", "SomeOtherTest", "AlsoThis"}) } diff --git a/staging/operator-lifecycle-manager/test/e2e/split/testdata/some_other_test.go b/staging/operator-lifecycle-manager/test/e2e/split/testdata/some_other_test.go new file mode 100644 index 0000000000..ab151f2e00 --- /dev/null +++ b/staging/operator-lifecycle-manager/test/e2e/split/testdata/some_other_test.go @@ -0,0 +1,11 @@ +package testdata + +import ( + . "github.com/onsi/ginkgo/v2" +) + +var _ = Describe("some other test", Label("SomeOtherTest", "AlsoThis"), func() { + It("should be ok", func() { + + }) +}) diff --git a/staging/operator-lifecycle-manager/test/e2e/split/testdata/some_test.go b/staging/operator-lifecycle-manager/test/e2e/split/testdata/some_test.go new file mode 100644 index 0000000000..604322ab67 --- /dev/null +++ b/staging/operator-lifecycle-manager/test/e2e/split/testdata/some_test.go @@ -0,0 +1,7 @@ +package testdata + +import ( + . "github.com/onsi/ginkgo/v2" +) + +var _ = Describe("some test", Label("SomeTest"), func() {}) diff --git a/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go index a2372592c9..d8fa6f023d 100644 --- a/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go @@ -55,7 +55,7 @@ const ( subscriptionTestDataBaseDir = "subscription/" ) -var _ = Describe("Subscription", func() { +var _ = Describe("Subscription", Label("Subscription"), func() { var ( generatedNamespace corev1.Namespace operatorGroup operatorsv1.OperatorGroup diff --git a/staging/operator-lifecycle-manager/test/e2e/user_defined_sa_test.go b/staging/operator-lifecycle-manager/test/e2e/user_defined_sa_test.go index d0558f11a0..c9a1a3d938 100644 --- a/staging/operator-lifecycle-manager/test/e2e/user_defined_sa_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/user_defined_sa_test.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -var _ = Describe("User defined service account", func() { +var _ = Describe("User defined service account", Label("UserDefinedServiceAccount"), func() { var ( generatedNamespace corev1.Namespace c operatorclient.ClientInterface diff --git a/staging/operator-lifecycle-manager/test/e2e/webhook_e2e_test.go b/staging/operator-lifecycle-manager/test/e2e/webhook_e2e_test.go index f2d4b87c73..ed99d46ef4 100644 --- a/staging/operator-lifecycle-manager/test/e2e/webhook_e2e_test.go +++ b/staging/operator-lifecycle-manager/test/e2e/webhook_e2e_test.go @@ -38,7 +38,7 @@ const ( webhookName = "webhook.test.com" ) -var _ = Describe("CSVs with a Webhook", func() { +var _ = Describe("CSVs with a Webhook", Label("Webhooks"), func() { var ( generatedNamespace corev1.Namespace c operatorclient.ClientInterface diff --git a/vendor/k8s.io/apiserver/pkg/server/config.go b/vendor/k8s.io/apiserver/pkg/server/config.go index a326e7335a..6da8949192 100644 --- a/vendor/k8s.io/apiserver/pkg/server/config.go +++ b/vendor/k8s.io/apiserver/pkg/server/config.go @@ -1170,7 +1170,7 @@ func AuthorizeClientBearerToken(loopback *restclient.Config, authn *Authenticati tokens[privilegedLoopbackToken] = &user.DefaultInfo{ Name: user.APIServerUser, UID: uid, - Groups: []string{user.SystemPrivilegedGroup}, + Groups: []string{user.AllAuthenticated, user.SystemPrivilegedGroup}, } tokenAuthenticator := authenticatorfactory.NewFromTokens(tokens, authn.APIAudiences) diff --git a/vendor/modules.txt b/vendor/modules.txt index 5c60cd4739..7ba644df5e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1243,7 +1243,7 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.31.2 +# k8s.io/api v0.31.3 ## explicit; go 1.22.0 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -1303,7 +1303,7 @@ k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 k8s.io/api/storagemigration/v1alpha1 -# k8s.io/apiextensions-apiserver v0.31.2 +# k8s.io/apiextensions-apiserver v0.31.3 ## explicit; go 1.22.0 k8s.io/apiextensions-apiserver/pkg/apihelpers k8s.io/apiextensions-apiserver/pkg/apis/apiextensions @@ -1325,7 +1325,7 @@ k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 k8s.io/apiextensions-apiserver/pkg/features -# k8s.io/apimachinery v0.31.2 +# k8s.io/apimachinery v0.31.3 ## explicit; go 1.22.0 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -1393,7 +1393,7 @@ k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/netutil k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/apiserver v0.31.2 +# k8s.io/apiserver v0.31.3 ## explicit; go 1.22.0 k8s.io/apiserver/pkg/admission k8s.io/apiserver/pkg/admission/configuration @@ -1548,7 +1548,7 @@ k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics # k8s.io/cli-runtime v0.31.0 ## explicit; go 1.22.0 k8s.io/cli-runtime/pkg/printers -# k8s.io/client-go v0.31.2 +# k8s.io/client-go v0.31.3 ## explicit; go 1.22.0 k8s.io/client-go/applyconfigurations k8s.io/client-go/applyconfigurations/admissionregistration/v1 @@ -1891,7 +1891,7 @@ k8s.io/client-go/util/keyutil k8s.io/client-go/util/retry k8s.io/client-go/util/watchlist k8s.io/client-go/util/workqueue -# k8s.io/code-generator v0.31.2 +# k8s.io/code-generator v0.31.3 ## explicit; go 1.22.0 k8s.io/code-generator k8s.io/code-generator/cmd/applyconfiguration-gen @@ -1927,7 +1927,7 @@ k8s.io/code-generator/cmd/register-gen/generators k8s.io/code-generator/pkg/namer k8s.io/code-generator/pkg/util k8s.io/code-generator/third_party/forked/golang/reflect -# k8s.io/component-base v0.31.2 +# k8s.io/component-base v0.31.3 ## explicit; go 1.22.0 k8s.io/component-base/cli/flag k8s.io/component-base/featuregate @@ -1967,7 +1967,7 @@ k8s.io/klog/v2/internal/severity k8s.io/klog/v2/internal/sloghandler k8s.io/klog/v2/internal/verbosity k8s.io/klog/v2/textlogger -# k8s.io/kms v0.31.2 +# k8s.io/kms v0.31.3 ## explicit; go 1.22.0 k8s.io/kms/apis/v1beta1 k8s.io/kms/apis/v2 @@ -2041,7 +2041,7 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/common/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client -# sigs.k8s.io/controller-runtime v0.19.1 +# sigs.k8s.io/controller-runtime v0.19.2 ## explicit; go 1.22.0 sigs.k8s.io/controller-runtime sigs.k8s.io/controller-runtime/pkg/builder diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/cache.go b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/cache.go index 706f9c6cdd..406380d329 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/cache.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/cache.go @@ -222,6 +222,18 @@ type Options struct { // DefaultNamespaces. DefaultUnsafeDisableDeepCopy *bool + // DefaultEnableWatchBookmarks requests watch events with type "BOOKMARK". + // Servers that do not implement bookmarks may ignore this flag and + // bookmarks are sent at the server's discretion. Clients should not + // assume bookmarks are returned at any specific interval, nor may they + // assume the server will send any BOOKMARK event during a session. + // + // This will be used for all object types, unless it is set in ByObject or + // DefaultNamespaces. + // + // Defaults to false. + DefaultEnableWatchBookmarks *bool + // ByObject restricts the cache's ListWatch to the desired fields per GVK at the specified object. // If unset, this will fall through to the Default* settings. ByObject map[client.Object]ByObject @@ -272,6 +284,15 @@ type ByObject struct { // Be very careful with this, when enabled you must DeepCopy any object before mutating it, // otherwise you will mutate the object in the cache. UnsafeDisableDeepCopy *bool + + // EnableWatchBookmarks requests watch events with type "BOOKMARK". + // Servers that do not implement bookmarks may ignore this flag and + // bookmarks are sent at the server's discretion. Clients should not + // assume bookmarks are returned at any specific interval, nor may they + // assume the server will send any BOOKMARK event during a session. + // + // Defaults to false. + EnableWatchBookmarks *bool } // Config describes all potential options for a given watch. @@ -298,6 +319,15 @@ type Config struct { // UnsafeDisableDeepCopy specifies if List and Get requests against the // cache should not DeepCopy. A nil value allows to default this. UnsafeDisableDeepCopy *bool + + // EnableWatchBookmarks requests watch events with type "BOOKMARK". + // Servers that do not implement bookmarks may ignore this flag and + // bookmarks are sent at the server's discretion. Clients should not + // assume bookmarks are returned at any specific interval, nor may they + // assume the server will send any BOOKMARK event during a session. + // + // Defaults to false. + EnableWatchBookmarks *bool } // NewCacheFunc - Function for creating a new cache from the options and a rest config. @@ -367,6 +397,7 @@ func optionDefaultsToConfig(opts *Options) Config { FieldSelector: opts.DefaultFieldSelector, Transform: opts.DefaultTransform, UnsafeDisableDeepCopy: opts.DefaultUnsafeDisableDeepCopy, + EnableWatchBookmarks: opts.DefaultEnableWatchBookmarks, } } @@ -376,6 +407,7 @@ func byObjectToConfig(byObject ByObject) Config { FieldSelector: byObject.Field, Transform: byObject.Transform, UnsafeDisableDeepCopy: byObject.UnsafeDisableDeepCopy, + EnableWatchBookmarks: byObject.EnableWatchBookmarks, } } @@ -398,6 +430,7 @@ func newCache(restConfig *rest.Config, opts Options) newCacheFunc { Transform: config.Transform, WatchErrorHandler: opts.DefaultWatchErrorHandler, UnsafeDisableDeepCopy: ptr.Deref(config.UnsafeDisableDeepCopy, false), + EnableWatchBookmarks: ptr.Deref(config.EnableWatchBookmarks, false), NewInformer: opts.newInformer, }), readerFailOnMissingInformer: opts.ReaderFailOnMissingInformer, @@ -482,6 +515,7 @@ func defaultOpts(config *rest.Config, opts Options) (Options, error) { byObject.Field = defaultedConfig.FieldSelector byObject.Transform = defaultedConfig.Transform byObject.UnsafeDisableDeepCopy = defaultedConfig.UnsafeDisableDeepCopy + byObject.EnableWatchBookmarks = defaultedConfig.EnableWatchBookmarks } opts.ByObject[obj] = byObject @@ -523,7 +557,9 @@ func defaultConfig(toDefault, defaultFrom Config) Config { if toDefault.UnsafeDisableDeepCopy == nil { toDefault.UnsafeDisableDeepCopy = defaultFrom.UnsafeDisableDeepCopy } - + if toDefault.EnableWatchBookmarks == nil { + toDefault.EnableWatchBookmarks = defaultFrom.EnableWatchBookmarks + } return toDefault } diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers.go b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers.go index cd8c6774ca..a40382d6f3 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers.go @@ -51,6 +51,7 @@ type InformersOpts struct { Selector Selector Transform cache.TransformFunc UnsafeDisableDeepCopy bool + EnableWatchBookmarks bool WatchErrorHandler cache.WatchErrorHandler } @@ -78,6 +79,7 @@ func NewInformers(config *rest.Config, options *InformersOpts) *Informers { selector: options.Selector, transform: options.Transform, unsafeDisableDeepCopy: options.UnsafeDisableDeepCopy, + enableWatchBookmarks: options.EnableWatchBookmarks, newInformer: newInformer, watchErrorHandler: options.WatchErrorHandler, } @@ -174,6 +176,7 @@ type Informers struct { selector Selector transform cache.TransformFunc unsafeDisableDeepCopy bool + enableWatchBookmarks bool // NewInformer allows overriding of the shared index informer constructor for testing. newInformer func(cache.ListerWatcher, runtime.Object, time.Duration, cache.Indexers) cache.SharedIndexInformer @@ -361,8 +364,10 @@ func (ip *Informers) addInformerToMap(gvk schema.GroupVersionKind, obj runtime.O return listWatcher.ListFunc(opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - ip.selector.ApplyToList(&opts) opts.Watch = true // Watch needs to be set to true separately + opts.AllowWatchBookmarks = ip.enableWatchBookmarks + + ip.selector.ApplyToList(&opts) return listWatcher.WatchFunc(opts) }, }, obj, calculateResyncPeriod(ip.resync), cache.Indexers{ @@ -444,6 +449,9 @@ func (ip *Informers) makeListWatcher(gvk schema.GroupVersionKind, obj runtime.Ob }, // Setup the watch function WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { + opts.Watch = true // Watch needs to be set to true separately + opts.AllowWatchBookmarks = ip.enableWatchBookmarks + if namespace != "" { return resources.Namespace(namespace).Watch(ip.ctx, opts) } @@ -486,6 +494,9 @@ func (ip *Informers) makeListWatcher(gvk schema.GroupVersionKind, obj runtime.Ob }, // Setup the watch function WatchFunc: func(opts metav1.ListOptions) (watcher watch.Interface, err error) { + opts.Watch = true // Watch needs to be set to true separately + opts.AllowWatchBookmarks = ip.enableWatchBookmarks + if namespace != "" { watcher, err = resources.Namespace(namespace).Watch(ip.ctx, opts) } else { @@ -527,6 +538,9 @@ func (ip *Informers) makeListWatcher(gvk schema.GroupVersionKind, obj runtime.Ob }, // Setup the watch function WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { + opts.Watch = true // Watch needs to be set to true separately + opts.AllowWatchBookmarks = ip.enableWatchBookmarks + // Build the request. req := client.Get().Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec) if namespace != "" {