diff --git a/.github/renovate.json b/.github/renovate.json index 5cb88ca35..74b071ea9 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -84,12 +84,6 @@ "matchManagers": ["gomod"], "matchPackageNames": ["kubevirt.io/csi-driver"], "enabled": false - }, - { - "description": "k8s.io/apimachinery is replaced by the cozystack/apimachinery fork at a pseudo-version cut from a rebased branch that carries the ConvertToVersion patch. The fork's release tags are stale upstream mirrors, so Renovate proposes one of them as an 'update' that is in fact a downgrade dropping the patch. Advance the replace by hand whenever the fork is rebased onto a new Kubernetes line.", - "matchManagers": ["gomod"], - "matchPackageNames": ["github.com/cozystack/apimachinery"], - "enabled": false } ] } diff --git a/GOVERNANCE.md b/GOVERNANCE.md index 62e4361c6..6c5f54fe1 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -29,11 +29,9 @@ The Cozystack maintainers are maintainers of every sub-project by default (see [ **Project infrastructure** carries no shipped code: [website](https://github.com/cozystack/website), [community](https://github.com/cozystack/community) (design proposals and meeting notes), [external-apps-example](https://github.com/cozystack/external-apps-example) (the reference third-party application catalogues are built from), [ccp](https://github.com/cozystack/ccp), [.github](https://github.com/cozystack/.github) and [.project](https://github.com/cozystack/.project) (CNCF project metadata). -**Forks of upstream projects** are held for contributing changes back, or were held for that purpose and have since been archived. One is load-bearing and is called out below; the rest are not built into the distribution, which takes those components from their upstreams directly. +**Forks of upstream projects** are held for contributing changes back, or were held for that purpose and have since been archived. None is built into the distribution, which takes those components from their upstreams directly. -Three things about this organisation are worth stating plainly rather than leaving to be discovered. - -**One fork is compiled into the product.** [cozystack/apimachinery](https://github.com/cozystack/apimachinery) is a fork of `kubernetes/apimachinery` carrying a single 34-line patch to `pkg/runtime/scheme.go` on top of the released `v0.35.0` tree, applied through a `replace` directive in `go.mod`. The same fix is proposed upstream as [kubernetes/kubernetes#135537](https://github.com/kubernetes/kubernetes/pull/135537); the fork exists only until that merges, and is pinned to a branch tracking the upstream release rather than to the fork's own trunk. +Two things about this organisation are worth stating plainly rather than leaving to be discovered. **Four repositories are private**, and none of them contributes to the distribution: `security-scanner` (automated CVE monitoring, private because it holds pre-disclosure vulnerability state), `infrastructure` (the organisation's own CI infrastructure-as-code, private because it holds cloud credentials and account topology), one GitHub-created security-advisory workspace, and `talos-preboot-iso`, an archived prototype. Nothing an adopter installs is built from a repository they cannot read. diff --git a/go.mod b/go.mod index 46105c1d5..6109faf15 100644 --- a/go.mod +++ b/go.mod @@ -21,23 +21,24 @@ require ( github.com/prometheus/client_golang v1.24.1 github.com/robfig/cron/v3 v3.0.1 github.com/spf13/cobra v1.10.2 + github.com/spf13/pflag v1.0.10 github.com/vmware-tanzu/velero v1.18.3 go.uber.org/zap v1.28.0 gomodules.xyz/jsonpatch/v2 v2.5.0 - k8s.io/api v0.35.0 - k8s.io/apiextensions-apiserver v0.35.0 - k8s.io/apimachinery v0.35.2 - k8s.io/apiserver v0.35.0 - k8s.io/client-go v0.35.0 - k8s.io/component-base v0.35.0 + k8s.io/api v0.37.1 + k8s.io/apiextensions-apiserver v0.37.1 + k8s.io/apimachinery v0.37.1 + k8s.io/apiserver v0.37.1 + k8s.io/client-go v0.37.1 + k8s.io/component-base v0.37.1 k8s.io/klog/v2 v2.140.0 - k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 + k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 sigs.k8s.io/container-object-storage-interface-api v0.1.0 - sigs.k8s.io/controller-runtime v0.23.1 + sigs.k8s.io/controller-runtime v0.25.1 sigs.k8s.io/gateway-api v1.4.1 sigs.k8s.io/randfill v1.0.0 - sigs.k8s.io/structured-merge-diff/v6 v6.3.2-0.20260122202528-d9cc6641c482 + sigs.k8s.io/structured-merge-diff/v6 v6.4.2 sigs.k8s.io/yaml v1.6.0 ) @@ -79,17 +80,15 @@ require ( github.com/go-openapi/swag/yamlutils v0.29.2 // indirect github.com/go-openapi/testify/enable/yaml/v2 v2.8.0 // indirect github.com/go-openapi/testify/v2 v2.8.0 // indirect - github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/google/btree v1.1.3 // indirect github.com/google/cel-go v0.29.2 // indirect github.com/google/gnostic-models v0.7.1 // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/pprof v0.0.0-20260906184651-6331bc6350fe // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.4 // indirect - github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -99,21 +98,17 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.3 // indirect github.com/prometheus/common v0.71.0 // indirect github.com/prometheus/procfs v0.22.0 // indirect github.com/rogpeppe/go-internal v1.16.0 // indirect github.com/sirupsen/logrus v1.10.2 // indirect - github.com/spf13/pflag v1.0.10 // indirect - github.com/stretchr/objx v0.5.3 // indirect github.com/tidwall/match v1.2.0 // indirect github.com/x448/float16 v0.8.4 // indirect - go.etcd.io/etcd/api/v3 v3.6.15 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.6.15 // indirect - go.etcd.io/etcd/client/v3 v3.6.15 // indirect - go.etcd.io/etcd/server/v3 v3.6.15 // indirect + go.etcd.io/etcd/api/v3 v3.7.0 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.7.0 // indirect + go.etcd.io/etcd/client/v3 v3.7.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.71.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0 // indirect @@ -145,10 +140,8 @@ require ( gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect - k8s.io/kms v0.35.0 // indirect + k8s.io/kms v0.37.1 // indirect + k8s.io/streaming v0.37.1 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.36.0 // indirect sigs.k8s.io/json v0.0.0-20260909141634-11ed52e25bc5 // indirect ) - -// See: issues.k8s.io/135537 -replace k8s.io/apimachinery => github.com/cozystack/apimachinery v0.0.0-20260710062224-763e1451713b diff --git a/go.sum b/go.sum index 90ca65b3c..dea6aaf08 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,6 @@ github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.7.0 h1:LAEzFkke61DFROc7zNLX/WA2i5J8gYqe0rSj9KI28KA= github.com/coreos/go-systemd/v22 v22.7.0/go.mod h1:xNUYtjHu2EDXbsxz1i41wouACIwT7Ybq9o0BQhMwD0w= -github.com/cozystack/apimachinery v0.0.0-20260710062224-763e1451713b h1:/GZSE+YqN4eHfTYbzCFMNiGxxsCa0xm+JuN72yQOuXw= -github.com/cozystack/apimachinery v0.0.0-20260710062224-763e1451713b/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= github.com/cozystack/cozystack-scheduler/pkg/apis v0.1.1 h1:9uLa/8J4lRx3sNuaVH8UZqgZvnskHATPo5GxEKh0iSM= github.com/cozystack/cozystack-scheduler/pkg/apis v0.1.1/go.mod h1:kPeS9YPB4ENbvNINEkkp0SX8FB+gvwoOHGOHMT3Tg9Y= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= @@ -108,14 +106,10 @@ github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1v github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM= github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= -github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/cel-go v0.29.2 h1:ZtDxkeiMmz0mxbKDYiNkE5Lk7V5edMRcaaDf2jX002k= github.com/google/cel-go v0.29.2/go.mod h1:X0bD6iVNR8pkROSOoHVdgTkzmRcosof7WQqCD6wcMc8= github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= @@ -131,13 +125,10 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= -github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= +github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 h1:QGLs/O40yoNK9vmy4rhUGBVyMf1lISBGtXRpsu/Qu/o= +github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0/go.mod h1:hM2alZsMUni80N33RBe6J0e423LB+odMj7d3EMP9l20= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.4 h1:9ZJYjPEJpcleIKcqysXOo14NLQYwu23fzmKRFpIjPjc= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.4/go.mod h1:0xydIeg2omQ9DH6zYMP24Kk57793rnLUvP8fwdbFvz8= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -148,8 +139,6 @@ github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE github.com/joshdk/go-junit v1.0.0/go.mod h1:TiiV0PqkaNfFXjEiyjWM3XXrhVyCa1K4Zfga6W52ung= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.20.0 h1:a3C1ke2ohxFymNlb2HWAHjDeKCI90scRskErZkR0ezA= github.com/klauspost/compress v1.20.0/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -172,8 +161,6 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/onsi/ginkgo/v2 v2.33.0 h1:C8gBA6Uc2ZEubiV+SXiu5tZnMTwEmXHgkJwGozKtZf8= github.com/onsi/ginkgo/v2 v2.33.0/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= github.com/onsi/gomega v1.43.1 h1:vGIPFuYrIO6/0Z09s0I0QQQgFchiX4+tb1re3MScJYo= @@ -227,22 +214,20 @@ github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 h1:S2dVYn90KE98chqDkyE9Z4N61UnQd+KOfgp5Iu53llk= github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo= -go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E= -go.etcd.io/etcd/api/v3 v3.6.15 h1:Nysf/QR7vx8bx5oUR/yeMdy0YqtXoeELxn6UvNANrsQ= -go.etcd.io/etcd/api/v3 v3.6.15/go.mod h1:LlBr6CBsOUN/D011XFeIysDxI7JTQuegCX4DgseoOIw= -go.etcd.io/etcd/client/pkg/v3 v3.6.15 h1:6nqIEsCDLjZDh1fgHuQCSjVFv7pzdSYUq8zzpr9V/28= -go.etcd.io/etcd/client/pkg/v3 v3.6.15/go.mod h1:kCC9d5MnlhpVsgf2JVt2c3ydApI6sZo40vlnr79jGKU= -go.etcd.io/etcd/client/v3 v3.6.15 h1:qQUBZNaqSmKKoLRsEcBvnZ0dzwbSrvnCZXxjmRJuHuE= -go.etcd.io/etcd/client/v3 v3.6.15/go.mod h1:peNUITf/Kbpm14YCLIAHeqQFDTkvqLPK71p0Lcz/cqc= -go.etcd.io/etcd/pkg/v3 v3.6.15 h1:LyJ+AOftel5J97A6i5eiDSplXH89y2TpeaHunUBe2sg= -go.etcd.io/etcd/pkg/v3 v3.6.15/go.mod h1:Cka235NdNGX93CscaD5LtEApThVO2HHnBl76pwmWGQs= -go.etcd.io/etcd/server/v3 v3.6.15 h1:IFlqNq0ia29PAcT73gfZjaYO/R+QCOavhenkAP4Y1N0= -go.etcd.io/etcd/server/v3 v3.6.15/go.mod h1:zuF7XwGYkIj7fFtUMYp+AFpa+SdnNj05sbsabmUnGrY= -go.etcd.io/raft/v3 v3.6.0 h1:5NtvbDVYpnfZWcIHgGRk9DyzkBIXOi8j+DDp1IcnUWQ= -go.etcd.io/raft/v3 v3.6.0/go.mod h1:nLvLevg6+xrVtHUmVaTcTz603gQPHfh7kUAwV6YpfGo= +go.etcd.io/bbolt v1.5.0 h1:S7GAl7Fxv12yohbwFfIbQCGDWbQbtDGPET4P/bD4lxU= +go.etcd.io/bbolt v1.5.0/go.mod h1:mkltfYE5aUHQxUct9N9V+Kp7aSjFqjgrhcXIS70Lrdk= +go.etcd.io/etcd/api/v3 v3.7.0 h1:WZlGK7pRtYGDB8ti8wkrQ5D2oWGMbtNL9VA5e+vF2Fg= +go.etcd.io/etcd/api/v3 v3.7.0/go.mod h1:EcTihnwAQ0BQNh5dfAdaFVFdchuo7EP0HlX7TV3jz/A= +go.etcd.io/etcd/client/pkg/v3 v3.7.0 h1:sW9njJzS3vXKcAJjjLQ4nk+avNUJ12Bcijcx8ehUskE= +go.etcd.io/etcd/client/pkg/v3 v3.7.0/go.mod h1:cnzZGIUzSfjEwLC6UBVsSXlEK1eepS/JUD7wE6PLRT0= +go.etcd.io/etcd/client/v3 v3.7.0 h1:5MHO37VbPB87VRPKUXEcicjeQWiTSjpPv3Ume8xPx20= +go.etcd.io/etcd/client/v3 v3.7.0/go.mod h1:DJ382WuwjmbowjPDyaaQ0idWXy4dh91XRhe4FOrb9vM= +go.etcd.io/etcd/pkg/v3 v3.7.0 h1:aUBHGzXnYL2m3AlZfKp0ZhHQLVZIKfu9QsIlYdr+mxc= +go.etcd.io/etcd/pkg/v3 v3.7.0/go.mod h1:fDQYyc8rOC1Yl4EZLh0O1OjHzwJW7jAly80+BpD1M9o= +go.etcd.io/etcd/server/v3 v3.7.0 h1:ScdUdN8ljuimp0lZaNq0otLMrHcFSFT+dQyT1j7JSFo= +go.etcd.io/etcd/server/v3 v3.7.0/go.mod h1:v7N1dPdSW2vzyxGsbDwK4X0sCe3SYNlQ+9eNIMGzdxQ= +go.etcd.io/raft/v3 v3.7.0 h1:BGzlwx07bLv8PW6OU5HObuz1y4hlPZUXA07pM1mPUh4= +go.etcd.io/raft/v3 v3.7.0/go.mod h1:6gX6T2X907DjnjsFLODnTxba77stjs84W9gTTI0GUNA= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.71.0 h1:B2h3uqicet1CT2N5TOFhS+Gq++9i0/CLmaxvhmhtP5s= @@ -276,53 +261,28 @@ go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M= golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA= golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba h1:Ck8QetSgk912qxWLMCKxd0in+aiyBQyDSMae6e/xmpU= golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba/go.mod h1:50RgIsmK7OwqzTTeqcSXQW8SswW0o8fRcDxmqGluJ8E= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c= golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.59.0 h1:5zfYln+w5XCxwrnMMJPufRgNoXEaGxl0wo5GqPXyues= golang.org/x/net v0.59.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= golang.org/x/oauth2 v0.37.0 h1:JUlcxA8oAtauLfiH8FX2/FkAWHAdi0QtGCGc+hofE98= golang.org/x/oauth2 v0.37.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/58= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= golang.org/x/term v0.46.0 h1:3+OXuTbaKDgwk8jTi3aSLHRlmWqHEUDUtxnbFigO4YE= golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE= golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.50.0 h1:c2ifzfcuY7L90lZ2aKd8S4K2NpASF08SZx9ZuJkHmSU= golang.org/x/tools v0.50.0/go.mod h1:7ulVMw3831Mwi5EZD6RomGyffr4VFjuNYXf2BbCEAV0= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0= gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= @@ -344,37 +304,41 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.35.0 h1:iBAU5LTyBI9vw3L5glmat1njFK34srdLmktWwLTprlY= -k8s.io/api v0.35.0/go.mod h1:AQ0SNTzm4ZAczM03QH42c7l3bih1TbAXYo0DkF8ktnA= -k8s.io/apiextensions-apiserver v0.35.0 h1:3xHk2rTOdWXXJM+RDQZJvdx0yEOgC0FgQ1PlJatA5T4= -k8s.io/apiextensions-apiserver v0.35.0/go.mod h1:E1Ahk9SADaLQ4qtzYFkwUqusXTcaV2uw3l14aqpL2LU= -k8s.io/apiserver v0.35.0 h1:CUGo5o+7hW9GcAEF3x3usT3fX4f9r8xmgQeCBDaOgX4= -k8s.io/apiserver v0.35.0/go.mod h1:QUy1U4+PrzbJaM3XGu2tQ7U9A4udRRo5cyxkFX0GEds= -k8s.io/client-go v0.35.0 h1:IAW0ifFbfQQwQmga0UdoH0yvdqrbwMdq9vIFEhRpxBE= -k8s.io/client-go v0.35.0/go.mod h1:q2E5AAyqcbeLGPdoRB+Nxe3KYTfPce1Dnu1myQdqz9o= -k8s.io/component-base v0.35.0 h1:+yBrOhzri2S1BVqyVSvcM3PtPyx5GUxCK2tinZz1G94= -k8s.io/component-base v0.35.0/go.mod h1:85SCX4UCa6SCFt6p3IKAPej7jSnF3L8EbfSyMZayJR0= +k8s.io/api v0.37.1 h1:l6N77U7tjwB5L056bgrBTJIEdevac/naBZ3iSvDNfpM= +k8s.io/api v0.37.1/go.mod h1:zSlbB1YpJ1YQlFVQy20UYll81UJSJJUMLhkhvg6Z78M= +k8s.io/apiextensions-apiserver v0.37.1 h1:7fIQG8eThDSTVYBWg/DOpI8v5wYfKCo0N8/TDMjj+zY= +k8s.io/apiextensions-apiserver v0.37.1/go.mod h1:1Q3ujWwHgnhBoGsdmGORflwK1sDFmuaqH1OsMDWk2Gs= +k8s.io/apimachinery v0.37.1 h1:hGCYyvKHCwtwMitj2vU4vYx0Z16N9GyZk9BBnz0wDAE= +k8s.io/apimachinery v0.37.1/go.mod h1:jF84AyUi/IRIXRot5f+lm6MpxoWI+F1XgjaMmwCdTFw= +k8s.io/apiserver v0.37.1 h1:dUsNwjsvItyVKNpC1N0AhQ0OBSiUJKfWz004vPifOe0= +k8s.io/apiserver v0.37.1/go.mod h1:EWXW6PntGfOC2uD9GGVobnOExgFoX1z0hZo7f7Rs7Ng= +k8s.io/client-go v0.37.1 h1:QTv/5ha4jAHtW9qxxVBkQVFBRDb4jHfFopQqqMdc+wM= +k8s.io/client-go v0.37.1/go.mod h1:dnAPtTnCNY38Ho04D2KdY1F4IKausa9UbqaAZKl60SY= +k8s.io/component-base v0.37.1 h1:93DMmlENnK7gNLkL4pMqLO5M/HVf3p3sM4q/GasLveY= +k8s.io/component-base v0.37.1/go.mod h1:bBrdziT4dreQG5lzTaPVxBwsZe1oxphG+ZVdD56dQWQ= k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= -k8s.io/kms v0.35.0 h1:/x87FED2kDSo66csKtcYCEHsxF/DBlNl7LfJ1fVQs1o= -k8s.io/kms v0.35.0/go.mod h1:VT+4ekZAdrZDMgShK37vvlyHUVhwI9t/9tvh0AyCWmQ= -k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 h1:Y3gxNAuB0OBLImH611+UDZcmKS3g6CthxToOb37KgwE= -k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= +k8s.io/kms v0.37.1 h1:MD1kA8AdFF/N5sGP8gnvL6vTo/oeaQXbmLjWmmJHLc8= +k8s.io/kms v0.37.1/go.mod h1:0U6zfwLkfJr9O/jLgz2GARnKLh2uIhkq2EeaU66J5ow= +k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad h1:oXImqH8mQNk7PmvzKhmN3ddJoY6OnyM225MXwGHPm0A= +k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad/go.mod h1:0/mqHCVhlumdJ3BhCfnjSZQE037nAhNodh1/hK0T8/I= +k8s.io/streaming v0.37.1 h1:TpzVfQeFuVndn2g9mFqxy1UcUYPwDzqjUmwR/IzJCWc= +k8s.io/streaming v0.37.1/go.mod h1:APlJR26ZWRcVy5bIEj0QRrKUXROtBHPcxl2NT7EAzPU= k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 h1:jVkFFVfXdXP74B/zbO3hM3hpSFD0xvhQ5U686DPurkE= k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3/go.mod h1:M2s5JB1lIYP3jzZdorPLHXIPJzt9vv2muW5a6L9DtNM= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.36.0 h1:/YpDJ4vReG7ZmzSpBGxduXgywWkJU9zHubgJG03MT+Y= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.36.0/go.mod h1:tJo1aepTXyR+8Xs3sUsGBDk4Ub2AM5dPAPKJx0mpm5c= sigs.k8s.io/container-object-storage-interface-api v0.1.0 h1:8tB6JFQhbQIC1hwGQ+q4+tmSSNfjKemb7bFI6C0CK/4= sigs.k8s.io/container-object-storage-interface-api v0.1.0/go.mod h1:YiB+i/UGkzqgODDhRG3u7jkbWkQcoUeLEJ7hwOT/2Qk= -sigs.k8s.io/controller-runtime v0.23.1 h1:TjJSM80Nf43Mg21+RCy3J70aj/W6KyvDtOlpKf+PupE= -sigs.k8s.io/controller-runtime v0.23.1/go.mod h1:B6COOxKptp+YaUT5q4l6LqUJTRpizbgf9KSRNdQGns0= +sigs.k8s.io/controller-runtime v0.25.1 h1:BKgU9OeE8xv8EbbM8cY0NVzTQs35rokkdq1jh12fMb4= +sigs.k8s.io/controller-runtime v0.25.1/go.mod h1:4QqLdT6z/L6Olj8JJCtvztid4/fnIiYsfaTFScegctc= sigs.k8s.io/gateway-api v1.4.1 h1:NPxFutNkKNa8UfLd2CMlEuhIPMQgDQ6DXNKG9sHbJU8= sigs.k8s.io/gateway-api v1.4.1/go.mod h1:AR5RSqciWP98OPckEjOjh2XJhAe2Na4LHyXD2FUY7Qk= sigs.k8s.io/json v0.0.0-20260909141634-11ed52e25bc5 h1:k9jo7ED/fsfOcz3L1P20P5tjTNtsdQNwMOG2aKzHrl8= sigs.k8s.io/json v0.0.0-20260909141634-11ed52e25bc5/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= -sigs.k8s.io/structured-merge-diff/v6 v6.3.2-0.20260122202528-d9cc6641c482 h1:2WOzJpHUBVrrkDjU4KBT8n5LDcj824eX0I5UKcgeRUs= -sigs.k8s.io/structured-merge-diff/v6 v6.3.2-0.20260122202528-d9cc6641c482/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/structured-merge-diff/v6 v6.4.2 h1:qdOxHwrl2Kaag1aQEarlYcOA9vSyGCp3CIki3aW8c4Q= +sigs.k8s.io/structured-merge-diff/v6 v6.4.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index c8fb2456f..95fcee632 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -24,8 +24,8 @@ SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. # for `code-generator@vX.Y.Z` and expects exactly one match, so keep # the version literal only in CODEGEN_PKG (not duplicated in any # comment) — bump both lines together when upgrading. -CODEGEN_VERSION=v0.35.0 -CODEGEN_PKG=${CODEGEN_PKG:-~/go/pkg/mod/k8s.io/code-generator@v0.35.0} +CODEGEN_VERSION=v0.37.1 +CODEGEN_PKG=${CODEGEN_PKG:-~/go/pkg/mod/k8s.io/code-generator@v0.37.1} # Pre-fetch the code-generator module if it is not yet in the local # module cache. We intentionally do not declare k8s.io/code-generator diff --git a/internal/controller/tenantgateway/crdcel_test.go b/internal/controller/tenantgateway/crdcel_test.go index b9a1b4a21..5fbad5418 100644 --- a/internal/controller/tenantgateway/crdcel_test.go +++ b/internal/controller/tenantgateway/crdcel_test.go @@ -511,7 +511,7 @@ func TestCRDPassesInstallTimeValidation(t *testing.T) { // list-type semantics only when the stored object passes them, for the // object as a whole. That is read from // pkg/registry/customresource/strategy.go in apiextensions-apiserver -// v0.35.0, the version go.mod pins. So a stored duplicate does not block writes, it +// v0.37.1, the version go.mod pins. So a stored duplicate does not block writes, it // stops every list on the resource from being checked. The duplicate // row below therefore stays admissible whether or not the field carries // a marker, which is why the marker's absence is pinned by the schema @@ -556,7 +556,7 @@ func TestTightenedConstraintsOnExistingObjects(t *testing.T) { // guard is reproduced here rather than exercised. Dropping it would // model an apiserver that refuses writes it accepts. Reproduced // means it does not track upstream, so a bump of - // apiextensions-apiserver past the pinned v0.35.0 is where to + // apiextensions-apiserver past the pinned v0.37.1 is where to // re-read strategy.go and confirm the shape still holds. rejectsUpdate := func(newSpec, oldSpec map[string]any) bool { if errs := apiservervalidation.ValidateCustomResourceUpdate( @@ -633,9 +633,9 @@ func TestTightenedConstraintsOnExistingObjects(t *testing.T) { // write. It would not: customresource.ValidateUpdate validates the // incoming object's list-type semantics only when the stored object // passes them, so a duplicate already in etcd is ratcheted through. -// Byte-identical across apiextensions-apiserver v0.31.1, the pinned -// v0.35.0 and v0.36.3, so it is settled behaviour rather than a version -// quirk, but it is upstream's to change. The +// That guard is byte-identical across apiextensions-apiserver v0.31.1, +// v0.35.0, v0.36.3 and the pinned v0.37.1, so it is settled behaviour +// rather than a version quirk, but it is upstream's to change. The // reason is the grain of that ratchet. It is taken over the whole // object, not per field, so one stored duplicate stops list-type // validation for every list on the resource, silently and with nothing diff --git a/internal/securitygroupcontroller/cilium.go b/internal/securitygroupcontroller/cilium.go index 75ece3188..61a1e0950 100644 --- a/internal/securitygroupcontroller/cilium.go +++ b/internal/securitygroupcontroller/cilium.go @@ -13,8 +13,11 @@ import ( // CiliumNetworkPolicy resource. The securitygroup-controller only reads a // policy's marker label, its attachments annotation and its finalizers — never // the spec — so this mirror deliberately omits the spec entirely, keeping the -// controller binary free of the full Cilium module (whose Kubernetes pin is -// incompatible with this project's apimachinery fork). +// controller binary free of the full Cilium module. Importing it would tie this +// project's k8s.io libraries to Cilium's: Go builds with the higher of the two +// required versions, so a Cilium release built on a newer Kubernetes would drag +// them forward, and one built on an older Kubernetes would have to compile +// against ours. // // NEVER Update an object of this type: a PUT would serialize it without a spec // and wipe the real policy's rules. Finalizer changes go through MergeFrom diff --git a/packages/extra/gateway/README.md b/packages/extra/gateway/README.md index 56ab5bee8..1b507e3ad 100644 --- a/packages/extra/gateway/README.md +++ b/packages/extra/gateway/README.md @@ -108,7 +108,7 @@ Before upgrading, check one thing about `api.` in particular: once the ter If something does depend on that terminate path, there are three ways forward and they are not equivalent. Moving the consumer to another hostname under the apex costs nothing: a name outside `tlsPassthroughServices` still earns its own terminate listener and ACME certificate, while the passthrough name goes on answering the platform's own `TLSRoute`. Switching `certMode` to `dns01` or `existingSecret` keeps the pre-upgrade shape wholesale, since neither mode renders per-hostname listeners and the wildcard covers passthrough names along with everything else, at the price of DNS-01 credentials or an operator-supplied certificate, and both modes refuse `tlsPassthroughListeners` outright. Keeping the pre-upgrade shape is the caveat, not the benefit: those modes leave the `tls-` passthrough listeners standing beside the wildcard terminate listener that covers their names, so the undetermined race returns with them. Both port-443 filter chains carry the same SNI again, and on the pinned Cilium nothing on the objects says which one answers, with no `Conflicted` condition to read. Someone picking this path to get termination back gets the pre-upgrade ambiguity back instead. Removing a service from `tlsPassthroughServices` does not bring its terminate listener back, and that is the point worth reading twice: the passthrough listener goes, the platform `TLSRoute` that attached to it by `sectionName: tls-` has nothing left to attach to, and the hostname is then claimed by a `TLSRoute` alone, which earns no terminate listener either. Nothing serves the name until something else claims it. So this path is a rewrite rather than a rollback, and it is only finished once the component is republished by an `HTTPRoute` on that hostname, which does earn a terminate listener and a certificate. For `api` that is the Kubernetes API endpoint, and passthrough means its clients hold a TLS session with the apiserver itself; terminating in front of it changes what that session authenticates against, so check what your clients present before picking this one. -Schema constraints tightened alongside this field reach objects that already exist, and every one of them is a kind the apiserver ratchets. `apex` is bounded at 253 characters, and `tlsPassthroughServices` at 62 entries each a DNS-1123 subdomain of at most 249 characters; a stored value that violates one still passes any write that leaves it unchanged, and the rule bites only once the value itself changes. `apex` gets no format pattern, deliberately, and that is not a statement that a mixed-case host works. It arrives verbatim from the `namespace.cozystack.io/host` label, which nothing normalizes and which may hold upper case, and the controller then composes listener hostnames from it that Gateway API refuses, so such a tenant's Gateway does not render with or without a pattern here. What a pattern changes is only where that lands: refused at the write it fails this HelmRelease and everything the release owns, admitted it is `Ready=False` on the one Gateway. An apex no listener hostname can sit within is caught only when `tlsPassthroughListeners` is in use, and then by the containment rule rather than by the controller: that CEL rule compares bytes as well, so a mixed-case apex with a lowercase listener hostname is refused at the write, with a message naming the hostname, and the controller's own check, which names the apex, is reached only where the CRD lags the controller. A repeated `tlsPassthroughServices` entry is reported by the controller as `Ready=False` rather than refused at admission, and that is deliberate, though not for the reason symmetry suggests. Ratcheting does reach a list-type error, and at a coarser grain than the rest: the apiserver checks an incoming object's list-type semantics only when the stored object passes them, for the whole object at once (read from `pkg/registry/customresource/strategy.go` in the pinned `k8s.io/apiextensions-apiserver` v0.35.0). So declaring the list a set would not block writes to an object already carrying a duplicate; it would stop every list on that `TenantGateway` from being checked at all, silently, while the duplicate the controller can name goes on being reported by name. The shipped defaults and the chart's own `fail` on an empty host conform to all of it, and for `tlsPassthroughServices` nothing else can reach the field: the only key the tenant writes into this chart's HelmRelease values is `gatewayClassName`, and only when the tenant chose a class, while everything else arrives through `valuesFrom` the `cozystack-values` Secret, and the platform writes no such key into that Secret, so the chart default is the only value that arrives and the bounds guard a value only an edit to this chart can change. An upgrade is a no-op. +Schema constraints tightened alongside this field reach objects that already exist, and every one of them is a kind the apiserver ratchets. `apex` is bounded at 253 characters, and `tlsPassthroughServices` at 62 entries each a DNS-1123 subdomain of at most 249 characters; a stored value that violates one still passes any write that leaves it unchanged, and the rule bites only once the value itself changes. `apex` gets no format pattern, deliberately, and that is not a statement that a mixed-case host works. It arrives verbatim from the `namespace.cozystack.io/host` label, which nothing normalizes and which may hold upper case, and the controller then composes listener hostnames from it that Gateway API refuses, so such a tenant's Gateway does not render with or without a pattern here. What a pattern changes is only where that lands: refused at the write it fails this HelmRelease and everything the release owns, admitted it is `Ready=False` on the one Gateway. An apex no listener hostname can sit within is caught only when `tlsPassthroughListeners` is in use, and then by the containment rule rather than by the controller: that CEL rule compares bytes as well, so a mixed-case apex with a lowercase listener hostname is refused at the write, with a message naming the hostname, and the controller's own check, which names the apex, is reached only where the CRD lags the controller. A repeated `tlsPassthroughServices` entry is reported by the controller as `Ready=False` rather than refused at admission, and that is deliberate, though not for the reason symmetry suggests. Ratcheting does reach a list-type error, and at a coarser grain than the rest: the apiserver checks an incoming object's list-type semantics only when the stored object passes them, for the whole object at once (read from `pkg/registry/customresource/strategy.go` in the pinned `k8s.io/apiextensions-apiserver` v0.37.1). So declaring the list a set would not block writes to an object already carrying a duplicate; it would stop every list on that `TenantGateway` from being checked at all, silently, while the duplicate the controller can name goes on being reported by name. The shipped defaults and the chart's own `fail` on an empty host conform to all of it, and for `tlsPassthroughServices` nothing else can reach the field: the only key the tenant writes into this chart's HelmRelease values is `gatewayClassName`, and only when the tenant chose a class, while everything else arrives through `valuesFrom` the `cozystack-values` Secret, and the platform writes no such key into that Secret, so the chart default is the only value that arrives and the bounds guard a value only an edit to this chart can change. An upgrade is a no-op. ## Parameters diff --git a/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_altinities.yaml b/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_altinities.yaml index 3736dd612..ceb08e8f3 100644 --- a/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_altinities.yaml +++ b/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_altinities.yaml @@ -1077,7 +1077,9 @@ spec: description: Selects a key of a ConfigMap. properties: key: - description: The key to select. + description: |- + The key to select from the ConfigMap's Data field. + Keys in the BinaryData field are not currently propagated to container env vars. type: string name: default: "" @@ -1352,6 +1354,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -1466,6 +1473,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -1548,6 +1560,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -1606,6 +1625,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -1763,6 +1787,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -1821,6 +1852,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -2122,7 +2158,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -2277,6 +2312,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -2335,6 +2377,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -2476,10 +2523,21 @@ spec: description: VolumeMount describes a mounting of a Volume within a container. properties: - mountPath: + bindMountOptions: description: |- - Path within the container at which the volume should be mounted. Must - not contain ':'. + bindMountOptions is the list of additional bind mount options to apply when + mounting this volume into the container. Allowed values are noexec, + nodev, and nosuid. These are Linux mount options and have no effect on + Windows nodes. + This field is not supported with image volumes. + This is an alpha field and requires enabling the VolumeBindMountOptions feature gate. + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + description: Path within the container at which + the volume should be mounted. type: string mountPropagation: description: |- @@ -2691,7 +2749,9 @@ spec: description: Selects a key of a ConfigMap. properties: key: - description: The key to select. + description: |- + The key to select from the ConfigMap's Data field. + Keys in the BinaryData field are not currently propagated to container env vars. type: string name: default: "" @@ -2963,6 +3023,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -3077,6 +3142,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -3155,6 +3225,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -3213,6 +3290,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -3358,6 +3440,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -3416,6 +3505,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -3693,7 +3787,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -3841,6 +3934,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -3899,6 +3999,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -4049,10 +4154,21 @@ spec: description: VolumeMount describes a mounting of a Volume within a container. properties: - mountPath: + bindMountOptions: description: |- - Path within the container at which the volume should be mounted. Must - not contain ':'. + bindMountOptions is the list of additional bind mount options to apply when + mounting this volume into the container. Allowed values are noexec, + nodev, and nosuid. These are Linux mount options and have no effect on + Windows nodes. + This field is not supported with image volumes. + This is an alpha field and requires enabling the VolumeBindMountOptions feature gate. + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + description: Path within the container at which + the volume should be mounted. type: string mountPropagation: description: |- @@ -4124,6 +4240,63 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map + evictionResponders: + description: |- + evictionResponders reference responders that react to Evictions based on EvictionRequests. + Responders should observe and communicate through the Eviction Resource API to help with + the graceful termination of a pod. The responders are selected sequentially, according to + their specified priority. + + Responders should periodically report on an eviction progress by updating the + .status.responders[].heartbeatTime field of the Eviction object. If this field is not updated + within the heartbeat deadline defined by the Eviction API (currently 20 minutes), the eviction + is passed over to the next responder with a lower priority. If there is no other responder, + the last default imperative-eviction.k8s.io/evictor responder with a priority of 100 will + evict the pod using the imperative Eviction API (pods//eviction subresource). + + The maximum length of the responders list is 10. + Responders are not supported when the pod is part of a PodGroup (.spec.schedulingGroup is set). + This field can only be set on creation and is immutable afterwards. + items: + description: |- + EvictionResponder allows you to specify the responder reacting to an Eviction. + Responders should observe and communicate through the Eviction Resource API to help with + the graceful eviction of a target (e.g. termination of a pod). + properties: + name: + description: |- + name allows you to identify the responder responding to the Eviction. + + It must be a valid domain-prefixed key (such as "acme.io/foo"). + Domain names *.k8s.io and *.kubernetes.io are reserved. + This field must be unique for each responder. + This field is required. + type: string + priority: + description: |- + priority for this responder. Higher priorities are selected first by the evictionrequest-controller. + If there are responders with the same priority, the responder whose domain name comes first in the + alphabetical higher domain order, will be picked. This means that the top domain labels are compared + alphabetically first, followed by the lower domain labels. The key is compared last. + + The responder that is the managing controller of the pod should set the value of + this field to 10000 to allow both for preemption or fallback registration by other + responders. + + The minimum value is 0 and the maximum value is 100000. + The interval 0-999 is reserved for responders with *.k8s.io suffix. + This field is required. + format: int32 + type: integer + required: + - name + - priority + type: object + x-kubernetes-map-type: atomic + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map hostAliases: description: |- HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts @@ -4177,7 +4350,6 @@ spec: When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host. - This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature. type: boolean hostname: description: |- @@ -4195,7 +4367,6 @@ spec: - `hostNetwork` must be set to false. This field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. - Requires the HostnameOverride feature gate to be enabled. type: string imagePullSecrets: description: |- @@ -4302,7 +4473,9 @@ spec: description: Selects a key of a ConfigMap. properties: key: - description: The key to select. + description: |- + The key to select from the ConfigMap's Data field. + Keys in the BinaryData field are not currently propagated to container env vars. type: string name: default: "" @@ -4577,6 +4750,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -4691,6 +4869,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -4773,6 +4956,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -4831,6 +5021,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -4988,6 +5183,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -5046,6 +5248,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -5347,7 +5554,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -5502,6 +5708,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -5560,6 +5773,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -5701,10 +5919,21 @@ spec: description: VolumeMount describes a mounting of a Volume within a container. properties: - mountPath: + bindMountOptions: description: |- - Path within the container at which the volume should be mounted. Must - not contain ':'. + bindMountOptions is the list of additional bind mount options to apply when + mounting this volume into the container. Allowed values are noexec, + nodev, and nosuid. These are Linux mount options and have no effect on + Windows nodes. + This field is not supported with image volumes. + This is an alpha field and requires enabling the VolumeBindMountOptions feature gate. + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + description: Path within the container at which + the volume should be mounted. type: string mountPropagation: description: |- @@ -5858,6 +6087,8 @@ spec: description: |- PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. + When Priority Admission Controller is enabled, it prevents users from setting + this field. The admission controller populates this field from PriorityClassName. Defaults to PreemptLowerPriority if unset. type: string priority: @@ -5916,6 +6147,14 @@ spec: It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. + + When the DRAWorkloadResourceClaims feature gate is enabled and this Pod + belongs to a PodGroup, a PodResourceClaim is matched to a + PodGroupResourceClaim if all of their fields are equal (Name, + ResourceClaimName, and ResourceClaimTemplateName). A matched claim references + a single ResourceClaim shared across all Pods in the PodGroup, reserved for + the PodGroup in ResourceClaimStatus.ReservedFor rather than for individual + Pods. properties: name: description: |- @@ -5941,6 +6180,16 @@ spec: generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. + When the DRAWorkloadResourceClaims feature gate is enabled and the pod + belongs to a PodGroup that defines a PodGroupResourceClaim with the same + Name and ResourceClaimTemplateName, this PodResourceClaim resolves to the + ResourceClaim generated for the PodGroup. All pods in the group that + define an equivalent PodResourceClaim matching the + PodGroupResourceClaim's Name and ResourceClaimTemplateName share the same + generated ResourceClaim. ResourceClaims generated for a PodGroup are + owned by the PodGroup and their lifecycles are tied to the PodGroup + instead of any individual pod. + This field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim. @@ -6066,6 +6315,28 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map + schedulingGroup: + description: |- + SchedulingGroup provides a reference to the immediate scheduling runtime + grouping object that this Pod belongs to. + This field is used by the scheduler to identify the group and apply the + correct group scheduling policies. The association with a group also + impacts other lifecycle aspects of a Pod that are relevant in a wider context + of scheduling like preemption, resource attachment, etc. If not specified, + the Pod is treated as a single unit in all of these aspects. + The group object referenced by this field may not exist at the time the + Pod is created. + This field is immutable, but a group object with the same name may be + recreated with different policies. Doing this during pod scheduling + may result in the placement not conforming to the expected policies. + properties: + podGroupName: + description: |- + PodGroupName specifies the name of the standalone PodGroup object + that represents the runtime instance of this group. + Must be a DNS subdomain. + type: string + type: object securityContext: description: |- SecurityContext holds pod-level security attributes and common container settings. @@ -6162,11 +6433,8 @@ spec: Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. - "MountOption" value is allowed only when SELinuxMount feature gate is enabled. - If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - and "Recursive" for all other volumes. + If not specified, "MountOption" is used. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. @@ -6786,6 +7054,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer items: description: |- items if unspecified, each key-value pair in the Data field of the referenced @@ -6819,6 +7094,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -6906,6 +7188,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer items: description: Items is a list of downward API volume file @@ -6974,6 +7263,13 @@ spec: - resource type: object x-kubernetes-map-type: atomic + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -6992,6 +7288,18 @@ spec: Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir type: string + mode: + description: |- + mode specifies the permission bits for the emptyDir directory, in numeric + notation (e.g., 0755, 01777). Must be a value between 0000 and 01777. + If not specified, defaults to 0777. + This might be in conflict with other options that affect the file + mode, like fsGroup. If fsGroup is specified, the fsGroup permissions + will override the mode specified here. + This field has no effect on Windows. + This field is alpha and requires EmptyDirVolumeMode featuregate to be enabled. + format: int32 + type: integer sizeLimit: anyOf: - type: integer @@ -7085,8 +7393,8 @@ spec: * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. - When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, - and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be + copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: @@ -7131,7 +7439,6 @@ spec: specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: @@ -7494,7 +7801,7 @@ spec: A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. - The volume will be mounted read-only (ro) and non-executable files (noexec). + The volume will be mounted read-only (ro). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. properties: @@ -7666,8 +7973,7 @@ spec: description: |- portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type - are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate - is on. + are redirected to the pxd.portworx.com CSI driver. properties: fsType: description: |- @@ -7701,6 +8007,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer sources: description: |- sources is the list of volume projections. Each entry in this list @@ -7801,6 +8114,13 @@ spec: Mutually-exclusive with name. The contents of all selected ClusterTrustBundles will be unified and deduplicated. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -7841,6 +8161,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -7940,6 +8267,13 @@ spec: - resource type: object x-kubernetes-map-type: atomic + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -8047,6 +8381,13 @@ spec: description: Kubelet's generated CSRs will be addressed to this signer. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer userAnnotations: additionalProperties: type: string @@ -8106,6 +8447,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -8153,6 +8501,13 @@ spec: path is the path relative to the mount point of the file to project the token into. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -8359,6 +8714,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer items: description: |- items If unspecified, each key-value pair in the Data field of the referenced @@ -8392,6 +8754,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -8490,42 +8859,6 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map - workloadRef: - description: |- - WorkloadRef provides a reference to the Workload object that this Pod belongs to. - This field is used by the scheduler to identify the PodGroup and apply the - correct group scheduling policies. The Workload object referenced - by this field may not exist at the time the Pod is created. - This field is immutable, but a Workload object with the same name - may be recreated with different policies. Doing this during pod scheduling - may result in the placement not conforming to the expected policies. - properties: - name: - description: |- - Name defines the name of the Workload object this Pod belongs to. - Workload must be in the same namespace as the Pod. - If it doesn't match any existing Workload, the Pod will remain unschedulable - until a Workload object is created and observed by the kube-scheduler. - It must be a DNS subdomain. - type: string - podGroup: - description: |- - PodGroup is the name of the PodGroup within the Workload that this Pod - belongs to. If it doesn't match any existing PodGroup within the Workload, - the Pod will remain unschedulable until the Workload object is recreated - and observed by the kube-scheduler. It must be a DNS label. - type: string - podGroupReplicaKey: - description: |- - PodGroupReplicaKey specifies the replica key of the PodGroup to which this - Pod belongs. It is used to distinguish pods belonging to different replicas - of the same pod group. The pod group policy is applied separately to each replica. - When set, it must be a DNS label. - type: string - required: - - name - - podGroup - type: object required: - containers type: object diff --git a/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_foundationdbs.yaml b/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_foundationdbs.yaml index 828bc13a5..7becb4601 100644 --- a/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_foundationdbs.yaml +++ b/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_foundationdbs.yaml @@ -1097,7 +1097,9 @@ spec: description: Selects a key of a ConfigMap. properties: key: - description: The key to select. + description: |- + The key to select from the ConfigMap's Data field. + Keys in the BinaryData field are not currently propagated to container env vars. type: string name: default: "" @@ -1376,6 +1378,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -1493,6 +1500,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -1575,6 +1587,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -1634,6 +1653,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -1791,6 +1815,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -1850,6 +1881,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -2151,7 +2187,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -2306,6 +2341,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -2365,6 +2407,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -2506,10 +2553,21 @@ spec: description: VolumeMount describes a mounting of a Volume within a container. properties: - mountPath: + bindMountOptions: description: |- - Path within the container at which the volume should be mounted. Must - not contain ':'. + bindMountOptions is the list of additional bind mount options to apply when + mounting this volume into the container. Allowed values are noexec, + nodev, and nosuid. These are Linux mount options and have no effect on + Windows nodes. + This field is not supported with image volumes. + This is an alpha field and requires enabling the VolumeBindMountOptions feature gate. + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + description: Path within the container at + which the volume should be mounted. type: string mountPropagation: description: |- @@ -2722,7 +2780,9 @@ spec: description: Selects a key of a ConfigMap. properties: key: - description: The key to select. + description: |- + The key to select from the ConfigMap's Data field. + Keys in the BinaryData field are not currently propagated to container env vars. type: string name: default: "" @@ -2998,6 +3058,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -3115,6 +3180,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -3194,6 +3264,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -3253,6 +3330,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -3400,6 +3482,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -3459,6 +3548,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -3736,7 +3830,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -3885,6 +3978,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -3944,6 +4044,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -4094,10 +4199,21 @@ spec: description: VolumeMount describes a mounting of a Volume within a container. properties: - mountPath: + bindMountOptions: description: |- - Path within the container at which the volume should be mounted. Must - not contain ':'. + bindMountOptions is the list of additional bind mount options to apply when + mounting this volume into the container. Allowed values are noexec, + nodev, and nosuid. These are Linux mount options and have no effect on + Windows nodes. + This field is not supported with image volumes. + This is an alpha field and requires enabling the VolumeBindMountOptions feature gate. + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + description: Path within the container at + which the volume should be mounted. type: string mountPropagation: description: |- @@ -4170,6 +4286,63 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map + evictionResponders: + description: |- + evictionResponders reference responders that react to Evictions based on EvictionRequests. + Responders should observe and communicate through the Eviction Resource API to help with + the graceful termination of a pod. The responders are selected sequentially, according to + their specified priority. + + Responders should periodically report on an eviction progress by updating the + .status.responders[].heartbeatTime field of the Eviction object. If this field is not updated + within the heartbeat deadline defined by the Eviction API (currently 20 minutes), the eviction + is passed over to the next responder with a lower priority. If there is no other responder, + the last default imperative-eviction.k8s.io/evictor responder with a priority of 100 will + evict the pod using the imperative Eviction API (pods//eviction subresource). + + The maximum length of the responders list is 10. + Responders are not supported when the pod is part of a PodGroup (.spec.schedulingGroup is set). + This field can only be set on creation and is immutable afterwards. + items: + description: |- + EvictionResponder allows you to specify the responder reacting to an Eviction. + Responders should observe and communicate through the Eviction Resource API to help with + the graceful eviction of a target (e.g. termination of a pod). + properties: + name: + description: |- + name allows you to identify the responder responding to the Eviction. + + It must be a valid domain-prefixed key (such as "acme.io/foo"). + Domain names *.k8s.io and *.kubernetes.io are reserved. + This field must be unique for each responder. + This field is required. + type: string + priority: + description: |- + priority for this responder. Higher priorities are selected first by the evictionrequest-controller. + If there are responders with the same priority, the responder whose domain name comes first in the + alphabetical higher domain order, will be picked. This means that the top domain labels are compared + alphabetically first, followed by the lower domain labels. The key is compared last. + + The responder that is the managing controller of the pod should set the value of + this field to 10000 to allow both for preemption or fallback registration by other + responders. + + The minimum value is 0 and the maximum value is 100000. + The interval 0-999 is reserved for responders with *.k8s.io suffix. + This field is required. + format: int32 + type: integer + required: + - name + - priority + type: object + x-kubernetes-map-type: atomic + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map hostAliases: description: |- HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts @@ -4223,7 +4396,6 @@ spec: When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host. - This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature. type: boolean hostname: description: |- @@ -4241,7 +4413,6 @@ spec: - `hostNetwork` must be set to false. This field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. - Requires the HostnameOverride feature gate to be enabled. type: string imagePullSecrets: description: |- @@ -4348,7 +4519,9 @@ spec: description: Selects a key of a ConfigMap. properties: key: - description: The key to select. + description: |- + The key to select from the ConfigMap's Data field. + Keys in the BinaryData field are not currently propagated to container env vars. type: string name: default: "" @@ -4627,6 +4800,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -4744,6 +4922,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -4826,6 +5009,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -4885,6 +5075,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -5042,6 +5237,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -5101,6 +5303,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -5402,7 +5609,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -5557,6 +5763,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -5616,6 +5829,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -5757,10 +5975,21 @@ spec: description: VolumeMount describes a mounting of a Volume within a container. properties: - mountPath: + bindMountOptions: description: |- - Path within the container at which the volume should be mounted. Must - not contain ':'. + bindMountOptions is the list of additional bind mount options to apply when + mounting this volume into the container. Allowed values are noexec, + nodev, and nosuid. These are Linux mount options and have no effect on + Windows nodes. + This field is not supported with image volumes. + This is an alpha field and requires enabling the VolumeBindMountOptions feature gate. + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + description: Path within the container at + which the volume should be mounted. type: string mountPropagation: description: |- @@ -5915,6 +6144,8 @@ spec: description: |- PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. + When Priority Admission Controller is enabled, it prevents users from setting + this field. The admission controller populates this field from PriorityClassName. Defaults to PreemptLowerPriority if unset. type: string priority: @@ -5973,6 +6204,14 @@ spec: It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. + + When the DRAWorkloadResourceClaims feature gate is enabled and this Pod + belongs to a PodGroup, a PodResourceClaim is matched to a + PodGroupResourceClaim if all of their fields are equal (Name, + ResourceClaimName, and ResourceClaimTemplateName). A matched claim references + a single ResourceClaim shared across all Pods in the PodGroup, reserved for + the PodGroup in ResourceClaimStatus.ReservedFor rather than for individual + Pods. properties: name: description: |- @@ -5998,6 +6237,16 @@ spec: generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. + When the DRAWorkloadResourceClaims feature gate is enabled and the pod + belongs to a PodGroup that defines a PodGroupResourceClaim with the same + Name and ResourceClaimTemplateName, this PodResourceClaim resolves to the + ResourceClaim generated for the PodGroup. All pods in the group that + define an equivalent PodResourceClaim matching the + PodGroupResourceClaim's Name and ResourceClaimTemplateName share the same + generated ResourceClaim. ResourceClaims generated for a PodGroup are + owned by the PodGroup and their lifecycles are tied to the PodGroup + instead of any individual pod. + This field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim. @@ -6124,6 +6373,28 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map + schedulingGroup: + description: |- + SchedulingGroup provides a reference to the immediate scheduling runtime + grouping object that this Pod belongs to. + This field is used by the scheduler to identify the group and apply the + correct group scheduling policies. The association with a group also + impacts other lifecycle aspects of a Pod that are relevant in a wider context + of scheduling like preemption, resource attachment, etc. If not specified, + the Pod is treated as a single unit in all of these aspects. + The group object referenced by this field may not exist at the time the + Pod is created. + This field is immutable, but a group object with the same name may be + recreated with different policies. Doing this during pod scheduling + may result in the placement not conforming to the expected policies. + properties: + podGroupName: + description: |- + PodGroupName specifies the name of the standalone PodGroup object + that represents the runtime instance of this group. + Must be a DNS subdomain. + type: string + type: object securityContext: description: |- SecurityContext holds pod-level security attributes and common container settings. @@ -6220,11 +6491,8 @@ spec: Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. - "MountOption" value is allowed only when SELinuxMount feature gate is enabled. - If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - and "Recursive" for all other volumes. + If not specified, "MountOption" is used. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. @@ -6846,6 +7114,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer items: description: |- items if unspecified, each key-value pair in the Data field of the referenced @@ -6879,6 +7154,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -6966,6 +7248,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer items: description: Items is a list of downward API volume file @@ -7036,6 +7325,13 @@ spec: - resource type: object x-kubernetes-map-type: atomic + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -7054,6 +7350,18 @@ spec: Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir type: string + mode: + description: |- + mode specifies the permission bits for the emptyDir directory, in numeric + notation (e.g., 0755, 01777). Must be a value between 0000 and 01777. + If not specified, defaults to 0777. + This might be in conflict with other options that affect the file + mode, like fsGroup. If fsGroup is specified, the fsGroup permissions + will override the mode specified here. + This field has no effect on Windows. + This field is alpha and requires EmptyDirVolumeMode featuregate to be enabled. + format: int32 + type: integer sizeLimit: anyOf: - type: integer @@ -7147,8 +7455,8 @@ spec: * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. - When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, - and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be + copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: @@ -7193,7 +7501,6 @@ spec: specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: @@ -7559,7 +7866,7 @@ spec: A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. - The volume will be mounted read-only (ro) and non-executable files (noexec). + The volume will be mounted read-only (ro). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. properties: @@ -7733,8 +8040,7 @@ spec: description: |- portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type - are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate - is on. + are redirected to the pxd.portworx.com CSI driver. properties: fsType: description: |- @@ -7768,6 +8074,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer sources: description: |- sources is the list of volume projections. Each entry in this list @@ -7869,6 +8182,13 @@ spec: Mutually-exclusive with name. The contents of all selected ClusterTrustBundles will be unified and deduplicated. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -7910,6 +8230,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -8013,6 +8340,13 @@ spec: - resource type: object x-kubernetes-map-type: atomic + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -8120,6 +8454,13 @@ spec: description: Kubelet's generated CSRs will be addressed to this signer. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer userAnnotations: additionalProperties: type: string @@ -8180,6 +8521,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -8229,6 +8577,13 @@ spec: path is the path relative to the mount point of the file to project the token into. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -8436,6 +8791,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer items: description: |- items If unspecified, each key-value pair in the Data field of the referenced @@ -8469,6 +8831,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -8567,42 +8936,6 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map - workloadRef: - description: |- - WorkloadRef provides a reference to the Workload object that this Pod belongs to. - This field is used by the scheduler to identify the PodGroup and apply the - correct group scheduling policies. The Workload object referenced - by this field may not exist at the time the Pod is created. - This field is immutable, but a Workload object with the same name - may be recreated with different policies. Doing this during pod scheduling - may result in the placement not conforming to the expected policies. - properties: - name: - description: |- - Name defines the name of the Workload object this Pod belongs to. - Workload must be in the same namespace as the Pod. - If it doesn't match any existing Workload, the Pod will remain unschedulable - until a Workload object is created and observed by the kube-scheduler. - It must be a DNS subdomain. - type: string - podGroup: - description: |- - PodGroup is the name of the PodGroup within the Workload that this Pod - belongs to. If it doesn't match any existing PodGroup within the Workload, - the Pod will remain unschedulable until the Workload object is recreated - and observed by the kube-scheduler. It must be a DNS label. - type: string - podGroupReplicaKey: - description: |- - PodGroupReplicaKey specifies the replica key of the PodGroup to which this - Pod belongs. It is used to distinguish pods belonging to different replicas - of the same pod group. The pod group policy is applied separately to each replica. - When set, it must be a DNS label. - type: string - required: - - name - - podGroup - type: object required: - containers type: object diff --git a/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_jobs.yaml b/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_jobs.yaml index 6c7747fc0..9da84130d 100644 --- a/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_jobs.yaml +++ b/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_jobs.yaml @@ -1070,7 +1070,9 @@ spec: description: Selects a key of a ConfigMap. properties: key: - description: The key to select. + description: |- + The key to select from the ConfigMap's Data field. + Keys in the BinaryData field are not currently propagated to container env vars. type: string name: default: "" @@ -1345,6 +1347,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -1459,6 +1466,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -1541,6 +1553,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -1599,6 +1618,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -1756,6 +1780,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -1814,6 +1845,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -2115,7 +2151,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -2270,6 +2305,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -2328,6 +2370,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -2469,10 +2516,21 @@ spec: description: VolumeMount describes a mounting of a Volume within a container. properties: - mountPath: + bindMountOptions: description: |- - Path within the container at which the volume should be mounted. Must - not contain ':'. + bindMountOptions is the list of additional bind mount options to apply when + mounting this volume into the container. Allowed values are noexec, + nodev, and nosuid. These are Linux mount options and have no effect on + Windows nodes. + This field is not supported with image volumes. + This is an alpha field and requires enabling the VolumeBindMountOptions feature gate. + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + description: Path within the container at which + the volume should be mounted. type: string mountPropagation: description: |- @@ -2684,7 +2742,9 @@ spec: description: Selects a key of a ConfigMap. properties: key: - description: The key to select. + description: |- + The key to select from the ConfigMap's Data field. + Keys in the BinaryData field are not currently propagated to container env vars. type: string name: default: "" @@ -2956,6 +3016,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -3070,6 +3135,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -3148,6 +3218,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -3206,6 +3283,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -3351,6 +3433,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -3409,6 +3498,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -3686,7 +3780,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -3834,6 +3927,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -3892,6 +3992,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -4042,10 +4147,21 @@ spec: description: VolumeMount describes a mounting of a Volume within a container. properties: - mountPath: + bindMountOptions: description: |- - Path within the container at which the volume should be mounted. Must - not contain ':'. + bindMountOptions is the list of additional bind mount options to apply when + mounting this volume into the container. Allowed values are noexec, + nodev, and nosuid. These are Linux mount options and have no effect on + Windows nodes. + This field is not supported with image volumes. + This is an alpha field and requires enabling the VolumeBindMountOptions feature gate. + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + description: Path within the container at which + the volume should be mounted. type: string mountPropagation: description: |- @@ -4117,6 +4233,63 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map + evictionResponders: + description: |- + evictionResponders reference responders that react to Evictions based on EvictionRequests. + Responders should observe and communicate through the Eviction Resource API to help with + the graceful termination of a pod. The responders are selected sequentially, according to + their specified priority. + + Responders should periodically report on an eviction progress by updating the + .status.responders[].heartbeatTime field of the Eviction object. If this field is not updated + within the heartbeat deadline defined by the Eviction API (currently 20 minutes), the eviction + is passed over to the next responder with a lower priority. If there is no other responder, + the last default imperative-eviction.k8s.io/evictor responder with a priority of 100 will + evict the pod using the imperative Eviction API (pods//eviction subresource). + + The maximum length of the responders list is 10. + Responders are not supported when the pod is part of a PodGroup (.spec.schedulingGroup is set). + This field can only be set on creation and is immutable afterwards. + items: + description: |- + EvictionResponder allows you to specify the responder reacting to an Eviction. + Responders should observe and communicate through the Eviction Resource API to help with + the graceful eviction of a target (e.g. termination of a pod). + properties: + name: + description: |- + name allows you to identify the responder responding to the Eviction. + + It must be a valid domain-prefixed key (such as "acme.io/foo"). + Domain names *.k8s.io and *.kubernetes.io are reserved. + This field must be unique for each responder. + This field is required. + type: string + priority: + description: |- + priority for this responder. Higher priorities are selected first by the evictionrequest-controller. + If there are responders with the same priority, the responder whose domain name comes first in the + alphabetical higher domain order, will be picked. This means that the top domain labels are compared + alphabetically first, followed by the lower domain labels. The key is compared last. + + The responder that is the managing controller of the pod should set the value of + this field to 10000 to allow both for preemption or fallback registration by other + responders. + + The minimum value is 0 and the maximum value is 100000. + The interval 0-999 is reserved for responders with *.k8s.io suffix. + This field is required. + format: int32 + type: integer + required: + - name + - priority + type: object + x-kubernetes-map-type: atomic + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map hostAliases: description: |- HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts @@ -4170,7 +4343,6 @@ spec: When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host. - This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature. type: boolean hostname: description: |- @@ -4188,7 +4360,6 @@ spec: - `hostNetwork` must be set to false. This field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. - Requires the HostnameOverride feature gate to be enabled. type: string imagePullSecrets: description: |- @@ -4295,7 +4466,9 @@ spec: description: Selects a key of a ConfigMap. properties: key: - description: The key to select. + description: |- + The key to select from the ConfigMap's Data field. + Keys in the BinaryData field are not currently propagated to container env vars. type: string name: default: "" @@ -4570,6 +4743,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -4684,6 +4862,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -4766,6 +4949,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -4824,6 +5014,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -4981,6 +5176,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -5039,6 +5241,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -5340,7 +5547,6 @@ spec: procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. type: string readOnlyRootFilesystem: @@ -5495,6 +5701,13 @@ spec: grpc: description: GRPC specifies a GRPC HealthCheckRequest. properties: + mode: + description: |- + mode specifies the connection mode for the gRPC health probe. + Set to "TLS" to use TLS without certificate verification. + Set to "Plaintext" to use a plaintext (insecure) connection explicitly. + If not specified, the probe uses a plaintext (insecure) connection. + type: string port: description: Port number of the gRPC service. Number must be in the range 1 to 65535. @@ -5553,6 +5766,11 @@ spec: Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true + protocol: + description: |- + Protocol selects the wire protocol for the probe connection. + Nil defaults to HTTP/1.1. + type: string scheme: description: |- Scheme to use for connecting to the host. @@ -5694,10 +5912,21 @@ spec: description: VolumeMount describes a mounting of a Volume within a container. properties: - mountPath: + bindMountOptions: description: |- - Path within the container at which the volume should be mounted. Must - not contain ':'. + bindMountOptions is the list of additional bind mount options to apply when + mounting this volume into the container. Allowed values are noexec, + nodev, and nosuid. These are Linux mount options and have no effect on + Windows nodes. + This field is not supported with image volumes. + This is an alpha field and requires enabling the VolumeBindMountOptions feature gate. + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + description: Path within the container at which + the volume should be mounted. type: string mountPropagation: description: |- @@ -5851,6 +6080,8 @@ spec: description: |- PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. + When Priority Admission Controller is enabled, it prevents users from setting + this field. The admission controller populates this field from PriorityClassName. Defaults to PreemptLowerPriority if unset. type: string priority: @@ -5909,6 +6140,14 @@ spec: It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. + + When the DRAWorkloadResourceClaims feature gate is enabled and this Pod + belongs to a PodGroup, a PodResourceClaim is matched to a + PodGroupResourceClaim if all of their fields are equal (Name, + ResourceClaimName, and ResourceClaimTemplateName). A matched claim references + a single ResourceClaim shared across all Pods in the PodGroup, reserved for + the PodGroup in ResourceClaimStatus.ReservedFor rather than for individual + Pods. properties: name: description: |- @@ -5934,6 +6173,16 @@ spec: generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. + When the DRAWorkloadResourceClaims feature gate is enabled and the pod + belongs to a PodGroup that defines a PodGroupResourceClaim with the same + Name and ResourceClaimTemplateName, this PodResourceClaim resolves to the + ResourceClaim generated for the PodGroup. All pods in the group that + define an equivalent PodResourceClaim matching the + PodGroupResourceClaim's Name and ResourceClaimTemplateName share the same + generated ResourceClaim. ResourceClaims generated for a PodGroup are + owned by the PodGroup and their lifecycles are tied to the PodGroup + instead of any individual pod. + This field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim. @@ -6059,6 +6308,28 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map + schedulingGroup: + description: |- + SchedulingGroup provides a reference to the immediate scheduling runtime + grouping object that this Pod belongs to. + This field is used by the scheduler to identify the group and apply the + correct group scheduling policies. The association with a group also + impacts other lifecycle aspects of a Pod that are relevant in a wider context + of scheduling like preemption, resource attachment, etc. If not specified, + the Pod is treated as a single unit in all of these aspects. + The group object referenced by this field may not exist at the time the + Pod is created. + This field is immutable, but a group object with the same name may be + recreated with different policies. Doing this during pod scheduling + may result in the placement not conforming to the expected policies. + properties: + podGroupName: + description: |- + PodGroupName specifies the name of the standalone PodGroup object + that represents the runtime instance of this group. + Must be a DNS subdomain. + type: string + type: object securityContext: description: |- SecurityContext holds pod-level security attributes and common container settings. @@ -6155,11 +6426,8 @@ spec: Eligible volumes are in-tree FibreChannel and iSCSI volumes, and all CSI volumes whose CSI driver announces SELinux support by setting spec.seLinuxMount: true in their CSIDriver instance. Other volumes are always re-labelled recursively. - "MountOption" value is allowed only when SELinuxMount feature gate is enabled. - If not specified and SELinuxMount feature gate is enabled, "MountOption" is used. - If not specified and SELinuxMount feature gate is disabled, "MountOption" is used for ReadWriteOncePod volumes - and "Recursive" for all other volumes. + If not specified, "MountOption" is used. This field affects only Pods that have SELinux label set, either in PodSecurityContext or in SecurityContext of all containers. @@ -6779,6 +7047,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer items: description: |- items if unspecified, each key-value pair in the Data field of the referenced @@ -6812,6 +7087,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -6899,6 +7181,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer items: description: Items is a list of downward API volume file @@ -6967,6 +7256,13 @@ spec: - resource type: object x-kubernetes-map-type: atomic + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -6985,6 +7281,18 @@ spec: Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir type: string + mode: + description: |- + mode specifies the permission bits for the emptyDir directory, in numeric + notation (e.g., 0755, 01777). Must be a value between 0000 and 01777. + If not specified, defaults to 0777. + This might be in conflict with other options that affect the file + mode, like fsGroup. If fsGroup is specified, the fsGroup permissions + will override the mode specified here. + This field has no effect on Windows. + This field is alpha and requires EmptyDirVolumeMode featuregate to be enabled. + format: int32 + type: integer sizeLimit: anyOf: - type: integer @@ -7078,8 +7386,8 @@ spec: * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. - When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, - and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be + copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: @@ -7124,7 +7432,6 @@ spec: specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: @@ -7487,7 +7794,7 @@ spec: A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. - The volume will be mounted read-only (ro) and non-executable files (noexec). + The volume will be mounted read-only (ro). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. properties: @@ -7659,8 +7966,7 @@ spec: description: |- portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type - are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate - is on. + are redirected to the pxd.portworx.com CSI driver. properties: fsType: description: |- @@ -7694,6 +8000,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer sources: description: |- sources is the list of volume projections. Each entry in this list @@ -7794,6 +8107,13 @@ spec: Mutually-exclusive with name. The contents of all selected ClusterTrustBundles will be unified and deduplicated. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -7834,6 +8154,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -7933,6 +8260,13 @@ spec: - resource type: object x-kubernetes-map-type: atomic + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -8040,6 +8374,13 @@ spec: description: Kubelet's generated CSRs will be addressed to this signer. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer userAnnotations: additionalProperties: type: string @@ -8099,6 +8440,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -8146,6 +8494,13 @@ spec: path is the path relative to the mount point of the file to project the token into. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -8352,6 +8707,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer items: description: |- items If unspecified, each key-value pair in the Data field of the referenced @@ -8385,6 +8747,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -8483,42 +8852,6 @@ spec: x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map - workloadRef: - description: |- - WorkloadRef provides a reference to the Workload object that this Pod belongs to. - This field is used by the scheduler to identify the PodGroup and apply the - correct group scheduling policies. The Workload object referenced - by this field may not exist at the time the Pod is created. - This field is immutable, but a Workload object with the same name - may be recreated with different policies. Doing this during pod scheduling - may result in the placement not conforming to the expected policies. - properties: - name: - description: |- - Name defines the name of the Workload object this Pod belongs to. - Workload must be in the same namespace as the Pod. - If it doesn't match any existing Workload, the Pod will remain unschedulable - until a Workload object is created and observed by the kube-scheduler. - It must be a DNS subdomain. - type: string - podGroup: - description: |- - PodGroup is the name of the PodGroup within the Workload that this Pod - belongs to. If it doesn't match any existing PodGroup within the Workload, - the Pod will remain unschedulable until the Workload object is recreated - and observed by the kube-scheduler. It must be a DNS label. - type: string - podGroupReplicaKey: - description: |- - PodGroupReplicaKey specifies the replica key of the PodGroup to which this - Pod belongs. It is used to distinguish pods belonging to different replicas - of the same pod group. The pod group policy is applied separately to each replica. - When set, it must be a DNS label. - type: string - required: - - name - - podGroup - type: object required: - containers type: object diff --git a/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_mariadbs.yaml b/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_mariadbs.yaml index 647e64f51..6f1e71987 100644 --- a/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_mariadbs.yaml +++ b/packages/system/backupstrategy-controller/definitions/strategy.backups.cozystack.io_mariadbs.yaml @@ -110,8 +110,8 @@ spec: * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. - When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, - and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be + copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: @@ -154,7 +154,6 @@ spec: specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: @@ -624,6 +623,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer items: description: |- items if unspecified, each key-value pair in the Data field of the referenced @@ -657,6 +663,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -744,6 +757,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer items: description: Items is a list of downward API volume file @@ -810,6 +830,13 @@ spec: - resource type: object x-kubernetes-map-type: atomic + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -828,6 +855,18 @@ spec: Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir type: string + mode: + description: |- + mode specifies the permission bits for the emptyDir directory, in numeric + notation (e.g., 0755, 01777). Must be a value between 0000 and 01777. + If not specified, defaults to 0777. + This might be in conflict with other options that affect the file + mode, like fsGroup. If fsGroup is specified, the fsGroup permissions + will override the mode specified here. + This field has no effect on Windows. + This field is alpha and requires EmptyDirVolumeMode featuregate to be enabled. + format: int32 + type: integer sizeLimit: anyOf: - type: integer @@ -921,8 +960,8 @@ spec: * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. - When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, - and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be + copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource. properties: apiGroup: @@ -967,7 +1006,6 @@ spec: specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. properties: apiGroup: @@ -1329,7 +1367,7 @@ spec: A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. - The volume will be mounted read-only (ro) and non-executable files (noexec). + The volume will be mounted read-only (ro). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. properties: @@ -1495,8 +1533,7 @@ spec: description: |- portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type - are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate - is on. + are redirected to the pxd.portworx.com CSI driver. properties: fsType: description: |- @@ -1530,6 +1567,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer sources: description: |- sources is the list of volume projections. Each entry in this list @@ -1630,6 +1674,13 @@ spec: Mutually-exclusive with name. The contents of all selected ClusterTrustBundles will be unified and deduplicated. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -1670,6 +1721,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -1769,6 +1827,13 @@ spec: - resource type: object x-kubernetes-map-type: atomic + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -1876,6 +1941,13 @@ spec: description: Kubelet's generated CSRs will be addressed to this signer. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer userAnnotations: additionalProperties: type: string @@ -1935,6 +2007,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path @@ -1982,6 +2061,13 @@ spec: path is the path relative to the mount point of the file to project the token into. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - path type: object @@ -2188,6 +2274,13 @@ spec: mode, like fsGroup, and the result can be other mode bits set. format: int32 type: integer + defaultUser: + description: |- + defaultUser is Optional: The owner UID of the created files by default. + The defaultUser field is only used as a fallback when the item-level user field is unset. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer items: description: |- items If unspecified, each key-value pair in the Data field of the referenced @@ -2221,6 +2314,13 @@ spec: May not contain the path element '..'. May not start with the string '..'. type: string + user: + description: |- + user is Optional: The owner UID of the created file. + If specified, the item-level user field takes precedence over defaultUser. + (Alpha) This field requires the AtomicWriteVolumeUserFields feature gate to be enabled. + format: int64 + type: integer required: - key - path diff --git a/pkg/apis/sdn/DESIGN.md b/pkg/apis/sdn/DESIGN.md index 857afc494..e7fa62f95 100644 --- a/pkg/apis/sdn/DESIGN.md +++ b/pkg/apis/sdn/DESIGN.md @@ -54,7 +54,7 @@ The controller is cheap because the identity it needs already lands on every man ### 3.4 Why an in-tree CiliumNetworkPolicy mirror -Neither `cozystack-api` nor the controller imports the `github.com/cilium/cilium` Go module: the current Cilium release pins a Kubernetes minor version newer than this project's `k8s.io/apimachinery` fork supports. The storage uses a minimal in-tree mirror (`CiliumNetworkPolicy` with a concrete `endpointSelector` and Cilium-shaped ingress/egress rules) registered at GroupVersion `cilium.io/v2`; the controller uses an even smaller metadata-only mirror (it never reads or writes the spec, so its mirror omits it and changes finalizers through merge patches that never carry a spec). Because the field names and JSON tags match the CiliumNetworkPolicy CRD exactly, marshalling produces wire-compatible objects. +Neither `cozystack-api` nor the controller imports the `github.com/cilium/cilium` Go module: importing it would tie this project's `k8s.io` libraries to Cilium's. Go builds with the higher of the two required versions, so a Cilium release built on a newer Kubernetes would drag them forward, and one built on an older Kubernetes would have to compile against ours. The storage uses a minimal in-tree mirror (`CiliumNetworkPolicy` with a concrete `endpointSelector` and Cilium-shaped ingress/egress rules) registered at GroupVersion `cilium.io/v2`; the controller uses an even smaller metadata-only mirror (it never reads or writes the spec, so its mirror omits it and changes finalizers through merge patches that never carry a spec). Because the field names and JSON tags match the CiliumNetworkPolicy CRD exactly, marshalling produces wire-compatible objects. ### 3.5 Liveness of `fromSG`/`toSG` diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index cd77f9612..c3555e46c 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -269,6 +269,7 @@ func (c completedConfig) New() (*CozyServer, error) { // server using the provided storage map (plural name → rest.Storage). func InstallAppsAPIGroup(server *genericapiserver.GenericAPIServer, storage map[string]rest.Storage) error { info := genericapiserver.NewDefaultAPIGroupInfo(apps.GroupName, Scheme, metav1.ParameterCodec, Codecs) + info.NegotiatedSerializer = kindPreservingSerializer{Codecs} info.VersionedResourcesStorageMap["v1alpha1"] = storage return server.InstallAPIGroup(&info) } diff --git a/pkg/apiserver/kind_serializer.go b/pkg/apiserver/kind_serializer.go new file mode 100644 index 000000000..4dc8e64c8 --- /dev/null +++ b/pkg/apiserver/kind_serializer.go @@ -0,0 +1,93 @@ +/* +Copyright 2026 The Cozystack Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package apiserver + +import ( + "io" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + + appsv1alpha1 "github.com/cozystack/cozystack/pkg/apis/apps/v1alpha1" +) + +// kindPreservingSerializer encodes apps objects under the kind they carry. +// Every apps kind is registered on the one Application Go type, and the +// stock versioning encoder converts through Scheme.ConvertToVersion, which +// picks the first kind registered for a type rather than the object's own. +// Only encoding goes through here. The row objects of a Table requested with +// includeObject=Object are converted through the Scheme instead and still get +// the first registered kind. Admission webhooks and ValidatingAdmissionPolicy +// get the request kind set explicitly. +type kindPreservingSerializer struct { + runtime.NegotiatedSerializer +} + +func (s kindPreservingSerializer) EncoderForVersion(enc runtime.Encoder, gv runtime.GroupVersioner) runtime.Encoder { + return kindPreservingEncoder{ + ns: s.NegotiatedSerializer, + enc: enc, + gv: gv, + Encoder: s.NegotiatedSerializer.EncoderForVersion(enc, gv), + } +} + +// kindPreservingEncoder must not implement runtime.EncoderWithAllocator: the +// watch handler prefers that method when present, and it would bypass Encode. +type kindPreservingEncoder struct { + runtime.Encoder + ns runtime.NegotiatedSerializer + enc runtime.Encoder + gv runtime.GroupVersioner +} + +func (e kindPreservingEncoder) Encode(obj runtime.Object, w io.Writer) error { + switch obj.(type) { + case *appsv1alpha1.Application, *appsv1alpha1.ApplicationList: + if gvk := obj.GetObjectKind().GroupVersionKind(); gvk.Kind != "" { + return e.ns.EncoderForVersion(e.enc, exactKindVersioner{want: gvk, fallback: e.gv}).Encode(obj, w) + } + } + return e.Encoder.Encode(obj, w) +} + +// Identifier differs from the wrapped encoder's because the output does. +func (e kindPreservingEncoder) Identifier() runtime.Identifier { + return "kindPreserving:" + e.Encoder.Identifier() +} + +// exactKindVersioner picks want when the target group version would accept +// it, and otherwise defers to the versioner the request negotiated. +type exactKindVersioner struct { + want schema.GroupVersionKind + fallback runtime.GroupVersioner +} + +func (v exactKindVersioner) KindForGroupVersionKinds(kinds []schema.GroupVersionKind) (schema.GroupVersionKind, bool) { + if target, ok := v.fallback.KindForGroupVersionKinds([]schema.GroupVersionKind{v.want}); ok && target == v.want { + for _, k := range kinds { + if k == v.want { + return k, true + } + } + } + return v.fallback.KindForGroupVersionKinds(kinds) +} + +func (v exactKindVersioner) Identifier() string { + return "exactKind:" + v.want.String() + ":" + v.fallback.Identifier() +} diff --git a/pkg/apiserver/kind_serializer_test.go b/pkg/apiserver/kind_serializer_test.go new file mode 100644 index 000000000..53ebc7944 --- /dev/null +++ b/pkg/apiserver/kind_serializer_test.go @@ -0,0 +1,127 @@ +/* +Copyright 2026 The Cozystack Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package apiserver + +import ( + "bytes" + "encoding/json" + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/runtime/serializer" + + appsv1alpha1 "github.com/cozystack/cozystack/pkg/apis/apps/v1alpha1" + "github.com/cozystack/cozystack/pkg/config" +) + +// newTwoKindCodecs registers Postgres before Redis on a fresh scheme, so +// Postgres is the kind a stock conversion falls back to. +func newTwoKindCodecs(t *testing.T) serializer.CodecFactory { + t.Helper() + s := runtime.NewScheme() + metav1.AddToGroupVersion(s, appsv1alpha1.SchemeGroupVersion) + if err := appsv1alpha1.RegisterDynamicTypes(s, &config.ResourceConfig{Resources: []config.Resource{ + {Application: config.ApplicationConfig{Kind: "Postgres"}}, + {Application: config.ApplicationConfig{Kind: "Redis"}}, + }}); err != nil { + t.Fatal(err) + } + return serializer.NewCodecFactory(s) +} + +func encodedKind(t *testing.T, enc runtime.Encoder, obj runtime.Object) string { + t.Helper() + var b bytes.Buffer + if err := enc.Encode(obj, &b); err != nil { + t.Fatal(err) + } + var m struct { + Kind string `json:"kind"` + } + if err := json.Unmarshal(b.Bytes(), &m); err != nil { + t.Fatal(err) + } + return m.Kind +} + +func TestKindPreservingSerializer_Encode(t *testing.T) { + codecs := newTwoKindCodecs(t) + info, ok := runtime.SerializerInfoForMediaType(codecs.SupportedMediaTypes(), runtime.ContentTypeJSON) + if !ok { + t.Fatal("no JSON serializer") + } + enc := kindPreservingSerializer{codecs}.EncoderForVersion(info.Serializer, appsv1alpha1.SchemeGroupVersion) + gv := appsv1alpha1.SchemeGroupVersion.String() + + for _, tc := range []struct { + name string + obj runtime.Object + want string + }{ + {"object keeps its kind", &appsv1alpha1.Application{TypeMeta: metav1.TypeMeta{APIVersion: gv, Kind: "Redis"}}, "Redis"}, + {"list keeps its kind", &appsv1alpha1.ApplicationList{TypeMeta: metav1.TypeMeta{APIVersion: gv, Kind: "RedisList"}}, "RedisList"}, + // Without a kind on the object there is nothing to keep, so the + // stock choice stands; the storages always stamp one. + {"object without a kind falls back to the stock choice", &appsv1alpha1.Application{}, "Postgres"}, + } { + t.Run(tc.name, func(t *testing.T) { + if got := encodedKind(t, enc, tc.obj); got != tc.want { + t.Fatalf("kind = %q, want %q", got, tc.want) + } + }) + } +} + +// The output differs from the wrapped encoder's, so a serialization cache keyed +// by encoder identifier must not share entries between them. +func TestKindPreservingSerializer_IdentifierDiffersFromWrapped(t *testing.T) { + codecs := newTwoKindCodecs(t) + info, _ := runtime.SerializerInfoForMediaType(codecs.SupportedMediaTypes(), runtime.ContentTypeJSON) + gv := appsv1alpha1.SchemeGroupVersion + wrapped := codecs.EncoderForVersion(info.Serializer, gv).Identifier() + if got := (kindPreservingSerializer{codecs}).EncoderForVersion(info.Serializer, gv).Identifier(); got == wrapped { + t.Fatalf("identifier %q equals the wrapped encoder's", got) + } +} + +func TestExactKindVersioner(t *testing.T) { + apps := appsv1alpha1.SchemeGroupVersion + postgres, redis := apps.WithKind("Postgres"), apps.WithKind("Redis") + kinds := []schema.GroupVersionKind{postgres, redis} + other := schema.GroupVersion{Group: "example.com", Version: "v1"} + + for _, tc := range []struct { + name string + want schema.GroupVersionKind + fallback runtime.GroupVersioner + wantGVK schema.GroupVersionKind + wantOK bool + }{ + {"picks the object's kind", redis, apps, redis, true}, + {"defers when the target is another group version", redis, other, schema.GroupVersionKind{}, false}, + {"defers when the kind is not registered for the type", apps.WithKind("Kafka"), apps, postgres, true}, + } { + t.Run(tc.name, func(t *testing.T) { + got, ok := exactKindVersioner{want: tc.want, fallback: tc.fallback}.KindForGroupVersionKinds(kinds) + if got != tc.wantGVK || ok != tc.wantOK { + t.Fatalf("got %v, %v; want %v, %v", got, ok, tc.wantGVK, tc.wantOK) + } + }) + } +} diff --git a/pkg/cmd/server/multikind_test.go b/pkg/cmd/server/multikind_test.go new file mode 100644 index 000000000..e11bd32fc --- /dev/null +++ b/pkg/cmd/server/multikind_test.go @@ -0,0 +1,153 @@ +/* +Copyright 2026 The Cozystack Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package server_test + +import ( + "context" + "encoding/json" + "io" + "net/http" + "testing" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/dynamic" + restclient "k8s.io/client-go/rest" + + appsv1alpha1 "github.com/cozystack/cozystack/pkg/apis/apps/v1alpha1" + "github.com/cozystack/cozystack/pkg/config" +) + +// Every apps kind is registered on the one Application Go type, and a stock +// conversion picks the first kind registered for it. Each request path must +// answer with the kind the client asked for. Every kind is exercised because +// the kinds share the process-wide scheme with other tests, so which one is +// registered first, and therefore invisible to this check, is not fixed. +func TestAppsAPIKeepsKindAcrossSharedGoType(t *testing.T) { + rc := &config.ResourceConfig{Resources: []config.Resource{ + { + Application: config.ApplicationConfig{Kind: "Postgres", Singular: "postgres", Plural: "postgreses"}, + Release: config.ReleaseConfig{Prefix: "postgres-"}, + }, + redisConfig, + }} + ts, _ := startAppsServer(t, rc) + dyn := dynamic.NewForConfigOrDie(&restclient.Config{Host: ts.URL}) + + for _, res := range rc.Resources { + kind, plural := res.Application.Kind, res.Application.Plural + t.Run(kind, func(t *testing.T) { + api := dyn.Resource(schema.GroupVersionResource{ + Group: appsv1alpha1.GroupName, Version: "v1alpha1", Resource: plural, + }).Namespace("tenant-a") + ctx := context.Background() + wantKind := func(op, got, want string) { + t.Helper() + if got != want { + t.Errorf("%s: kind = %q, want %q", op, got, want) + } + } + obj := func(replicas int64) *unstructured.Unstructured { + return &unstructured.Unstructured{Object: map[string]any{ + "apiVersion": appsv1alpha1.SchemeGroupVersion.String(), + "kind": kind, + "metadata": map[string]any{"name": "app", "namespace": "tenant-a"}, + "spec": map[string]any{"replicas": replicas}, + }} + } + + created, err := api.Create(ctx, obj(1), metav1.CreateOptions{}) + if err != nil { + t.Fatalf("create: %v", err) + } + wantKind("create", created.GetKind(), kind) + + got, err := api.Get(ctx, "app", metav1.GetOptions{}) + if err != nil { + t.Fatalf("get: %v", err) + } + wantKind("get", got.GetKind(), kind) + + list, err := api.List(ctx, metav1.ListOptions{}) + if err != nil { + t.Fatalf("list: %v", err) + } + wantKind("list", list.GetKind(), kind+"List") + + w, err := api.Watch(ctx, metav1.ListOptions{}) + if err != nil { + t.Fatalf("watch: %v", err) + } + defer w.Stop() + + if err := unstructured.SetNestedField(got.Object, int64(3), "spec", "replicas"); err != nil { + t.Fatal(err) + } + updated, err := api.Update(ctx, got, metav1.UpdateOptions{}) + if err != nil { + t.Fatalf("update: %v", err) + } + wantKind("update", updated.GetKind(), kind) + + deadline := time.After(10 * time.Second) + for sawModified := false; !sawModified; { + select { + case ev := <-w.ResultChan(): + u, ok := ev.Object.(*unstructured.Unstructured) + if !ok { + t.Fatalf("watch: unexpected object %T", ev.Object) + } + wantKind("watch "+string(ev.Type), u.GetKind(), kind) + sawModified = ev.Type == watch.Modified + case <-deadline: + t.Fatal("watch: no MODIFIED event") + } + } + + applied, err := api.Apply(ctx, "app", obj(5), metav1.ApplyOptions{FieldManager: "test", Force: true}) + if err != nil { + t.Fatalf("apply: %v", err) + } + wantKind("apply", applied.GetKind(), kind) + + req, err := http.NewRequest(http.MethodGet, ts.URL+"/apis/apps.cozystack.io/v1alpha1/namespaces/tenant-a/"+plural, nil) + if err != nil { + t.Fatal(err) + } + req.Header.Set("Accept", "application/json;as=Table;v=v1;g=meta.k8s.io") + resp, err := http.DefaultClient.Do(req) + if err != nil { + t.Fatalf("table: %v", err) + } + body, err := io.ReadAll(resp.Body) + _ = resp.Body.Close() + if err != nil { + t.Fatalf("table: read body: %v", err) + } + var table map[string]any + if err := json.Unmarshal(body, &table); err != nil { + t.Fatalf("table: decode %q: %v", body, err) + } + if resp.StatusCode != http.StatusOK || table["kind"] != "Table" { + t.Errorf("table: status %d kind %v", resp.StatusCode, table["kind"]) + } + }) + } +} diff --git a/pkg/cmd/server/start.go b/pkg/cmd/server/start.go index 5586b6196..48ee1bdbb 100644 --- a/pkg/cmd/server/start.go +++ b/pkg/cmd/server/start.go @@ -24,6 +24,7 @@ import ( "fmt" "io" "net" + "slices" "time" v1alpha1 "github.com/cozystack/cozystack/api/v1alpha1" @@ -37,6 +38,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" utilerrors "k8s.io/apimachinery/pkg/util/errors" + mutatingadmissionpolicy "k8s.io/apiserver/pkg/admission/plugin/policy/mutating" genericapiserver "k8s.io/apiserver/pkg/server" genericoptions "k8s.io/apiserver/pkg/server/options" utilfeature "k8s.io/apiserver/pkg/util/feature" @@ -94,9 +96,29 @@ func NewCozyServerOptions(out, errOut io.Writer) *CozyServerOptions { HelmReleaseMaxHistory: 5, } o.RecommendedOptions.Etcd = nil + disableUnsyncableAdmissionPlugins(o.RecommendedOptions.Admission) return o } +// disableUnsyncableAdmissionPlugins keeps MutatingAdmissionPolicy out of the +// chain. It is on by default from k8s.io/apiserver v0.36 and refuses every +// write until it has synced mutatingadmissionpolicies, which this server has +// no RBAC to list and which clusters older than 1.36 do not serve. It runs +// again in Complete because --disable-admission-plugins replaces the list. +// Naming the plugin in --enable-admission-plugins wins: the operator has +// granted it what it needs, and both lists at once fail validation. +func disableUnsyncableAdmissionPlugins(a *genericoptions.AdmissionOptions) { + if slices.Contains(a.EnablePlugins, mutatingadmissionpolicy.PluginName) { + a.DisablePlugins = slices.DeleteFunc(a.DisablePlugins, func(p string) bool { + return p == mutatingadmissionpolicy.PluginName + }) + return + } + if !slices.Contains(a.DisablePlugins, mutatingadmissionpolicy.PluginName) { + a.DisablePlugins = append(a.DisablePlugins, mutatingadmissionpolicy.PluginName) + } +} + // NewCommandStartCozyServer provides a CLI handler for the 'start apps-server' command func NewCommandStartCozyServer(ctx context.Context, defaults *CozyServerOptions) *cobra.Command { o := *defaults @@ -193,6 +215,8 @@ func (o *CozyServerOptions) parseAndValidateHelmReleaseFlags() (helmReleaseFlagV // Complete fills in the fields that are not set func (o *CozyServerOptions) Complete() error { + disableUnsyncableAdmissionPlugins(o.RecommendedOptions.Admission) + hrFlags, err := o.parseAndValidateHelmReleaseFlags() if err != nil { return err diff --git a/pkg/cmd/server/start_test.go b/pkg/cmd/server/start_test.go index 599b085fa..90165b9e2 100644 --- a/pkg/cmd/server/start_test.go +++ b/pkg/cmd/server/start_test.go @@ -17,9 +17,14 @@ limitations under the License. package server import ( + "path/filepath" + "slices" "strings" "testing" "time" + + "github.com/spf13/pflag" + mutatingadmissionpolicy "k8s.io/apiserver/pkg/admission/plugin/policy/mutating" ) // validHelmReleaseFlags returns a CozyServerOptions populated with the same @@ -184,3 +189,57 @@ func TestNewCozyServerOptions_DefaultsValidate(t *testing.T) { t.Fatalf("default options must validate, got: %v", err) } } + +func TestNewCozyServerOptions_DisablesMutatingAdmissionPolicy(t *testing.T) { + o := NewCozyServerOptions(nil, nil) + if !slices.Contains(o.RecommendedOptions.Admission.DisablePlugins, mutatingadmissionpolicy.PluginName) { + t.Fatalf("%s is not disabled, disabled plugins: %v", + mutatingadmissionpolicy.PluginName, o.RecommendedOptions.Admission.DisablePlugins) + } +} + +// --disable-admission-plugins replaces the default list rather than adding +// to it; Complete must put the plugin back before anything is built. +func TestComplete_KeepsMutatingAdmissionPolicyDisabledAfterFlagOverride(t *testing.T) { + t.Setenv("KUBECONFIG", filepath.Join(t.TempDir(), "missing")) + t.Setenv("HOME", t.TempDir()) + t.Setenv("KUBERNETES_SERVICE_HOST", "") + + o := NewCozyServerOptions(nil, nil) + fs := pflag.NewFlagSet("test", pflag.ContinueOnError) + o.RecommendedOptions.AddFlags(fs) + if err := fs.Parse([]string{"--disable-admission-plugins=NamespaceLifecycle"}); err != nil { + t.Fatal(err) + } + // Complete stops at the missing kubeconfig; the admission list is + // settled before that. + _ = o.Complete() + + got := o.RecommendedOptions.Admission.DisablePlugins + if !slices.Contains(got, mutatingadmissionpolicy.PluginName) || !slices.Contains(got, "NamespaceLifecycle") { + t.Fatalf("disabled plugins = %v, want both NamespaceLifecycle and %s", got, mutatingadmissionpolicy.PluginName) + } +} + +// An operator who enables the plugin by name has given it what it needs; +// keeping it on the disable list too would fail validation as a conflict. +func TestComplete_ExplicitEnableOfMutatingAdmissionPolicyWins(t *testing.T) { + t.Setenv("KUBECONFIG", filepath.Join(t.TempDir(), "missing")) + t.Setenv("HOME", t.TempDir()) + t.Setenv("KUBERNETES_SERVICE_HOST", "") + + o := NewCozyServerOptions(nil, nil) + fs := pflag.NewFlagSet("test", pflag.ContinueOnError) + o.RecommendedOptions.AddFlags(fs) + if err := fs.Parse([]string{"--enable-admission-plugins=" + mutatingadmissionpolicy.PluginName}); err != nil { + t.Fatal(err) + } + _ = o.Complete() + + if got := o.RecommendedOptions.Admission.DisablePlugins; slices.Contains(got, mutatingadmissionpolicy.PluginName) { + t.Fatalf("disabled plugins = %v, want %s left enabled", got, mutatingadmissionpolicy.PluginName) + } + if errs := o.RecommendedOptions.Admission.Validate(); len(errs) > 0 { + t.Fatalf("admission options do not validate: %v", errs) + } +} diff --git a/pkg/cmd/server/watch_initial_events_test.go b/pkg/cmd/server/watch_initial_events_test.go new file mode 100644 index 000000000..331417545 --- /dev/null +++ b/pkg/cmd/server/watch_initial_events_test.go @@ -0,0 +1,173 @@ +/* +Copyright 2026 The Cozystack Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package server_test + +import ( + "bufio" + "context" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + helmv2 "github.com/fluxcd/helm-controller/api/v2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apiserver/pkg/registry/rest" + genericapiserver "k8s.io/apiserver/pkg/server" + utilfeature "k8s.io/apiserver/pkg/util/feature" + restclient "k8s.io/client-go/rest" + basecompatibility "k8s.io/component-base/compatibility" + baseversion "k8s.io/component-base/version" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + + appsv1alpha1 "github.com/cozystack/cozystack/pkg/apis/apps/v1alpha1" + "github.com/cozystack/cozystack/pkg/apiserver" + cozyserver "github.com/cozystack/cozystack/pkg/cmd/server" + "github.com/cozystack/cozystack/pkg/config" + applicationstorage "github.com/cozystack/cozystack/pkg/registry/apps/application" +) + +var redisConfig = config.Resource{ + Application: config.ApplicationConfig{Kind: "Redis", Singular: "redis", Plural: "redises"}, + Release: config.ReleaseConfig{Prefix: "redis-"}, +} + +// startAppsServer serves the apps group through the real apiserver handler +// chain, with the application storage backed by a fake client. The kinds are +// registered on the process-wide apiserver.Scheme. +func startAppsServer(t *testing.T, rc *config.ResourceConfig) (*httptest.Server, client.Client) { + t.Helper() + if err := appsv1alpha1.RegisterDynamicTypes(apiserver.Scheme, rc); err != nil { + t.Fatal(err) + } + + backing := runtime.NewScheme() + if err := helmv2.AddToScheme(backing); err != nil { + t.Fatal(err) + } + cli := fake.NewClientBuilder().WithScheme(backing).Build() + + cfg := genericapiserver.NewConfig(apiserver.Codecs) + cfg.ExternalAddress = "localhost:443" + cfg.LoopbackClientConfig = &restclient.Config{} + cfg.FeatureGate = utilfeature.DefaultMutableFeatureGate + if baseversion.DefaultKubeBinaryVersion != "" { + cfg.EffectiveVersion = basecompatibility.NewEffectiveVersionFromString(baseversion.DefaultKubeBinaryVersion, "", "") + } + cozyserver.ConfigureOpenAPI(cfg, cozyserver.KindSchemasFromConfig(rc), "test", "test") + srv, err := cfg.Complete(nil).New("watch-initial-events-test", genericapiserver.NewEmptyDelegate()) + if err != nil { + t.Fatal(err) + } + storage := map[string]rest.Storage{} + for i := range rc.Resources { + storage[rc.Resources[i].Application.Plural] = applicationstorage.NewREST(cli, cli, &rc.Resources[i]) + } + if err := apiserver.InstallAppsAPIGroup(srv, storage); err != nil { + t.Fatal(err) + } + srv.PrepareRun() + ts := httptest.NewServer(srv.Handler) + t.Cleanup(ts.Close) + return ts, cli +} + +// watchStream opens a watch with the given query, then creates and updates a +// release behind it, and returns the stream lines received within the timeout. +func watchStream(t *testing.T, ts *httptest.Server, cli client.Client, query string) []string { + t.Helper() + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + defer cancel() + req, err := http.NewRequestWithContext(ctx, http.MethodGet, + ts.URL+"/apis/apps.cozystack.io/v1alpha1/namespaces/tenant-a/redises?"+query, nil) + if err != nil { + t.Fatal(err) + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + t.Fatalf("watch: %v", err) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + t.Fatalf("watch: status %d", resp.StatusCode) + } + + lines := make(chan string) + go func() { + defer close(lines) + sc := bufio.NewScanner(resp.Body) + for sc.Scan() { + lines <- sc.Text() + } + }() + + hr := &helmv2.HelmRelease{ObjectMeta: metav1.ObjectMeta{ + Name: "redis-cache", + Namespace: "tenant-a", + Labels: map[string]string{ + applicationstorage.ApplicationKindLabel: "Redis", + applicationstorage.ApplicationGroupLabel: appsv1alpha1.GroupName, + }, + }} + if err := cli.Create(context.Background(), hr); err != nil { + t.Fatalf("create HelmRelease: %v", err) + } + // The storage sends a pending initial-events-end bookmark ahead of the + // first live event, so drive one. + hr.Annotations = map[string]string{"touched": "1"} + if err := cli.Update(context.Background(), hr); err != nil { + t.Fatalf("update HelmRelease: %v", err) + } + + var out []string + for line := range lines { + out = append(out, line) + } + return out +} + +// A plain watch has SendInitialEvents defaulted on by the handler but no +// bookmarks; from k8s.io/apiserver v0.36 the handler panics if the storage +// answers it with the initial-events-end bookmark, so none may appear. +func TestWatchHandler_PlainWatchGetsNoInitialEventsEndBookmark(t *testing.T) { + ts, cli := startAppsServer(t, &config.ResourceConfig{Resources: []config.Resource{redisConfig}}) + lines := watchStream(t, ts, cli, "watch=true") + sawModified := false + for _, l := range lines { + if strings.Contains(l, metav1.InitialEventsAnnotationKey) { + t.Fatalf("plain watch received the initial-events-end bookmark: %s", l) + } + sawModified = sawModified || strings.Contains(l, `"type":"MODIFIED"`) + } + if !sawModified { + t.Fatalf("plain watch saw no MODIFIED event, stream: %v", lines) + } +} + +func TestWatchHandler_WatchListGetsInitialEventsEndBookmark(t *testing.T) { + ts, cli := startAppsServer(t, &config.ResourceConfig{Resources: []config.Resource{redisConfig}}) + lines := watchStream(t, ts, cli, "watch=true&sendInitialEvents=true&allowWatchBookmarks=true&resourceVersionMatch=NotOlderThan") + for _, l := range lines { + if strings.Contains(l, `"type":"BOOKMARK"`) && strings.Contains(l, metav1.InitialEventsAnnotationKey) { + return + } + } + t.Fatalf("watch list received no initial-events-end bookmark, stream: %v", lines) +} diff --git a/pkg/generated/applyconfiguration/apps/v1alpha1/application.go b/pkg/generated/applyconfiguration/apps/v1alpha1/application.go index 09794733a..703eb840a 100644 --- a/pkg/generated/applyconfiguration/apps/v1alpha1/application.go +++ b/pkg/generated/applyconfiguration/apps/v1alpha1/application.go @@ -30,7 +30,7 @@ import ( // // Application is an example type with a spec and a status. type ApplicationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` AppVersion *string `json:"appVersion,omitempty"` Spec *apiextensionsv1.JSON `json:"spec,omitempty"` diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index 127a0032a..82121a5ec 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -29,7 +29,7 @@ import ( ) type Interface interface { - Discovery() discovery.DiscoveryInterface + Discovery() discovery.DiscoveryInterfaces AppsV1alpha1() appsv1alpha1.AppsV1alpha1Interface } @@ -45,7 +45,7 @@ func (c *Clientset) AppsV1alpha1() appsv1alpha1.AppsV1alpha1Interface { } // Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { +func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { if c == nil { return nil } diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 1f600e5ba..bf75e046d 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -35,10 +35,6 @@ import ( // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, // without applying any field management, validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. -// -// Deprecated: NewClientset replaces this with support for field management, which significantly improves -// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. -// via --with-applyconfig). func NewSimpleClientset(objects ...runtime.Object) *Clientset { o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects { @@ -76,7 +72,7 @@ type Clientset struct { tracker testing.ObjectTracker } -func (c *Clientset) Discovery() discovery.DiscoveryInterface { +func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { return c.discovery } @@ -84,7 +80,7 @@ func (c *Clientset) Tracker() testing.ObjectTracker { return c.tracker } -// IsWatchListSemanticsSupported informs the reflector that this client +// IsWatchListSemanticsUnSupported informs the reflector that this client // doesn't support WatchList semantics. // // This is a synthetic method whose sole purpose is to satisfy the optional @@ -99,6 +95,10 @@ func (c *Clientset) IsWatchListSemanticsUnSupported() bool { // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, // without applying any validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. +// +// Compared to NewSimpleClientset, the Clientset returned here supports field tracking and thus +// server-side apply. Beware though that support in that for CRDs is missing +// (https://github.com/kubernetes/kubernetes/issues/126850). func NewClientset(objects ...runtime.Object) *Clientset { o := testing.NewFieldManagedObjectTracker( scheme, diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 99b8e50d1..1edff5230 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -128,6 +128,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA metav1.Preconditions{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_Preconditions(ref), metav1.RootPaths{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_RootPaths(ref), metav1.ServerAddressByClientCIDR{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), + metav1.ShardInfo{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_ShardInfo(ref), metav1.Status{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_Status(ref), metav1.StatusCause{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_StatusCause(ref), metav1.StatusDetails{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_StatusDetails(ref), @@ -233,8 +234,7 @@ func schema_pkg_apis_apps_v1alpha1_ApplicationList(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1alpha1.Application{}.OpenAPIModelName()), + Ref: ref(v1alpha1.Application{}.OpenAPIModelName()), }, }, }, @@ -269,8 +269,7 @@ func schema_pkg_apis_apps_v1alpha1_ApplicationStatus(ref common.ReferenceCallbac Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.Condition{}.OpenAPIModelName()), + Ref: ref(metav1.Condition{}.OpenAPIModelName()), }, }, }, @@ -414,8 +413,7 @@ func schema_pkg_apis_core_v1alpha1_OptionList(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(corev1alpha1.Option{}.OpenAPIModelName()), + Ref: ref(corev1alpha1.Option{}.OpenAPIModelName()), }, }, }, @@ -443,8 +441,7 @@ func schema_pkg_apis_core_v1alpha1_OptionSpec(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(corev1alpha1.OptionItem{}.OpenAPIModelName()), + Ref: ref(corev1alpha1.OptionItem{}.OpenAPIModelName()), }, }, }, @@ -532,8 +529,7 @@ func schema_pkg_apis_core_v1alpha1_TapList(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(corev1alpha1.Tap{}.OpenAPIModelName()), + Ref: ref(corev1alpha1.Tap{}.OpenAPIModelName()), }, }, }, @@ -596,9 +592,8 @@ func schema_pkg_apis_core_v1alpha1_TapPackage(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -693,8 +688,7 @@ func schema_pkg_apis_core_v1alpha1_TapSpec(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(corev1alpha1.TapPackage{}.OpenAPIModelName()), + Ref: ref(corev1alpha1.TapPackage{}.OpenAPIModelName()), }, }, }, @@ -811,8 +805,7 @@ func schema_pkg_apis_core_v1alpha1_TenantModuleList(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(corev1alpha1.TenantModule{}.OpenAPIModelName()), + Ref: ref(corev1alpha1.TenantModule{}.OpenAPIModelName()), }, }, }, @@ -848,8 +841,7 @@ func schema_pkg_apis_core_v1alpha1_TenantModuleStatus(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.Condition{}.OpenAPIModelName()), + Ref: ref(metav1.Condition{}.OpenAPIModelName()), }, }, }, @@ -931,8 +923,7 @@ func schema_pkg_apis_core_v1alpha1_TenantNamespaceList(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(corev1alpha1.TenantNamespace{}.OpenAPIModelName()), + Ref: ref(corev1alpha1.TenantNamespace{}.OpenAPIModelName()), }, }, }, @@ -1001,9 +992,8 @@ func schema_pkg_apis_core_v1alpha1_TenantSecret(ref common.ReferenceCallback) co Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -1049,8 +1039,7 @@ func schema_pkg_apis_core_v1alpha1_TenantSecretList(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(corev1alpha1.TenantSecret{}.OpenAPIModelName()), + Ref: ref(corev1alpha1.TenantSecret{}.OpenAPIModelName()), }, }, }, @@ -1116,8 +1105,7 @@ func schema_pkg_apis_sdn_v1alpha1_EgressRule(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(sdnv1alpha1.ApplicationReference{}.OpenAPIModelName()), + Ref: ref(sdnv1alpha1.ApplicationReference{}.OpenAPIModelName()), }, }, }, @@ -1130,9 +1118,8 @@ func schema_pkg_apis_sdn_v1alpha1_EgressRule(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -1145,9 +1132,8 @@ func schema_pkg_apis_sdn_v1alpha1_EgressRule(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -1160,8 +1146,7 @@ func schema_pkg_apis_sdn_v1alpha1_EgressRule(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(sdnv1alpha1.FQDNSelector{}.OpenAPIModelName()), + Ref: ref(sdnv1alpha1.FQDNSelector{}.OpenAPIModelName()), }, }, }, @@ -1174,8 +1159,7 @@ func schema_pkg_apis_sdn_v1alpha1_EgressRule(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(sdnv1alpha1.PortRule{}.OpenAPIModelName()), + Ref: ref(sdnv1alpha1.PortRule{}.OpenAPIModelName()), }, }, }, @@ -1230,8 +1214,7 @@ func schema_pkg_apis_sdn_v1alpha1_IngressRule(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(sdnv1alpha1.ApplicationReference{}.OpenAPIModelName()), + Ref: ref(sdnv1alpha1.ApplicationReference{}.OpenAPIModelName()), }, }, }, @@ -1244,9 +1227,8 @@ func schema_pkg_apis_sdn_v1alpha1_IngressRule(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -1259,9 +1241,8 @@ func schema_pkg_apis_sdn_v1alpha1_IngressRule(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -1274,8 +1255,7 @@ func schema_pkg_apis_sdn_v1alpha1_IngressRule(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(sdnv1alpha1.PortRule{}.OpenAPIModelName()), + Ref: ref(sdnv1alpha1.PortRule{}.OpenAPIModelName()), }, }, }, @@ -1330,8 +1310,7 @@ func schema_pkg_apis_sdn_v1alpha1_PortRule(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(sdnv1alpha1.PortProtocol{}.OpenAPIModelName()), + Ref: ref(sdnv1alpha1.PortProtocol{}.OpenAPIModelName()), }, }, }, @@ -1420,8 +1399,7 @@ func schema_pkg_apis_sdn_v1alpha1_SecurityGroupList(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(sdnv1alpha1.SecurityGroup{}.OpenAPIModelName()), + Ref: ref(sdnv1alpha1.SecurityGroup{}.OpenAPIModelName()), }, }, }, @@ -1450,8 +1428,7 @@ func schema_pkg_apis_sdn_v1alpha1_SecurityGroupSpec(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(sdnv1alpha1.ApplicationReference{}.OpenAPIModelName()), + Ref: ref(sdnv1alpha1.ApplicationReference{}.OpenAPIModelName()), }, }, }, @@ -1464,8 +1441,7 @@ func schema_pkg_apis_sdn_v1alpha1_SecurityGroupSpec(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(sdnv1alpha1.IngressRule{}.OpenAPIModelName()), + Ref: ref(sdnv1alpha1.IngressRule{}.OpenAPIModelName()), }, }, }, @@ -1478,8 +1454,7 @@ func schema_pkg_apis_sdn_v1alpha1_SecurityGroupSpec(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(sdnv1alpha1.EgressRule{}.OpenAPIModelName()), + Ref: ref(sdnv1alpha1.EgressRule{}.OpenAPIModelName()), }, }, }, @@ -1867,8 +1842,7 @@ func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionList(ref common.Re Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.CustomResourceDefinition{}.OpenAPIModelName()), + Ref: ref(v1.CustomResourceDefinition{}.OpenAPIModelName()), }, }, }, @@ -1917,9 +1891,8 @@ func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionNames(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -1952,9 +1925,8 @@ func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionNames(ref common.R Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -2009,8 +1981,7 @@ func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionSpec(ref common.Re Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.CustomResourceDefinitionVersion{}.OpenAPIModelName()), + Ref: ref(v1.CustomResourceDefinitionVersion{}.OpenAPIModelName()), }, }, }, @@ -2060,8 +2031,7 @@ func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionStatus(ref common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.CustomResourceDefinitionCondition{}.OpenAPIModelName()), + Ref: ref(v1.CustomResourceDefinitionCondition{}.OpenAPIModelName()), }, }, }, @@ -2086,9 +2056,8 @@ func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionStatus(ref common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -2178,8 +2147,7 @@ func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionVersion(ref common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.CustomResourceColumnDefinition{}.OpenAPIModelName()), + Ref: ref(v1.CustomResourceColumnDefinition{}.OpenAPIModelName()), }, }, }, @@ -2197,8 +2165,7 @@ func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionVersion(ref common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.SelectableField{}.OpenAPIModelName()), + Ref: ref(v1.SelectableField{}.OpenAPIModelName()), }, }, }, @@ -2508,9 +2475,8 @@ func schema_pkg_apis_apiextensions_v1_JSONSchemaProps(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -2532,8 +2498,7 @@ func schema_pkg_apis_apiextensions_v1_JSONSchemaProps(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.JSONSchemaProps{}.OpenAPIModelName()), + Ref: ref(v1.JSONSchemaProps{}.OpenAPIModelName()), }, }, }, @@ -2550,8 +2515,7 @@ func schema_pkg_apis_apiextensions_v1_JSONSchemaProps(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.JSONSchemaProps{}.OpenAPIModelName()), + Ref: ref(v1.JSONSchemaProps{}.OpenAPIModelName()), }, }, }, @@ -2568,8 +2532,7 @@ func schema_pkg_apis_apiextensions_v1_JSONSchemaProps(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.JSONSchemaProps{}.OpenAPIModelName()), + Ref: ref(v1.JSONSchemaProps{}.OpenAPIModelName()), }, }, }, @@ -2587,8 +2550,7 @@ func schema_pkg_apis_apiextensions_v1_JSONSchemaProps(ref common.ReferenceCallba Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.JSONSchemaProps{}.OpenAPIModelName()), + Ref: ref(v1.JSONSchemaProps{}.OpenAPIModelName()), }, }, }, @@ -2606,8 +2568,7 @@ func schema_pkg_apis_apiextensions_v1_JSONSchemaProps(ref common.ReferenceCallba Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.JSONSchemaProps{}.OpenAPIModelName()), + Ref: ref(v1.JSONSchemaProps{}.OpenAPIModelName()), }, }, }, @@ -2638,8 +2599,7 @@ func schema_pkg_apis_apiextensions_v1_JSONSchemaProps(ref common.ReferenceCallba Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.JSONSchemaProps{}.OpenAPIModelName()), + Ref: ref(v1.JSONSchemaProps{}.OpenAPIModelName()), }, }, }, @@ -2694,9 +2654,8 @@ func schema_pkg_apis_apiextensions_v1_JSONSchemaProps(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -2733,8 +2692,7 @@ func schema_pkg_apis_apiextensions_v1_JSONSchemaProps(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ValidationRule{}.OpenAPIModelName()), + Ref: ref(v1.ValidationRule{}.OpenAPIModelName()), }, }, }, @@ -2968,9 +2926,8 @@ func schema_pkg_apis_apiextensions_v1_WebhookConversion(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3074,8 +3031,7 @@ func schema_pkg_apis_meta_v1_APIGroup(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.GroupVersionForDiscovery{}.OpenAPIModelName()), + Ref: ref(metav1.GroupVersionForDiscovery{}.OpenAPIModelName()), }, }, }, @@ -3100,8 +3056,7 @@ func schema_pkg_apis_meta_v1_APIGroup(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.ServerAddressByClientCIDR{}.OpenAPIModelName()), + Ref: ref(metav1.ServerAddressByClientCIDR{}.OpenAPIModelName()), }, }, }, @@ -3149,8 +3104,7 @@ func schema_pkg_apis_meta_v1_APIGroupList(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.APIGroup{}.OpenAPIModelName()), + Ref: ref(metav1.APIGroup{}.OpenAPIModelName()), }, }, }, @@ -3225,9 +3179,8 @@ func schema_pkg_apis_meta_v1_APIResource(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3245,9 +3198,8 @@ func schema_pkg_apis_meta_v1_APIResource(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3265,9 +3217,8 @@ func schema_pkg_apis_meta_v1_APIResource(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3328,8 +3279,7 @@ func schema_pkg_apis_meta_v1_APIResourceList(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.APIResource{}.OpenAPIModelName()), + Ref: ref(metav1.APIResource{}.OpenAPIModelName()), }, }, }, @@ -3377,9 +3327,8 @@ func schema_pkg_apis_meta_v1_APIVersions(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3397,8 +3346,7 @@ func schema_pkg_apis_meta_v1_APIVersions(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.ServerAddressByClientCIDR{}.OpenAPIModelName()), + Ref: ref(metav1.ServerAddressByClientCIDR{}.OpenAPIModelName()), }, }, }, @@ -3446,9 +3394,8 @@ func schema_pkg_apis_meta_v1_ApplyOptions(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3571,9 +3518,8 @@ func schema_pkg_apis_meta_v1_CreateOptions(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3659,9 +3605,8 @@ func schema_pkg_apis_meta_v1_DeleteOptions(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -3729,9 +3674,8 @@ func schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4014,9 +3958,8 @@ func schema_pkg_apis_meta_v1_LabelSelector(ref common.ReferenceCallback) common. Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4034,8 +3977,7 @@ func schema_pkg_apis_meta_v1_LabelSelector(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.LabelSelectorRequirement{}.OpenAPIModelName()), + Ref: ref(metav1.LabelSelectorRequirement{}.OpenAPIModelName()), }, }, }, @@ -4089,9 +4031,8 @@ func schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4189,9 +4130,17 @@ func schema_pkg_apis_meta_v1_ListMeta(ref common.ReferenceCallback) common.OpenA Format: "int64", }, }, + "shardInfo": { + SchemaProps: spec.SchemaProps{ + Description: "shardInfo is set when the list is a filtered subset of the full collection, as selected by a shard selector on the request. It echoes back the selector so clients can verify which shard they received and merge sharded responses. Clients should not cache sharded list responses as a full representation of the collection.\n\nThis is an alpha field and requires enabling the ShardedListAndWatch feature gate.", + Ref: ref(metav1.ShardInfo{}.OpenAPIModelName()), + }, + }, }, }, }, + Dependencies: []string{ + metav1.ShardInfo{}.OpenAPIModelName()}, } } @@ -4286,6 +4235,13 @@ func schema_pkg_apis_meta_v1_ListOptions(ref common.ReferenceCallback) common.Op Format: "", }, }, + "shardSelector": { + SchemaProps: spec.SchemaProps{ + Description: "shardSelector restricts the list of returned objects using a CEL-based shard selector expression. The format uses the shardRange() function combined with || (logical OR) to specify one or more hash ranges:\n\n shardRange(object.metadata.uid, '0x0', '0x8000000000000000')\n shardRange(object.metadata.uid, '0x0', '0x8000000000000000') || shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000')\n\nField paths use CEL-style object-rooted syntax (e.g. \"object.metadata.uid\"), NOT the fieldSelector format (\"metadata.uid\"). Currently supported paths:\n - object.metadata.uid\n - object.metadata.namespace\n\nhexStart and hexEnd are single-quoted CEL string literals with a '0x' prefix, defining the inclusive lower and exclusive upper bounds over the 64-bit FNV-1a hash space. The full range is [0x0, 0x10000000000000000), where the exclusive upper bound equals 2^64.\n\nExamples:\n 2-shard split:\n shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x8000000000000000')\n shard 1: shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000')\n 4-shard split:\n shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x4000000000000000')\n shard 1: shardRange(object.metadata.uid, '0x4000000000000000', '0x8000000000000000')\n shard 2: shardRange(object.metadata.uid, '0x8000000000000000', '0xc000000000000000')\n shard 3: shardRange(object.metadata.uid, '0xc000000000000000', '0x10000000000000000')\n\nThis is an alpha field and requires enabling the ShardedListAndWatch feature gate.", + Type: []string{"string"}, + Format: "", + }, + }, }, }, }, @@ -4449,9 +4405,8 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4465,9 +4420,8 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4490,8 +4444,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.OwnerReference{}.OpenAPIModelName()), + Ref: ref(metav1.OwnerReference{}.OpenAPIModelName()), }, }, }, @@ -4510,9 +4463,8 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4530,8 +4482,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.ManagedFieldsEntry{}.OpenAPIModelName()), + Ref: ref(metav1.ManagedFieldsEntry{}.OpenAPIModelName()), }, }, }, @@ -4681,8 +4632,7 @@ func schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.PartialObjectMetadata{}.OpenAPIModelName()), + Ref: ref(metav1.PartialObjectMetadata{}.OpenAPIModelName()), }, }, }, @@ -4741,9 +4691,8 @@ func schema_pkg_apis_meta_v1_PatchOptions(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4822,9 +4771,8 @@ func schema_pkg_apis_meta_v1_RootPaths(ref common.ReferenceCallback) common.Open Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -4867,6 +4815,28 @@ func schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref common.ReferenceCallb } } +func schema_pkg_apis_meta_v1_ShardInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ShardInfo describes the shard selector that was applied to produce a list response. Its presence on a list response indicates the list is a filtered subset.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "selector": { + SchemaProps: spec.SchemaProps{ + Description: "selector is the shard selector string from the request, echoed back so clients can verify which shard they received and merge responses from multiple shards.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"selector"}, + }, + }, + } +} + func schema_pkg_apis_meta_v1_Status(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -5018,8 +4988,7 @@ func schema_pkg_apis_meta_v1_StatusDetails(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.StatusCause{}.OpenAPIModelName()), + Ref: ref(metav1.StatusCause{}.OpenAPIModelName()), }, }, }, @@ -5080,8 +5049,7 @@ func schema_pkg_apis_meta_v1_Table(ref common.ReferenceCallback) common.OpenAPID Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.TableColumnDefinition{}.OpenAPIModelName()), + Ref: ref(metav1.TableColumnDefinition{}.OpenAPIModelName()), }, }, }, @@ -5099,8 +5067,7 @@ func schema_pkg_apis_meta_v1_Table(ref common.ReferenceCallback) common.OpenAPID Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.TableRow{}.OpenAPIModelName()), + Ref: ref(metav1.TableRow{}.OpenAPIModelName()), }, }, }, @@ -5241,8 +5208,7 @@ func schema_pkg_apis_meta_v1_TableRow(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(metav1.TableRowCondition{}.OpenAPIModelName()), + Ref: ref(metav1.TableRowCondition{}.OpenAPIModelName()), }, }, }, @@ -5409,9 +5375,8 @@ func schema_pkg_apis_meta_v1_UpdateOptions(ref common.ReferenceCallback) common. Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Type: []string{"string"}, + Format: "", }, }, }, @@ -5470,7 +5435,7 @@ func schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref common.ReferenceCall return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", + Description: "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\"\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\"\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", Type: []string{"object"}, }, }, @@ -5481,7 +5446,7 @@ func schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref common.ReferenceCallback return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, like this:\n\n\ttype MyAwesomeAPIObject struct {\n\t runtime.TypeMeta `json:\",inline\"`\n\t ... // other fields\n\t}\n\nfunc (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind\n\nTypeMeta is provided here for convenience. You may use it directly from this package or define your own with the same fields.", + Description: "TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, like this:\n\n\ttype MyAwesomeAPIObject struct {\n\t runtime.TypeMeta `json:\"\"`\n\t ... // other fields\n\t}\n\nfunc (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind\n\nTypeMeta is provided here for convenience. You may use it directly from this package or define your own with the same fields.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "apiVersion": { diff --git a/pkg/registry/apps/application/rest.go b/pkg/registry/apps/application/rest.go index 18119bad9..a67eca65f 100644 --- a/pkg/registry/apps/application/rest.go +++ b/pkg/registry/apps/application/rest.go @@ -792,12 +792,12 @@ func (r *REST) Watch(ctx context.Context, options *metainternalversion.ListOptio } helmLabelSelector = labels.NewSelector().Add(labelRequirements...) - // Honor SendInitialEvents (WatchList): the client expects all existing + // Honor a WatchList request: the client expects all existing // objects as ADDED events, then a Bookmark annotated with // metav1.InitialEventsAnnotationKey. controller-runtime's cache already // replays the ADDED events, so we just emit the terminating bookmark. - sendInitialEvents := options.SendInitialEvents != nil && *options.SendInitialEvents - bookmarker := registry.NewInitialEventsBookmarker(sendInitialEvents, options.ResourceVersion, func() runtime.Object { + initialEventsEnd := registry.InitialEventsEndBookmarkRequested(options) + bookmarker := registry.NewInitialEventsBookmarker(initialEventsEnd, options.ResourceVersion, func() runtime.Object { app := &appsv1alpha1.Application{} app.TypeMeta = metav1.TypeMeta{ APIVersion: appsv1alpha1.SchemeGroupVersion.String(), @@ -819,10 +819,10 @@ func (r *REST) Watch(ctx context.Context, options *metainternalversion.ListOptio helmWatcher, err := r.w.Watch(ctx, hrList, &client.ListOptions{ Namespace: namespace, LabelSelector: helmLabelSelector, - // Ask the backing watch for bookmarks on a WatchList request; the - // apiserver omits them by default, leaving the terminating - // initial-events-end bookmark with no reliable trigger. - Raw: &metav1.ListOptions{AllowWatchBookmarks: sendInitialEvents}, + // Backing bookmarks are forwarded to the client, so ask for them only + // when the client did; a WatchList client always does, which keeps + // the terminating bookmark's trigger. + Raw: &metav1.ListOptions{AllowWatchBookmarks: options.AllowWatchBookmarks}, }) if err != nil { klog.Errorf("Error setting up watch for HelmReleases: %v", err) diff --git a/pkg/registry/apps/application/rest_watch_initial_events_test.go b/pkg/registry/apps/application/rest_watch_initial_events_test.go new file mode 100644 index 000000000..00f88cfde --- /dev/null +++ b/pkg/registry/apps/application/rest_watch_initial_events_test.go @@ -0,0 +1,194 @@ +/* +Copyright 2026 The Cozystack Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package application + +import ( + "context" + "testing" + "time" + + helmv2 "github.com/fluxcd/helm-controller/api/v2" + metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/apiserver/pkg/endpoints/request" + "sigs.k8s.io/controller-runtime/pkg/client/fake" + + appsv1alpha1 "github.com/cozystack/cozystack/pkg/apis/apps/v1alpha1" + "github.com/cozystack/cozystack/pkg/config" + "github.com/cozystack/cozystack/pkg/registry/registrytest" +) + +func newWatchTestREST(t *testing.T) *REST { + t.Helper() + scheme := runtime.NewScheme() + if err := helmv2.AddToScheme(scheme); err != nil { + t.Fatalf("register helmv2 scheme: %v", err) + } + fc := fake.NewClientBuilder().WithScheme(scheme).Build() + return NewREST(fc, fc, &config.Resource{ + Application: config.ApplicationConfig{Kind: "Redis", Singular: "redis", Plural: "redises"}, + Release: config.ReleaseConfig{Prefix: "redis-"}, + }) +} + +func redisRelease(name string) *helmv2.HelmRelease { + return &helmv2.HelmRelease{ + ObjectMeta: metav1.ObjectMeta{ + Name: "redis-" + name, + Namespace: "tenant-a", + Labels: map[string]string{ + ApplicationKindLabel: "Redis", + ApplicationGroupLabel: appsv1alpha1.GroupName, + }, + }, + } +} + +func collectWatchEvents(w watch.Interface, n int, timeout time.Duration) []watch.Event { + var out []watch.Event + deadline := time.After(timeout) + for len(out) < n { + select { + case ev, ok := <-w.ResultChan(): + if !ok { + return out + } + out = append(out, ev) + case <-deadline: + return out + } + } + return out +} + +// driveCreateAndUpdate creates a release behind the watch and then touches it, +// because fake.Client.Watch doesn't replay existing objects as ADDED. +func driveCreateAndUpdate(ctx context.Context, t *testing.T, r *REST) { + t.Helper() + hr := redisRelease("cache") + if err := r.c.Create(ctx, hr); err != nil { + t.Fatalf("create HelmRelease: %v", err) + } + hr.Annotations = map[string]string{"touched": "1"} + if err := r.c.Update(ctx, hr); err != nil { + t.Fatalf("update HelmRelease: %v", err) + } +} + +func TestWatch_SendInitialEvents_EmitsInitialEventsEndBookmark(t *testing.T) { + r := newWatchTestREST(t) + ctx, cancel := context.WithCancel(request.WithNamespace(context.Background(), "tenant-a")) + defer cancel() + + sendInitialEvents := true + w, err := r.Watch(ctx, &metainternalversion.ListOptions{SendInitialEvents: &sendInitialEvents, AllowWatchBookmarks: true}) + if err != nil { + t.Fatalf("Watch returned error: %v", err) + } + defer w.Stop() + driveCreateAndUpdate(ctx, t, r) + + evs := collectWatchEvents(w, 3, 2*time.Second) + if len(evs) < 3 { + t.Fatalf("expected at least 3 events (Added, Bookmark, Modified), got %d: %+v", len(evs), evs) + } + if evs[0].Type != watch.Added { + t.Fatalf("event[0]: expected Added, got %s", evs[0].Type) + } + if evs[1].Type != watch.Bookmark { + t.Fatalf("event[1]: expected Bookmark, got %s", evs[1].Type) + } + bookmark, ok := evs[1].Object.(*appsv1alpha1.Application) + if !ok { + t.Fatalf("event[1]: expected *Application, got %T", evs[1].Object) + } + if got := bookmark.Annotations[metav1.InitialEventsAnnotationKey]; got != "true" { + t.Fatalf("event[1]: expected annotation %s=true, got %q", metav1.InitialEventsAnnotationKey, got) + } + if evs[2].Type != watch.Modified { + t.Fatalf("event[2]: expected Modified after bookmark, got %s", evs[2].Type) + } +} + +// TestWatch_BackingBookmarksFollowTheClient pins that the backing watch asks for +// bookmarks only when the client did: every backing bookmark is forwarded, and +// the fake client never sends one, so the event stream alone cannot show it. +func TestWatch_BackingBookmarksFollowTheClient(t *testing.T) { + yes := true + for _, tc := range []struct { + name string + opts metainternalversion.ListOptions + want bool + }{ + {"plain watch defaulted by the apiserver", metainternalversion.ListOptions{SendInitialEvents: &yes}, false}, + {"watch list", metainternalversion.ListOptions{SendInitialEvents: &yes, AllowWatchBookmarks: true}, true}, + {"bookmarks only", metainternalversion.ListOptions{AllowWatchBookmarks: true}, true}, + } { + t.Run(tc.name, func(t *testing.T) { + r := newWatchTestREST(t) + spy := ®istrytest.RawRecordingWatch{WithWatch: r.w} + r.w = spy + ctx, cancel := context.WithCancel(request.WithNamespace(context.Background(), "tenant-a")) + defer cancel() + + w, err := r.Watch(ctx, &tc.opts) + if err != nil { + t.Fatalf("Watch returned error: %v", err) + } + defer w.Stop() + + raw := spy.RawFor(&helmv2.HelmReleaseList{}) + if raw == nil { + t.Fatal("backing watch was called without raw options") + } + if raw.AllowWatchBookmarks != tc.want { + t.Fatalf("backing AllowWatchBookmarks = %v, want %v", raw.AllowWatchBookmarks, tc.want) + } + }) + } +} + +// TestWatch_PlainWatch_EmitsNoInitialEventsEndBookmark covers a watch with no +// resourceVersion: the apiserver defaults SendInitialEvents on for it but leaves +// bookmarks off, so the client never asked for the terminating bookmark. +func TestWatch_PlainWatch_EmitsNoInitialEventsEndBookmark(t *testing.T) { + r := newWatchTestREST(t) + ctx, cancel := context.WithCancel(request.WithNamespace(context.Background(), "tenant-a")) + defer cancel() + + sendInitialEvents := true + w, err := r.Watch(ctx, &metainternalversion.ListOptions{SendInitialEvents: &sendInitialEvents}) + if err != nil { + t.Fatalf("Watch returned error: %v", err) + } + defer w.Stop() + driveCreateAndUpdate(ctx, t, r) + + evs := collectWatchEvents(w, 3, 2*time.Second) + var types []watch.EventType + for _, ev := range evs { + types = append(types, ev.Type) + if ev.Type == watch.Bookmark { + t.Fatalf("unrequested bookmark on a plain watch: %+v", ev.Object) + } + } + if len(types) != 2 || types[0] != watch.Added || types[1] != watch.Modified { + t.Fatalf("expected [ADDED MODIFIED], got %v", types) + } +} diff --git a/pkg/registry/core/tenantmodule/rest.go b/pkg/registry/core/tenantmodule/rest.go index 50021c86a..5f3d96f8d 100644 --- a/pkg/registry/core/tenantmodule/rest.go +++ b/pkg/registry/core/tenantmodule/rest.go @@ -366,10 +366,7 @@ func (r *REST) Watch(ctx context.Context, options *metainternalversion.ListOptio } } - // For a SendInitialEvents (WatchList) request, ask the backing watch for - // bookmarks — the apiserver omits them by default, which would leave the - // terminating initial-events-end bookmark with no reliable trigger. - sendInitialEvents := options.SendInitialEvents != nil && *options.SendInitialEvents + initialEventsEnd := registry.InitialEventsEndBookmarkRequested(options) // Start watch on HelmRelease with label selector only // Field selectors are not supported by controller-runtime cache @@ -378,7 +375,10 @@ func (r *REST) Watch(ctx context.Context, options *metainternalversion.ListOptio helmWatcher, err := r.w.Watch(ctx, hrList, &client.ListOptions{ Namespace: namespace, LabelSelector: helmLabelSelector, - Raw: &metav1.ListOptions{AllowWatchBookmarks: sendInitialEvents}, + // Backing bookmarks are forwarded to the client, so ask for them only + // when the client did; a WatchList client always does, which keeps + // the terminating bookmark's trigger. + Raw: &metav1.ListOptions{AllowWatchBookmarks: options.AllowWatchBookmarks}, }) if err != nil { klog.Errorf("Error setting up watch for HelmReleases: %v", err) @@ -387,7 +387,7 @@ func (r *REST) Watch(ctx context.Context, options *metainternalversion.ListOptio // Emit the initial-events-end bookmark after the initial ADDED events so // client-go reflectors reach HasSynced. - bookmarker := registry.NewInitialEventsBookmarker(sendInitialEvents, options.ResourceVersion, func() runtime.Object { + bookmarker := registry.NewInitialEventsBookmarker(initialEventsEnd, options.ResourceVersion, func() runtime.Object { module := &corev1alpha1.TenantModule{} module.TypeMeta = metav1.TypeMeta{ APIVersion: corev1alpha1.SchemeGroupVersion.String(), diff --git a/pkg/registry/core/tenantmodule/rest_watch_test.go b/pkg/registry/core/tenantmodule/rest_watch_test.go index acb29b349..e035f5c50 100644 --- a/pkg/registry/core/tenantmodule/rest_watch_test.go +++ b/pkg/registry/core/tenantmodule/rest_watch_test.go @@ -16,6 +16,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" corev1alpha1 "github.com/cozystack/cozystack/pkg/apis/core/v1alpha1" + "github.com/cozystack/cozystack/pkg/registry/registrytest" ) const testNamespace = "tenant-foo" @@ -59,7 +60,7 @@ func TestWatch_SendInitialEvents_EmitsInitialEventsEndBookmark(t *testing.T) { defer cancel() sendInitialEvents := true - w, err := r.Watch(ctx, &metainternalversion.ListOptions{SendInitialEvents: &sendInitialEvents}) + w, err := r.Watch(ctx, &metainternalversion.ListOptions{SendInitialEvents: &sendInitialEvents, AllowWatchBookmarks: true}) if err != nil { t.Fatalf("Watch returned error: %v", err) } @@ -116,3 +117,96 @@ func TestWatch_SendInitialEvents_EmitsInitialEventsEndBookmark(t *testing.T) { t.Fatalf("event[2]: expected Modified after bookmark, got %s", evs[2].Type) } } + +// TestWatch_BackingBookmarksFollowTheClient pins that the backing watch asks for +// bookmarks only when the client did: every backing bookmark is forwarded, and +// the fake client never sends one, so the event stream alone cannot show it. +func TestWatch_BackingBookmarksFollowTheClient(t *testing.T) { + yes := true + for _, tc := range []struct { + name string + opts metainternalversion.ListOptions + want bool + }{ + {"plain watch defaulted by the apiserver", metainternalversion.ListOptions{SendInitialEvents: &yes}, false}, + {"watch list", metainternalversion.ListOptions{SendInitialEvents: &yes, AllowWatchBookmarks: true}, true}, + {"bookmarks only", metainternalversion.ListOptions{AllowWatchBookmarks: true}, true}, + } { + t.Run(tc.name, func(t *testing.T) { + scheme := runtime.NewScheme() + if err := helmv2.AddToScheme(scheme); err != nil { + t.Fatalf("add helmv2 to scheme: %v", err) + } + fc := fake.NewClientBuilder().WithScheme(scheme).Build() + spy := ®istrytest.RawRecordingWatch{WithWatch: fc} + r := NewREST(fc, spy) + ctx, cancel := context.WithCancel(request.WithNamespace(context.Background(), testNamespace)) + defer cancel() + + w, err := r.Watch(ctx, &tc.opts) + if err != nil { + t.Fatalf("Watch returned error: %v", err) + } + defer w.Stop() + + raw := spy.RawFor(&helmv2.HelmReleaseList{}) + if raw == nil { + t.Fatal("backing watch was called without raw options") + } + if raw.AllowWatchBookmarks != tc.want { + t.Fatalf("backing AllowWatchBookmarks = %v, want %v", raw.AllowWatchBookmarks, tc.want) + } + }) + } +} + +// TestWatch_PlainWatch_EmitsNoInitialEventsEndBookmark covers a watch with no +// resourceVersion: the apiserver defaults SendInitialEvents on for it but leaves +// bookmarks off, so the client never asked for the terminating bookmark. +func TestWatch_PlainWatch_EmitsNoInitialEventsEndBookmark(t *testing.T) { + scheme := runtime.NewScheme() + if err := helmv2.AddToScheme(scheme); err != nil { + t.Fatalf("add helmv2 to scheme: %v", err) + } + fc := fake.NewClientBuilder().WithScheme(scheme).Build() + r := NewREST(fc, fc) + + ctx, cancel := context.WithCancel(request.WithNamespace(context.Background(), testNamespace)) + defer cancel() + + sendInitialEvents := true + w, err := r.Watch(ctx, &metainternalversion.ListOptions{SendInitialEvents: &sendInitialEvents}) + if err != nil { + t.Fatalf("Watch returned error: %v", err) + } + defer w.Stop() + + hr := &helmv2.HelmRelease{ + ObjectMeta: metav1.ObjectMeta{ + Name: "module-a", + Namespace: testNamespace, + Labels: map[string]string{ + TenantModuleLabelKey: TenantModuleLabelValue, + }, + }, + } + if err := r.c.Create(ctx, hr); err != nil { + t.Fatalf("create HelmRelease: %v", err) + } + hr.Annotations = map[string]string{"touched": "1"} + if err := r.c.Update(ctx, hr); err != nil { + t.Fatalf("update HelmRelease: %v", err) + } + + evs := collectEvents(t, w, 3, 2*time.Second) + var types []watch.EventType + for _, ev := range evs { + types = append(types, ev.Type) + if ev.Type == watch.Bookmark { + t.Fatalf("unrequested bookmark on a plain watch: %+v", ev.Object) + } + } + if len(types) != 2 || types[0] != watch.Added || types[1] != watch.Modified { + t.Fatalf("expected [ADDED MODIFIED], got %v", types) + } +} diff --git a/pkg/registry/core/tenantnamespace/rest.go b/pkg/registry/core/tenantnamespace/rest.go index b52b5e722..cd49c17c8 100644 --- a/pkg/registry/core/tenantnamespace/rest.go +++ b/pkg/registry/core/tenantnamespace/rest.go @@ -175,16 +175,16 @@ func (r *REST) Watch(ctx context.Context, opts *metainternal.ListOptions) (watch nsList := &corev1.NamespaceList{} - // For a SendInitialEvents (WatchList) request, ask the backing watch for - // bookmarks — the apiserver omits them by default, which would leave the - // terminating initial-events-end bookmark with no reliable trigger. - sendInitialEvents := opts.SendInitialEvents != nil && *opts.SendInitialEvents + initialEventsEnd := registry.InitialEventsEndBookmarkRequested(opts) // Build upstream watch options with field and label selectors rawOpts := &metav1.ListOptions{ - Watch: true, - ResourceVersion: opts.ResourceVersion, - AllowWatchBookmarks: sendInitialEvents, + Watch: true, + ResourceVersion: opts.ResourceVersion, + // Backing bookmarks are forwarded to the client, so ask for them only + // when the client did; a WatchList client always does, which keeps + // the terminating bookmark's trigger. + AllowWatchBookmarks: opts.AllowWatchBookmarks, } if opts.FieldSelector != nil { rawOpts.FieldSelector = opts.FieldSelector.String() @@ -208,7 +208,7 @@ func (r *REST) Watch(ctx context.Context, opts *metainternal.ListOptions) (watch // Emit the initial-events-end bookmark after the initial ADDED events so // client-go reflectors reach HasSynced. - bookmarker := registry.NewInitialEventsBookmarker(sendInitialEvents, opts.ResourceVersion, func() runtime.Object { + bookmarker := registry.NewInitialEventsBookmarker(initialEventsEnd, opts.ResourceVersion, func() runtime.Object { return &corev1alpha1.TenantNamespace{ TypeMeta: metav1.TypeMeta{ APIVersion: corev1alpha1.SchemeGroupVersion.String(), diff --git a/pkg/registry/core/tenantnamespace/rest_watch_test.go b/pkg/registry/core/tenantnamespace/rest_watch_test.go index 4bec19b24..b4e24ceed 100644 --- a/pkg/registry/core/tenantnamespace/rest_watch_test.go +++ b/pkg/registry/core/tenantnamespace/rest_watch_test.go @@ -25,6 +25,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/interceptor" corev1alpha1 "github.com/cozystack/cozystack/pkg/apis/core/v1alpha1" + "github.com/cozystack/cozystack/pkg/registry/registrytest" ) // newTestScheme returns a scheme with the types Watch tests need: core @@ -170,7 +171,7 @@ func TestWatch_SendInitialEvents_EmitsInitialEventsEndBookmark(t *testing.T) { defer cancel() sendInitialEvents := true - w, err := r.Watch(ctx, &metainternal.ListOptions{SendInitialEvents: &sendInitialEvents}) + w, err := r.Watch(ctx, &metainternal.ListOptions{SendInitialEvents: &sendInitialEvents, AllowWatchBookmarks: true}) if err != nil { t.Fatalf("Watch returned error: %v", err) } @@ -220,6 +221,86 @@ func TestWatch_SendInitialEvents_EmitsInitialEventsEndBookmark(t *testing.T) { } } +// TestWatch_BackingBookmarksFollowTheClient pins that the backing watch asks for +// bookmarks only when the client did: every backing bookmark is forwarded, and +// the fake client never sends one, so the event stream alone cannot show it. +func TestWatch_BackingBookmarksFollowTheClient(t *testing.T) { + yes := true + for _, tc := range []struct { + name string + opts metainternal.ListOptions + want bool + }{ + {"plain watch defaulted by the apiserver", metainternal.ListOptions{SendInitialEvents: &yes}, false}, + {"watch list", metainternal.ListOptions{SendInitialEvents: &yes, AllowWatchBookmarks: true}, true}, + {"bookmarks only", metainternal.ListOptions{AllowWatchBookmarks: true}, true}, + } { + t.Run(tc.name, func(t *testing.T) { + fc := fake.NewClientBuilder().WithScheme(newTestScheme(t)).Build() + spy := ®istrytest.RawRecordingWatch{WithWatch: fc} + r := newTestREST(fc, spy) + + u := &user.DefaultInfo{Name: "admin", Groups: []string{"system:masters"}} + ctx, cancel := context.WithCancel(request.WithUser(context.Background(), u)) + defer cancel() + + w, err := r.Watch(ctx, &tc.opts) + if err != nil { + t.Fatalf("Watch returned error: %v", err) + } + defer w.Stop() + + raw := spy.RawFor(&corev1.NamespaceList{}) + if raw == nil { + t.Fatal("backing watch was called without raw options") + } + if raw.AllowWatchBookmarks != tc.want { + t.Fatalf("backing AllowWatchBookmarks = %v, want %v", raw.AllowWatchBookmarks, tc.want) + } + }) + } +} + +// TestWatch_PlainWatch_EmitsNoInitialEventsEndBookmark covers a watch with no +// resourceVersion: the apiserver defaults SendInitialEvents on for it but leaves +// bookmarks off, so the client never asked for the terminating bookmark. +func TestWatch_PlainWatch_EmitsNoInitialEventsEndBookmark(t *testing.T) { + fc := fake.NewClientBuilder().WithScheme(newTestScheme(t)).Build() + r := newTestREST(fc, fc) + + u := &user.DefaultInfo{Name: "admin", Groups: []string{"system:masters"}} + ctx, cancel := context.WithCancel(request.WithUser(context.Background(), u)) + defer cancel() + + sendInitialEvents := true + w, err := r.Watch(ctx, &metainternal.ListOptions{SendInitialEvents: &sendInitialEvents}) + if err != nil { + t.Fatalf("Watch returned error: %v", err) + } + defer w.Stop() + + ns := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "tenant-foo"}} + if err := r.c.Create(ctx, ns); err != nil { + t.Fatalf("create namespace: %v", err) + } + ns.Labels = map[string]string{"touched": "1"} + if err := r.c.Update(ctx, ns); err != nil { + t.Fatalf("update namespace: %v", err) + } + + evs := collectEvents(t, w, 3, 2*time.Second) + var types []watch.EventType + for _, ev := range evs { + types = append(types, ev.Type) + if ev.Type == watch.Bookmark { + t.Fatalf("unrequested bookmark on a plain watch: %+v", ev.Object) + } + } + if len(types) != 2 || types[0] != watch.Added || types[1] != watch.Modified { + t.Fatalf("expected [ADDED MODIFIED], got %v", types) + } +} + // The dropped-event assertions below rely on the watch pipeline being FIFO: a // dropped backing event always precedes the next delivered one, so when the // first event a test receives is the later fixture, the earlier one was @@ -585,8 +666,9 @@ func TestWatch_OnClose_FlushesTerminatingBookmark(t *testing.T) { sendInitialEvents := true w, err := r.Watch(ctx, &metainternal.ListOptions{ - ResourceVersion: "5", - SendInitialEvents: &sendInitialEvents, + ResourceVersion: "5", + SendInitialEvents: &sendInitialEvents, + AllowWatchBookmarks: true, }) if err != nil { t.Fatalf("Watch returned error: %v", err) @@ -705,7 +787,7 @@ func TestWatch_StoppedDuringInitialEventsEndBookmarkSend_TerminatesGoroutine(t * defer cancel() sendInitialEvents := true - w, err := r.Watch(ctx, &metainternal.ListOptions{SendInitialEvents: &sendInitialEvents}) + w, err := r.Watch(ctx, &metainternal.ListOptions{SendInitialEvents: &sendInitialEvents, AllowWatchBookmarks: true}) if err != nil { t.Fatalf("Watch returned error: %v", err) } diff --git a/pkg/registry/core/tenantsecret/rest.go b/pkg/registry/core/tenantsecret/rest.go index cf8446e01..e9bd409d1 100644 --- a/pkg/registry/core/tenantsecret/rest.go +++ b/pkg/registry/core/tenantsecret/rest.go @@ -478,19 +478,19 @@ func (r *REST) Watch(ctx context.Context, opts *metainternal.ListOptions) (watch return watch.NewProxyWatcher(ch), nil } - // For a SendInitialEvents (WatchList) request, ask the backing watch for - // bookmarks — the apiserver omits them by default, which would leave the - // terminating initial-events-end bookmark with no reliable trigger. - sendInitialEvents := opts.SendInitialEvents != nil && *opts.SendInitialEvents + initialEventsEnd := registry.InitialEventsEndBookmarkRequested(opts) secList := &corev1.SecretList{} base, err := r.w.Watch(ctx, secList, &client.ListOptions{ Namespace: ns, LabelSelector: ls, Raw: &metav1.ListOptions{ - Watch: true, - ResourceVersion: opts.ResourceVersion, - AllowWatchBookmarks: sendInitialEvents, + Watch: true, + ResourceVersion: opts.ResourceVersion, + // Backing bookmarks are forwarded to the client, so ask for them only + // when the client did; a WatchList client always does, which keeps + // the terminating bookmark's trigger. + AllowWatchBookmarks: opts.AllowWatchBookmarks, }, }) if err != nil { @@ -507,7 +507,7 @@ func (r *REST) Watch(ctx context.Context, opts *metainternal.ListOptions) (watch // Emit the initial-events-end bookmark after the initial ADDED events so // client-go reflectors reach HasSynced. - bookmarker := registry.NewInitialEventsBookmarker(sendInitialEvents, opts.ResourceVersion, func() runtime.Object { + bookmarker := registry.NewInitialEventsBookmarker(initialEventsEnd, opts.ResourceVersion, func() runtime.Object { return &corev1alpha1.TenantSecret{ TypeMeta: metav1.TypeMeta{ APIVersion: corev1alpha1.SchemeGroupVersion.String(), diff --git a/pkg/registry/core/tenantsecret/rest_watch_test.go b/pkg/registry/core/tenantsecret/rest_watch_test.go index 3d6ab713a..b39b50ac5 100644 --- a/pkg/registry/core/tenantsecret/rest_watch_test.go +++ b/pkg/registry/core/tenantsecret/rest_watch_test.go @@ -7,12 +7,14 @@ import ( "testing" "time" + corev1 "k8s.io/api/core/v1" metainternal "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/watch" "k8s.io/apiserver/pkg/endpoints/request" corev1alpha1 "github.com/cozystack/cozystack/pkg/apis/core/v1alpha1" + "github.com/cozystack/cozystack/pkg/registry/registrytest" ) // collectEvents drains up to n events from the watch, or returns early if the @@ -49,7 +51,7 @@ func TestWatch_SendInitialEvents_EmitsInitialEventsEndBookmark(t *testing.T) { defer cancel() sendInitialEvents := true - w, err := r.Watch(ctx, &metainternal.ListOptions{SendInitialEvents: &sendInitialEvents}) + w, err := r.Watch(ctx, &metainternal.ListOptions{SendInitialEvents: &sendInitialEvents, AllowWatchBookmarks: true}) if err != nil { t.Fatalf("Watch returned error: %v", err) } @@ -98,3 +100,79 @@ func TestWatch_SendInitialEvents_EmitsInitialEventsEndBookmark(t *testing.T) { t.Fatalf("event[2]: expected Modified after bookmark, got %s", evs[2].Type) } } + +// TestWatch_BackingBookmarksFollowTheClient pins that the backing watch asks for +// bookmarks only when the client did: every backing bookmark is forwarded, and +// the fake client never sends one, so the event stream alone cannot show it. +func TestWatch_BackingBookmarksFollowTheClient(t *testing.T) { + yes := true + for _, tc := range []struct { + name string + opts metainternal.ListOptions + want bool + }{ + {"plain watch defaulted by the apiserver", metainternal.ListOptions{SendInitialEvents: &yes}, false}, + {"watch list", metainternal.ListOptions{SendInitialEvents: &yes, AllowWatchBookmarks: true}, true}, + {"bookmarks only", metainternal.ListOptions{AllowWatchBookmarks: true}, true}, + } { + t.Run(tc.name, func(t *testing.T) { + r := newTestREST(t) + spy := ®istrytest.RawRecordingWatch{WithWatch: r.w} + r.w = spy + ctx, cancel := context.WithCancel(request.WithNamespace(context.Background(), testNamespace)) + defer cancel() + + w, err := r.Watch(ctx, &tc.opts) + if err != nil { + t.Fatalf("Watch returned error: %v", err) + } + defer w.Stop() + + raw := spy.RawFor(&corev1.SecretList{}) + if raw == nil { + t.Fatal("backing watch was called without raw options") + } + if raw.AllowWatchBookmarks != tc.want { + t.Fatalf("backing AllowWatchBookmarks = %v, want %v", raw.AllowWatchBookmarks, tc.want) + } + }) + } +} + +// TestWatch_PlainWatch_EmitsNoInitialEventsEndBookmark covers a watch with no +// resourceVersion: the apiserver defaults SendInitialEvents on for it but leaves +// bookmarks off, so the client never asked for the terminating bookmark. +func TestWatch_PlainWatch_EmitsNoInitialEventsEndBookmark(t *testing.T) { + r := newTestREST(t) + + ctx, cancel := context.WithCancel(request.WithNamespace(context.Background(), testNamespace)) + defer cancel() + + sendInitialEvents := true + w, err := r.Watch(ctx, &metainternal.ListOptions{SendInitialEvents: &sendInitialEvents}) + if err != nil { + t.Fatalf("Watch returned error: %v", err) + } + defer w.Stop() + + sec := makeTenantSecret("harbor-test-credentials", nil) + if err := r.c.Create(ctx, sec); err != nil { + t.Fatalf("create secret: %v", err) + } + sec.Annotations = map[string]string{"touched": "1"} + if err := r.c.Update(ctx, sec); err != nil { + t.Fatalf("update secret: %v", err) + } + + evs := collectEvents(t, w, 3, 2*time.Second) + var types []watch.EventType + for _, ev := range evs { + types = append(types, ev.Type) + if ev.Type == watch.Bookmark { + t.Fatalf("unrequested bookmark on a plain watch: %+v", ev.Object) + } + } + if len(types) != 2 || types[0] != watch.Added || types[1] != watch.Modified { + t.Fatalf("expected [ADDED MODIFIED], got %v", types) + } +} diff --git a/pkg/registry/registrytest/watch.go b/pkg/registry/registrytest/watch.go new file mode 100644 index 000000000..15d168a44 --- /dev/null +++ b/pkg/registry/registrytest/watch.go @@ -0,0 +1,57 @@ +/* +Copyright 2026 The Cozystack Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package registrytest holds test helpers shared by the aggregated storages. +package registrytest + +import ( + "context" + "reflect" + "sync" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/watch" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +// RawRecordingWatch records the raw options of each backing watch request, per +// list type, and passes the call through. The controller-runtime fake client +// ignores most raw options, so their effect cannot be read off the event stream. +type RawRecordingWatch struct { + client.WithWatch + + mu sync.Mutex + raw map[reflect.Type]*metav1.ListOptions +} + +func (s *RawRecordingWatch) Watch(ctx context.Context, list client.ObjectList, opts ...client.ListOption) (watch.Interface, error) { + lo := &client.ListOptions{} + lo.ApplyOptions(opts) + s.mu.Lock() + if s.raw == nil { + s.raw = map[reflect.Type]*metav1.ListOptions{} + } + s.raw[reflect.TypeOf(list)] = lo.Raw + s.mu.Unlock() + return s.WithWatch.Watch(ctx, list, opts...) +} + +// RawFor returns the raw options of the last watch on list's type, or nil. +func (s *RawRecordingWatch) RawFor(list client.ObjectList) *metav1.ListOptions { + s.mu.Lock() + defer s.mu.Unlock() + return s.raw[reflect.TypeOf(list)] +} diff --git a/pkg/registry/sdn/securitygroup/cilium.go b/pkg/registry/sdn/securitygroup/cilium.go index 9b40e36e4..fa0ddb65a 100644 --- a/pkg/registry/sdn/securitygroup/cilium.go +++ b/pkg/registry/sdn/securitygroup/cilium.go @@ -19,8 +19,11 @@ import ( // CiliumNetworkPolicy resource. It carries only the metadata and the subset of // the policy spec that SecurityGroup exposes, so the Cozystack API server can // read and write CiliumNetworkPolicy objects through a controller-runtime -// client without importing the full Cilium module (which pins a Kubernetes -// version incompatible with this project's apimachinery fork). +// client without importing the full Cilium module. Importing it would tie this +// project's k8s.io libraries to Cilium's: Go builds with the higher of the two +// required versions, so a Cilium release built on a newer Kubernetes would drag +// them forward, and one built on an older Kubernetes would have to compile +// against ours. type CiliumNetworkPolicy struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/registry/sdn/securitygroup/rest.go b/pkg/registry/sdn/securitygroup/rest.go index 5c880fa8b..a06439a75 100644 --- a/pkg/registry/sdn/securitygroup/rest.go +++ b/pkg/registry/sdn/securitygroup/rest.go @@ -964,11 +964,10 @@ func (r *REST) Watch(ctx context.Context, opts *metainternal.ListOptions) (watch // fallback. ResourceVersionMatch must accompany SendInitialEvents. SendInitialEvents: opts.SendInitialEvents, ResourceVersionMatch: opts.ResourceVersionMatch, - // AllowWatchBookmarks and SendInitialEvents are independent watch - // features: honor an explicit client bookmark request, and also enable - // bookmarks when initial events are requested so the terminating - // initial-events bookmark can fire. - AllowWatchBookmarks: opts.AllowWatchBookmarks || sendInitialEvents, + // Backing bookmarks are forwarded to the client, so ask for them only + // when the client did; a WatchList client always does, which keeps + // the terminating bookmark's trigger. + AllowWatchBookmarks: opts.AllowWatchBookmarks, }, }) if err != nil { @@ -982,7 +981,7 @@ func (r *REST) Watch(ctx context.Context, opts *metainternal.ListOptions) (watch } } - bookmarker := registry.NewInitialEventsBookmarker(sendInitialEvents, opts.ResourceVersion, func() runtime.Object { + bookmarker := registry.NewInitialEventsBookmarker(registry.InitialEventsEndBookmarkRequested(opts), opts.ResourceVersion, func() runtime.Object { return &sdnv1alpha1.SecurityGroup{ TypeMeta: metav1.TypeMeta{ APIVersion: sdnv1alpha1.SchemeGroupVersion.String(), diff --git a/pkg/registry/sdn/securitygroup/rest_watch_test.go b/pkg/registry/sdn/securitygroup/rest_watch_test.go index efeae396d..014c9512e 100644 --- a/pkg/registry/sdn/securitygroup/rest_watch_test.go +++ b/pkg/registry/sdn/securitygroup/rest_watch_test.go @@ -15,6 +15,7 @@ import ( "k8s.io/apimachinery/pkg/watch" sdnv1alpha1 "github.com/cozystack/cozystack/pkg/apis/sdn/v1alpha1" + "github.com/cozystack/cozystack/pkg/registry/registrytest" ) // collectEvents drains up to n events from the watch, or returns early if the @@ -109,7 +110,10 @@ func TestWatchDeletedEventPassesThrough(t *testing.T) { } } -func TestWatchSendInitialEventsEmitsBookmark(t *testing.T) { +// TestWatchPlainWatchEmitsNoInitialEventsEndBookmark covers a watch with no +// resourceVersion: the apiserver defaults SendInitialEvents on for it but leaves +// bookmarks off, so the client never asked for the terminating bookmark. +func TestWatchPlainWatchEmitsNoInitialEventsEndBookmark(t *testing.T) { r := newTestREST(t) ctx, cancel := context.WithCancel(ctxNS()) defer cancel() @@ -130,6 +134,78 @@ func TestWatchSendInitialEventsEmitsBookmark(t *testing.T) { t.Fatalf("update marked: %v", err) } + evs := collectEvents(t, w, 3, 2*time.Second) + var types []watch.EventType + for _, ev := range evs { + types = append(types, ev.Type) + if ev.Type == watch.Bookmark { + t.Fatalf("unrequested bookmark on a plain watch: %+v", ev.Object) + } + } + if len(types) != 2 || types[0] != watch.Added || types[1] != watch.Modified { + t.Fatalf("expected [ADDED MODIFIED], got %v", types) + } +} + +// TestWatchBackingBookmarksFollowTheClient pins that the backing watch asks for +// bookmarks only when the client did: every backing bookmark is forwarded, and +// the fake client never sends one, so the event stream alone cannot show it. +func TestWatchBackingBookmarksFollowTheClient(t *testing.T) { + yes := true + for _, tc := range []struct { + name string + opts metainternal.ListOptions + want bool + }{ + {"plain watch defaulted by the apiserver", metainternal.ListOptions{SendInitialEvents: &yes}, false}, + {"watch list", metainternal.ListOptions{SendInitialEvents: &yes, AllowWatchBookmarks: true}, true}, + {"bookmarks only", metainternal.ListOptions{AllowWatchBookmarks: true}, true}, + } { + t.Run(tc.name, func(t *testing.T) { + r := newTestREST(t) + spy := ®istrytest.RawRecordingWatch{WithWatch: r.w} + r.w = spy + ctx, cancel := context.WithCancel(ctxNS()) + defer cancel() + + w, err := r.Watch(ctx, &tc.opts) + if err != nil { + t.Fatalf("Watch returned error: %v", err) + } + defer w.Stop() + + raw := spy.RawFor(&CiliumNetworkPolicyList{}) + if raw == nil { + t.Fatal("backing watch was called without raw options") + } + if raw.AllowWatchBookmarks != tc.want { + t.Fatalf("backing AllowWatchBookmarks = %v, want %v", raw.AllowWatchBookmarks, tc.want) + } + }) + } +} + +func TestWatchSendInitialEventsEmitsBookmark(t *testing.T) { + r := newTestREST(t) + ctx, cancel := context.WithCancel(ctxNS()) + defer cancel() + + sendInitialEvents := true + w, err := r.Watch(ctx, &metainternal.ListOptions{SendInitialEvents: &sendInitialEvents, AllowWatchBookmarks: true}) + if err != nil { + t.Fatalf("Watch returned error: %v", err) + } + defer w.Stop() + + np := markedPolicy("sg-db") + if err := r.c.Create(ctx, np); err != nil { + t.Fatalf("create marked: %v", err) + } + np.Annotations = map[string]string{"touched": "1"} + if err := r.c.Update(ctx, np); err != nil { + t.Fatalf("update marked: %v", err) + } + evs := collectEvents(t, w, 3, 2*time.Second) if len(evs) < 3 { t.Fatalf("expected at least 3 events (Added, Bookmark, Modified), got %d: %+v", len(evs), evs) diff --git a/pkg/registry/utils.go b/pkg/registry/utils.go index e2951c56d..4c597f018 100644 --- a/pkg/registry/utils.go +++ b/pkg/registry/utils.go @@ -20,6 +20,7 @@ import ( "strconv" "k8s.io/apimachinery/pkg/api/meta" + metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" @@ -58,6 +59,16 @@ func MaxResourceVersion(list runtime.Object) (string, error) { return strconv.FormatUint(max, 10), nil } +// InitialEventsEndBookmarkRequested reports whether a watch asked for the +// WatchList initial-events-end bookmark. SendInitialEvents alone does not ask +// for it: the apiserver defaults it on for a watch whose resourceVersion is +// empty or "0" while leaving bookmarks off, and from k8s.io/apiserver v0.36 the +// watch handler serving this apiserver panics when such a watch receives the +// marker. +func InitialEventsEndBookmarkRequested(opts *metainternalversion.ListOptions) bool { + return opts.SendInitialEvents != nil && *opts.SendInitialEvents && opts.AllowWatchBookmarks +} + // InitialEventsBookmarker implements the WatchList initial-events-end contract // for a Watch that translates events from a backing controller-runtime watcher. // It annotates the first backing Bookmark as the terminating marker, falling @@ -73,16 +84,18 @@ type InitialEventsBookmarker struct { lastRV string } -// NewInitialEventsBookmarker returns a bookmarker for a watch. When -// sendInitialEvents is false every method is a no-op. startingRV seeds the -// resourceVersion (the client's requested ResourceVersion) so the terminating -// bookmark carries a valid version even if the watcher closes before any -// backing event is observed. -func NewInitialEventsBookmarker(sendInitialEvents bool, startingRV string, newBookmark func() runtime.Object) *InitialEventsBookmarker { +// NewInitialEventsBookmarker returns a bookmarker for a watch; pass +// InitialEventsEndBookmarkRequested for initialEventsEnd. When it is false the +// bookmarker never emits a terminating bookmark and OnBackingBookmark forwards +// backing bookmarks unannotated. startingRV seeds the resourceVersion (the +// client's requested ResourceVersion) so the terminating bookmark carries a +// valid version even if the watcher closes before any backing event is +// observed. +func NewInitialEventsBookmarker(initialEventsEnd bool, startingRV string, newBookmark func() runtime.Object) *InitialEventsBookmarker { return &InitialEventsBookmarker{ newBookmark: newBookmark, lastRV: startingRV, - sent: !sendInitialEvents, + sent: !initialEventsEnd, } } diff --git a/pkg/registry/utils_test.go b/pkg/registry/utils_test.go index b3a916f28..ba58f934b 100644 --- a/pkg/registry/utils_test.go +++ b/pkg/registry/utils_test.go @@ -19,6 +19,7 @@ package registry import ( "testing" + metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" @@ -167,3 +168,23 @@ func TestInitialEventsBookmarker_ObserveOverridesStartingResourceVersion(t *test ev, _ := b.OnClose() assertInitialEventsEnd(t, ev, "150") } + +func TestInitialEventsEndBookmarkRequested(t *testing.T) { + yes, no := true, false + for _, tc := range []struct { + name string + opts metainternalversion.ListOptions + want bool + }{ + {"watch list", metainternalversion.ListOptions{SendInitialEvents: &yes, AllowWatchBookmarks: true}, true}, + {"plain watch defaulted by the apiserver", metainternalversion.ListOptions{SendInitialEvents: &yes}, false}, + {"bookmarks without initial events", metainternalversion.ListOptions{SendInitialEvents: &no, AllowWatchBookmarks: true}, false}, + {"neither", metainternalversion.ListOptions{}, false}, + } { + t.Run(tc.name, func(t *testing.T) { + if got := InitialEventsEndBookmarkRequested(&tc.opts); got != tc.want { + t.Fatalf("InitialEventsEndBookmarkRequested = %v, want %v", got, tc.want) + } + }) + } +}