diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ba33ffe8c..68e20d049 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: v1.23.4 + go-version: v1.24.0 - run: make test-e2e go-test: @@ -40,7 +40,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: v1.23.4 + go-version: v1.24.0 - run: make test lint: @@ -50,7 +50,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: v1.23.4 + go-version: v1.24.0 - run: make lint verify: @@ -60,5 +60,5 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: v1.23.4 + go-version: v1.24.0 - run: make verify diff --git a/.github/workflows/docs-gen-and-push.yaml b/.github/workflows/docs-gen-and-push.yaml index 156706cb4..0fe690bdc 100644 --- a/.github/workflows/docs-gen-and-push.yaml +++ b/.github/workflows/docs-gen-and-push.yaml @@ -34,7 +34,7 @@ jobs: - uses: actions/setup-go@v5 with: - go-version: v1.23.4 + go-version: v1.24.0 cache: true - uses: actions/setup-python@v5 diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index cdaf026cf..c7cc732f1 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -22,7 +22,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v5 with: - go-version: v1.23.4 + go-version: v1.24.0 - name: Delete non-semver tags run: 'git tag -d $(git tag -l | grep -v "^v")' - name: Run GoReleaser on tag diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index 557df864c..9d9dc17bd 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: v1.23.4 + go-version: v1.24.0 check-latest: true # We need this to remove local tags that are not semver so goreleaser doesn't get confused. - name: Delete non-semver tags diff --git a/.ko.yaml b/.ko.yaml index 95d92e3d5..78522ae94 100644 --- a/.ko.yaml +++ b/.ko.yaml @@ -1,5 +1,5 @@ baseImageOverrides: - github.com/google/ko: golang:1.23.4 + github.com/google/ko: golang:1.24.0 builds: - id: konnector diff --git a/Dockerfile b/Dockerfile index 90dc0b39e..7448e03ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.23.4 AS builder +FROM golang:1.24.0 AS builder diff --git a/cli/go.mod b/cli/go.mod index 1351023c1..7314d924e 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -1,6 +1,6 @@ module github.com/kube-bind/kube-bind/cli -go 1.23.4 +go 1.24.0 replace ( github.com/kube-bind/kube-bind => ../ @@ -20,12 +20,12 @@ require ( github.com/spf13/cobra v1.9.1 github.com/spf13/pflag v1.0.6 github.com/stretchr/testify v1.10.0 - k8s.io/api v0.32.3 - k8s.io/apiextensions-apiserver v0.32.3 - k8s.io/apimachinery v0.32.3 + k8s.io/api v0.33.0 + k8s.io/apiextensions-apiserver v0.33.0 + k8s.io/apimachinery v0.33.0 k8s.io/cli-runtime v0.32.0 - k8s.io/client-go v0.32.3 - k8s.io/component-base v0.32.3 + k8s.io/client-go v0.33.0 + k8s.io/component-base v0.33.0 k8s.io/klog/v2 v2.130.1 sigs.k8s.io/yaml v1.4.0 ) @@ -35,7 +35,6 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -55,10 +54,9 @@ require ( 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.22.1 // indirect + github.com/google/cel-go v0.23.2 // indirect github.com/google/gnostic-models v0.6.9 // indirect github.com/google/go-cmp v0.7.0 // indirect - github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect @@ -67,7 +65,6 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.11 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.9.0 // indirect @@ -83,17 +80,17 @@ require ( github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_golang v1.22.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.61.0 // indirect + github.com/prometheus/common v0.62.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xlab/treeprint v1.2.0 // indirect - go.etcd.io/etcd/api/v3 v3.5.17 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.17 // indirect - go.etcd.io/etcd/client/v3 v3.5.17 // indirect + go.etcd.io/etcd/api/v3 v3.5.21 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.21 // indirect + go.etcd.io/etcd/client/v3 v3.5.21 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect @@ -118,17 +115,18 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 // indirect google.golang.org/grpc v1.69.2 // indirect - google.golang.org/protobuf v1.36.2 // indirect + google.golang.org/protobuf v1.36.5 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiserver v0.32.3 // indirect - k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 // indirect + k8s.io/apiserver v0.33.0 // indirect + k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect rsc.io/qr v0.2.0 // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1 // indirect + sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect sigs.k8s.io/kustomize/api v0.18.0 // indirect sigs.k8s.io/kustomize/kyaml v0.18.1 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect ) diff --git a/cli/go.sum b/cli/go.sum index b7774b65c..9cbb02510 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -8,8 +8,6 @@ github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cq github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= @@ -61,30 +59,28 @@ github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= 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/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI= +github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= 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.22.1 h1:AfVXx3chM2qwoSbM7Da8g8hX8OVSkBFwX+rz2+PcK40= -github.com/google/cel-go v0.22.1/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8= +github.com/google/cel-go v0.23.2 h1:UdEe3CvQh3Nv+E/j9r1Y//WO0K0cSyD7/y0bzyLIMI4= +github.com/google/cel-go v0.23.2/go.mod h1:52Pb6QsDbC5kvgxvZhiL9QX1oZEkcUF/ZqaPx1J5Wwo= github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= 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.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +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/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= @@ -105,8 +101,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr 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.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= -github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -150,12 +146,12 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= -github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= +github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ= -github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -200,20 +196,20 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0= go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I= -go.etcd.io/etcd/api/v3 v3.5.17 h1:cQB8eb8bxwuxOilBpMJAEo8fAONyrdXTHUNcMd8yT1w= -go.etcd.io/etcd/api/v3 v3.5.17/go.mod h1:d1hvkRuXkts6PmaYk2Vrgqbv7H4ADfAKhyJqHNLJCB4= -go.etcd.io/etcd/client/pkg/v3 v3.5.17 h1:XxnDXAWq2pnxqx76ljWwiQ9jylbpC4rvkAeRVOUKKVw= -go.etcd.io/etcd/client/pkg/v3 v3.5.17/go.mod h1:4DqK1TKacp/86nJk4FLQqo6Mn2vvQFBmruW3pP14H/w= -go.etcd.io/etcd/client/v2 v2.305.16 h1:kQrn9o5czVNaukf2A2At43cE9ZtWauOtf9vRZuiKXow= -go.etcd.io/etcd/client/v2 v2.305.16/go.mod h1:h9YxWCzcdvZENbfzBTFCnoNumr2ax3F19sKMqHFmXHE= -go.etcd.io/etcd/client/v3 v3.5.17 h1:o48sINNeWz5+pjy/Z0+HKpj/xSnBkuVhVvXkjEXbqZY= -go.etcd.io/etcd/client/v3 v3.5.17/go.mod h1:j2d4eXTHWkT2ClBgnnEPm/Wuu7jsqku41v9DZ3OtjQo= -go.etcd.io/etcd/pkg/v3 v3.5.16 h1:cnavs5WSPWeK4TYwPYfmcr3Joz9BH+TZ6qoUtz6/+mc= -go.etcd.io/etcd/pkg/v3 v3.5.16/go.mod h1:+lutCZHG5MBBFI/U4eYT5yL7sJfnexsoM20Y0t2uNuY= -go.etcd.io/etcd/raft/v3 v3.5.16 h1:zBXA3ZUpYs1AwiLGPafYAKKl/CORn/uaxYDwlNwndAk= -go.etcd.io/etcd/raft/v3 v3.5.16/go.mod h1:P4UP14AxofMJ/54boWilabqqWoW9eLodl6I5GdGzazI= -go.etcd.io/etcd/server/v3 v3.5.16 h1:d0/SAdJ3vVsZvF8IFVb1k8zqMZ+heGcNfft71ul9GWE= -go.etcd.io/etcd/server/v3 v3.5.16/go.mod h1:ynhyZZpdDp1Gq49jkUg5mfkDWZwXnn3eIqCqtJnrD/s= +go.etcd.io/etcd/api/v3 v3.5.21 h1:A6O2/JDb3tvHhiIz3xf9nJ7REHvtEFJJ3veW3FbCnS8= +go.etcd.io/etcd/api/v3 v3.5.21/go.mod h1:c3aH5wcvXv/9dqIw2Y810LDXJfhSYdHQ0vxmP3CCHVY= +go.etcd.io/etcd/client/pkg/v3 v3.5.21 h1:lPBu71Y7osQmzlflM9OfeIV2JlmpBjqBNlLtcoBqUTc= +go.etcd.io/etcd/client/pkg/v3 v3.5.21/go.mod h1:BgqT/IXPjK9NkeSDjbzwsHySX3yIle2+ndz28nVsjUs= +go.etcd.io/etcd/client/v2 v2.305.21 h1:eLiFfexc2mE+pTLz9WwnoEsX5JTTpLCYVivKkmVXIRA= +go.etcd.io/etcd/client/v2 v2.305.21/go.mod h1:OKkn4hlYNf43hpjEM3Ke3aRdUkhSl8xjKjSf8eCq2J8= +go.etcd.io/etcd/client/v3 v3.5.21 h1:T6b1Ow6fNjOLOtM0xSoKNQt1ASPCLWrF9XMHcH9pEyY= +go.etcd.io/etcd/client/v3 v3.5.21/go.mod h1:mFYy67IOqmbRf/kRUvsHixzo3iG+1OF2W2+jVIQRAnU= +go.etcd.io/etcd/pkg/v3 v3.5.21 h1:jUItxeKyrDuVuWhdh0HtjUANwyuzcb7/FAeUfABmQsk= +go.etcd.io/etcd/pkg/v3 v3.5.21/go.mod h1:wpZx8Egv1g4y+N7JAsqi2zoUiBIUWznLjqJbylDjWgU= +go.etcd.io/etcd/raft/v3 v3.5.21 h1:dOmE0mT55dIUsX77TKBLq+RgyumsQuYeiRQnW/ylugk= +go.etcd.io/etcd/raft/v3 v3.5.21/go.mod h1:fmcuY5R2SNkklU4+fKVBQi2biVp5vafMrWUEj4TJ4Cs= +go.etcd.io/etcd/server/v3 v3.5.21 h1:9w0/k12majtgarGmlMVuhwXRI2ob3/d1Ik3X5TKo0yU= +go.etcd.io/etcd/server/v3 v3.5.21/go.mod h1:G1mOzdwuzKT1VRL7SqRchli/qcFrtLBTAQ4lV20sXXo= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 h1:PS8wXpbyaDJQ2VDHHncMe9Vct0Zn1fEjpsjrLxGJoSc= @@ -298,8 +294,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= -google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= -google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -312,39 +308,42 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYs gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls= -k8s.io/api v0.32.3/go.mod h1:2wEDTXADtm/HA7CCMD8D8bK4yuBUptzaRhYcYEEYA3k= -k8s.io/apiextensions-apiserver v0.32.3 h1:4D8vy+9GWerlErCwVIbcQjsWunF9SUGNu7O7hiQTyPY= -k8s.io/apiextensions-apiserver v0.32.3/go.mod h1:8YwcvVRMVzw0r1Stc7XfGAzB/SIVLunqApySV5V7Dss= -k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U= -k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= -k8s.io/apiserver v0.32.3 h1:kOw2KBuHOA+wetX1MkmrxgBr648ksz653j26ESuWNY8= -k8s.io/apiserver v0.32.3/go.mod h1:q1x9B8E/WzShF49wh3ADOh6muSfpmFL0I2t+TG0Zdgc= +k8s.io/api v0.33.0 h1:yTgZVn1XEe6opVpP1FylmNrIFWuDqe2H0V8CT5gxfIU= +k8s.io/api v0.33.0/go.mod h1:CTO61ECK/KU7haa3qq8sarQ0biLq2ju405IZAd9zsiM= +k8s.io/apiextensions-apiserver v0.33.0 h1:d2qpYL7Mngbsc1taA4IjJPRJ9ilnsXIrndH+r9IimOs= +k8s.io/apiextensions-apiserver v0.33.0/go.mod h1:VeJ8u9dEEN+tbETo+lFkwaaZPg6uFKLGj5vyNEwwSzc= +k8s.io/apimachinery v0.33.0 h1:1a6kHrJxb2hs4t8EE5wuR/WxKDwGN1FKH3JvDtA0CIQ= +k8s.io/apimachinery v0.33.0/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= +k8s.io/apiserver v0.33.0 h1:QqcM6c+qEEjkOODHppFXRiw/cE2zP85704YrQ9YaBbc= +k8s.io/apiserver v0.33.0/go.mod h1:EixYOit0YTxt8zrO2kBU7ixAtxFce9gKGq367nFmqI8= k8s.io/cli-runtime v0.32.0 h1:dP+OZqs7zHPpGQMCGAhectbHU2SNCuZtIimRKTv2T1c= k8s.io/cli-runtime v0.32.0/go.mod h1:Mai8ht2+esoDRK5hr861KRy6z0zHsSTYttNVJXgP3YQ= -k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU= -k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY= -k8s.io/component-base v0.32.3 h1:98WJvvMs3QZ2LYHBzvltFSeJjEx7t5+8s71P7M74u8k= -k8s.io/component-base v0.32.3/go.mod h1:LWi9cR+yPAv7cu2X9rZanTiFKB2kHA+JjmhkKjCZRpI= +k8s.io/client-go v0.33.0 h1:UASR0sAYVUzs2kYuKn/ZakZlcs2bEHaizrrHUZg0G98= +k8s.io/client-go v0.33.0/go.mod h1:kGkd+l/gNGg8GYWAPr0xF1rRKvVWvzh9vmZAMXtaKOg= +k8s.io/component-base v0.33.0 h1:Ot4PyJI+0JAD9covDhwLp9UNkUja209OzsJ4FzScBNk= +k8s.io/component-base v0.33.0/go.mod h1:aXYZLbw3kihdkOPMDhWbjGCO6sg+luw554KP51t8qCU= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kms v0.32.3 h1:HhHw5+pRCzEJp3oFFJ1q5W2N6gAI7YkUg4ay4Z0dgwM= -k8s.io/kms v0.32.3/go.mod h1:Bk2evz/Yvk0oVrvm4MvZbgq8BD34Ksxs2SRHn4/UiOM= -k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 h1:hcha5B1kVACrLujCKLbr8XWMxCxzQx42DY8QKYJrDLg= -k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7/go.mod h1:GewRfANuJ70iYzvn+i4lezLDAFzvjxZYK1gn1lWcfas= +k8s.io/kms v0.33.0 h1:fhQSW/vyaWDhMp0vDuO/sLg2RlGZf4F77beSXcB4/eE= +k8s.io/kms v0.33.0/go.mod h1:C1I8mjFFBNzfUZXYt9FZVJ8MJl7ynFbGgZFbBzkBJ3E= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8= k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0= k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/qr v0.2.0 h1:6vBLea5/NRMVTz8V66gipeLycZMl/+UlFmk8DvqQ6WY= rsc.io/qr v0.2.0/go.mod h1:IF+uZjkb9fqyeF/4tlBoynqmQxUoPfWEKh921coOuXs= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1 h1:uOuSLOMBWkJH0TWa9X6l+mj5nZdm6Ay6Bli8HL8rNfk= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/kustomize/api v0.18.0 h1:hTzp67k+3NEVInwz5BHyzc9rGxIauoXferXyjv5lWPo= sigs.k8s.io/kustomize/api v0.18.0/go.mod h1:f8isXnX+8b+SGLHQ6yO4JG1rdkZlvhaCf/uZbLVMb0U= sigs.k8s.io/kustomize/kyaml v0.18.1 h1:WvBo56Wzw3fjS+7vBjN6TeivvpbW9GmRaWZ9CIVmt4E= sigs.k8s.io/kustomize/kyaml v0.18.1/go.mod h1:C3L2BFVU1jgcddNBE1TxuVLgS46TjObMwW5FT9FcjYo= -sigs.k8s.io/structured-merge-diff/v4 v4.5.0 h1:nbCitCK2hfnhyiKo6uf2HxUPTCodY6Qaf85SbDIaMBk= -sigs.k8s.io/structured-merge-diff/v4 v4.5.0/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= +sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +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/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/cmd/example-backend/main.go b/cmd/example-backend/main.go index 40b1ea92c..49a548335 100644 --- a/cmd/example-backend/main.go +++ b/cmd/example-backend/main.go @@ -84,11 +84,11 @@ func run(ctx context.Context) error { if err != nil { return err } - server.OptionallyStartInformers(ctx) + if err := server.Run(ctx); err != nil { return err } - logger.Info("Listening\n", "address", server.Addr()) + logger.Info("Listening", "address", server.Addr()) <-ctx.Done() diff --git a/contrib/example-backend/config.go b/contrib/example-backend/config.go index 3131bd89b..2caa36498 100644 --- a/contrib/example-backend/config.go +++ b/contrib/example-backend/config.go @@ -17,31 +17,22 @@ limitations under the License. package backend import ( - "time" + "fmt" - apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - apiextensionsinformers "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions" - kubeinformers "k8s.io/client-go/informers" - kubernetesclient "k8s.io/client-go/kubernetes" + "github.com/kcp-dev/multicluster-provider/apiexport" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" + "sigs.k8s.io/multicluster-runtime/pkg/multicluster" "github.com/kube-bind/kube-bind/contrib/example-backend/options" - bindclient "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" - bindinformers "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions" ) type Config struct { Options *options.CompletedOptions - ClientConfig *rest.Config - BindClient *bindclient.Clientset - KubeClient *kubernetesclient.Clientset - ApiextensionsClient *apiextensionsclient.Clientset + Provider multicluster.Provider - KubeInformers kubeinformers.SharedInformerFactory - BindInformers bindinformers.SharedInformerFactory - ApiextensionsInformers apiextensionsinformers.SharedInformerFactory + ClientConfig *rest.Config } func NewConfig(options *options.CompletedOptions) (*Config, error) { @@ -58,22 +49,18 @@ func NewConfig(options *options.CompletedOptions) (*Config, error) { return nil, err } config.ClientConfig = rest.CopyConfig(config.ClientConfig) - config.ClientConfig = rest.AddUserAgent(config.ClientConfig, "kube-bind-example-backend") + config.ClientConfig = rest.AddUserAgent(config.ClientConfig, "kube-bind-backend") - if config.BindClient, err = bindclient.NewForConfig(config.ClientConfig); err != nil { - return nil, err - } - if config.KubeClient, err = kubernetesclient.NewForConfig(config.ClientConfig); err != nil { - return nil, err + switch options.Provider { + case "kcp": + provider, err := apiexport.New(config.ClientConfig, apiexport.Options{}) + if err != nil { + return nil, fmt.Errorf("error setting up kcp provider: %w", err) + } + config.Provider = provider + default: + config.Provider = nil } - if config.ApiextensionsClient, err = apiextensionsclient.NewForConfig(config.ClientConfig); err != nil { - return nil, err - } - - // construct informer factories - config.KubeInformers = kubeinformers.NewSharedInformerFactory(config.KubeClient, time.Minute*30) - config.BindInformers = bindinformers.NewSharedInformerFactory(config.BindClient, time.Minute*30) - config.ApiextensionsInformers = apiextensionsinformers.NewSharedInformerFactory(config.ApiextensionsClient, time.Minute*30) return config, nil } diff --git a/contrib/example-backend/controllers/clusterbinding/clusterbinding_controller.go b/contrib/example-backend/controllers/clusterbinding/clusterbinding_controller.go index 2c38d1f26..5d9cde08e 100644 --- a/contrib/example-backend/controllers/clusterbinding/clusterbinding_controller.go +++ b/contrib/example-backend/controllers/clusterbinding/clusterbinding_controller.go @@ -25,15 +25,18 @@ import ( rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/rest" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/cluster" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/reconcile" + mcbuilder "sigs.k8s.io/multicluster-runtime/pkg/builder" + mcmanager "sigs.k8s.io/multicluster-runtime/pkg/manager" + mcreconcile "sigs.k8s.io/multicluster-runtime/pkg/reconcile" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" bindclient "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" @@ -45,8 +48,7 @@ const ( // ClusterBindingReconciler reconciles a ClusterBinding object. type ClusterBindingReconciler struct { - client.Client - Scheme *runtime.Scheme + manager mcmanager.Manager scope kubebindv1alpha2.InformerScope bindClient bindclient.Interface @@ -55,11 +57,9 @@ type ClusterBindingReconciler struct { // NewClusterBindingReconciler returns a new ClusterBindingReconciler to reconcile ClusterBindings. func NewClusterBindingReconciler( - c client.Client, - scheme *runtime.Scheme, + mgr mcmanager.Manager, config *rest.Config, scope kubebindv1alpha2.InformerScope, - cache cache.Cache, ) (*ClusterBindingReconciler, error) { config = rest.CopyConfig(config) config = rest.AddUserAgent(config, controllerName) @@ -70,13 +70,12 @@ func NewClusterBindingReconciler( } r := &ClusterBindingReconciler{ - Client: c, - Scheme: scheme, + manager: mgr, scope: scope, bindClient: bindClient, reconciler: reconciler{ scope: scope, - listServiceExports: func(ctx context.Context, ns string) ([]*kubebindv1alpha2.APIServiceExport, error) { + listServiceExports: func(ctx context.Context, cache cache.Cache, ns string) ([]*kubebindv1alpha2.APIServiceExport, error) { var list kubebindv1alpha2.APIServiceExportList if err := cache.List(ctx, &list, client.InNamespace(ns)); err != nil { return nil, err @@ -87,30 +86,35 @@ func NewClusterBindingReconciler( } return exports, nil }, - getAPIResourceSchema: func(ctx context.Context, namespace, name string) (*kubebindv1alpha2.APIResourceSchema, error) { - return bindClient.KubeBindV1alpha2().APIResourceSchemas().Get(ctx, name, metav1.GetOptions{}) + getAPIResourceSchema: func(ctx context.Context, cache cache.Cache, name string) (*kubebindv1alpha2.APIResourceSchema, error) { + result := &kubebindv1alpha2.APIResourceSchema{} + err = cache.Get(ctx, types.NamespacedName{Name: name}, result) + if err != nil { + return nil, fmt.Errorf("failed to get APIResourceSchema %q: %w", name, err) + } + return result, nil }, - getClusterRole: func(ctx context.Context, name string) (*rbacv1.ClusterRole, error) { + getClusterRole: func(ctx context.Context, cache cache.Cache, name string) (*rbacv1.ClusterRole, error) { var role rbacv1.ClusterRole key := types.NamespacedName{Name: name} - if err := c.Get(ctx, key, &role); err != nil { + if err := cache.Get(ctx, key, &role); err != nil { return nil, err } return &role, nil }, - createClusterRole: func(ctx context.Context, binding *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error) { - if err := c.Create(ctx, binding); err != nil { + createClusterRole: func(ctx context.Context, client client.Client, binding *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error) { + if err := client.Create(ctx, binding); err != nil { return nil, err } return binding, nil }, - updateClusterRole: func(ctx context.Context, binding *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error) { - if err := c.Update(ctx, binding); err != nil { + updateClusterRole: func(ctx context.Context, client client.Client, binding *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error) { + if err := client.Update(ctx, binding); err != nil { return nil, err } return binding, nil }, - getClusterRoleBinding: func(ctx context.Context, name string) (*rbacv1.ClusterRoleBinding, error) { + getClusterRoleBinding: func(ctx context.Context, cache cache.Cache, name string) (*rbacv1.ClusterRoleBinding, error) { var binding rbacv1.ClusterRoleBinding key := types.NamespacedName{Name: name} if err := cache.Get(ctx, key, &binding); err != nil { @@ -118,51 +122,51 @@ func NewClusterBindingReconciler( } return &binding, nil }, - createClusterRoleBinding: func(ctx context.Context, binding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error) { - if err := c.Create(ctx, binding); err != nil { + createClusterRoleBinding: func(ctx context.Context, client client.Client, binding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error) { + if err := client.Create(ctx, binding); err != nil { return nil, err } return binding, nil }, - updateClusterRoleBinding: func(ctx context.Context, binding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error) { - if err := c.Update(ctx, binding); err != nil { + updateClusterRoleBinding: func(ctx context.Context, client client.Client, binding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error) { + if err := client.Update(ctx, binding); err != nil { return nil, err } return binding, nil }, - deleteClusterRoleBinding: func(ctx context.Context, name string) error { + deleteClusterRoleBinding: func(ctx context.Context, client client.Client, name string) error { binding := &rbacv1.ClusterRoleBinding{ ObjectMeta: metav1.ObjectMeta{Name: name}, } - return c.Delete(ctx, binding) + return client.Delete(ctx, binding) }, - getNamespace: func(ctx context.Context, name string) (*v1.Namespace, error) { + getNamespace: func(ctx context.Context, cache cache.Cache, name string) (*v1.Namespace, error) { var ns v1.Namespace key := types.NamespacedName{Name: name} if err := cache.Get(ctx, key, &ns); err != nil { - return nil, err + return nil, fmt.Errorf("failed to get Namespace %q: %w", name, err) } return &ns, nil }, - createRoleBinding: func(ctx context.Context, ns string, binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error) { + createRoleBinding: func(ctx context.Context, client client.Client, ns string, binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error) { binding.Namespace = ns - if err := c.Create(ctx, binding); err != nil { + if err := client.Create(ctx, binding); err != nil { return nil, err } return binding, nil }, - updateRoleBinding: func(ctx context.Context, ns string, binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error) { + updateRoleBinding: func(ctx context.Context, client client.Client, ns string, binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error) { binding.Namespace = ns - if err := c.Update(ctx, binding); err != nil { + if err := client.Update(ctx, binding); err != nil { return nil, err } return binding, nil }, - getRoleBinding: func(ctx context.Context, ns, name string) (*rbacv1.RoleBinding, error) { + getRoleBinding: func(ctx context.Context, cache cache.Cache, ns, name string) (*rbacv1.RoleBinding, error) { var binding rbacv1.RoleBinding key := types.NamespacedName{Namespace: ns, Name: name} if err := cache.Get(ctx, key, &binding); err != nil { - return nil, err + return nil, fmt.Errorf("failed to get RoleBinding %q in namespace %q: %w", name, ns, err) } return &binding, nil }, @@ -172,22 +176,6 @@ func NewClusterBindingReconciler( return r, nil } -// mapServiceExportToClusterBinding maps APIServiceExport events to ClusterBinding reconcile requests. -func mapServiceExportToClusterBinding(ctx context.Context, obj client.Object) []reconcile.Request { - // Extract namespace from the APIServiceExport - serviceExport := obj.(*kubebindv1alpha2.APIServiceExport) - - // The original logic created a ClusterBinding key as "namespace/cluster" - return []reconcile.Request{ - { - NamespacedName: types.NamespacedName{ - Namespace: serviceExport.Namespace, - Name: "cluster", - }, - }, - } -} - //+kubebuilder:rbac:groups=kubebind.k8s.io,resources=clusterbindings,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=kubebind.k8s.io,resources=clusterbindings/status,verbs=get;update;patch //+kubebuilder:rbac:groups=kubebind.k8s.io,resources=clusterbindings/finalizers,verbs=update @@ -199,13 +187,21 @@ func mapServiceExportToClusterBinding(ctx context.Context, obj client.Object) [] // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. -func (r *ClusterBindingReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { +func (r *ClusterBindingReconciler) Reconcile(ctx context.Context, req mcreconcile.Request) (ctrl.Result, error) { logger := log.FromContext(ctx) - logger.Info("Reconciling ClusterBinding", "namespace", req.Namespace, "name", req.Name) + logger.Info("Reconciling ClusterBinding", "request", req) + + cl, err := r.manager.GetCluster(ctx, req.ClusterName) + if err != nil { + return ctrl.Result{}, fmt.Errorf("failed to get client for cluster %q: %w", req.ClusterName, err) + } + + client := cl.GetClient() + cache := cl.GetCache() // Fetch the ClusterBinding instance clusterBinding := &kubebindv1alpha2.ClusterBinding{} - if err := r.Get(ctx, req.NamespacedName, clusterBinding); err != nil { + if err := client.Get(ctx, req.NamespacedName, clusterBinding); err != nil { if errors.IsNotFound(err) { // Request object not found, could have been deleted after reconcile request. logger.Info("ClusterBinding not found, ignoring") @@ -219,14 +215,14 @@ func (r *ClusterBindingReconciler) Reconcile(ctx context.Context, req ctrl.Reque original := clusterBinding.DeepCopy() // Run the reconciliation logic - if err := r.reconciler.reconcile(ctx, clusterBinding); err != nil { + if err := r.reconciler.reconcile(ctx, client, cache, clusterBinding); err != nil { logger.Error(err, "Failed to reconcile ClusterBinding") return ctrl.Result{}, err } // Update status if it has changed if !reflect.DeepEqual(original, clusterBinding) { - err := r.Update(ctx, clusterBinding) + err := client.Update(ctx, clusterBinding) if err != nil { logger.Error(err, "Failed to update ClusterBinding status") return ctrl.Result{}, fmt.Errorf("failed to update ClusterBinding status: %w", err) @@ -238,16 +234,33 @@ func (r *ClusterBindingReconciler) Reconcile(ctx context.Context, req ctrl.Reque } // SetupWithManager sets up the controller with the Manager. -func (r *ClusterBindingReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). +func (r *ClusterBindingReconciler) SetupWithManager(mgr mcmanager.Manager) error { + return mcbuilder.ControllerManagedBy(mgr). For(&kubebindv1alpha2.ClusterBinding{}). Owns(&rbacv1.ClusterRole{}). Owns(&rbacv1.ClusterRoleBinding{}). Owns(&rbacv1.RoleBinding{}). Watches( &kubebindv1alpha2.APIServiceExport{}, - handler.EnqueueRequestsFromMapFunc(mapServiceExportToClusterBinding), + mapCRD, ). Named(controllerName). Complete(r) } + +func mapCRD(clusterName string, cl cluster.Cluster) handler.TypedEventHandler[client.Object, mcreconcile.Request] { + return handler.TypedEnqueueRequestsFromMapFunc[client.Object, mcreconcile.Request](func(ctx context.Context, obj client.Object) []mcreconcile.Request { + serviceExport, ok := obj.(*kubebindv1alpha2.APIServiceExport) + if !ok { + return nil + } + return []mcreconcile.Request{ + { + Request: reconcile.Request{ + NamespacedName: client.ObjectKeyFromObject(serviceExport), + }, + ClusterName: clusterName, + }, + } + }) +} diff --git a/contrib/example-backend/controllers/clusterbinding/clusterbinding_reconcile.go b/contrib/example-backend/controllers/clusterbinding/clusterbinding_reconcile.go index c00ad0b51..2ec7c1ff4 100644 --- a/contrib/example-backend/controllers/clusterbinding/clusterbinding_reconcile.go +++ b/contrib/example-backend/controllers/clusterbinding/clusterbinding_reconcile.go @@ -28,6 +28,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/utils/ptr" + "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/client" kuberesources "github.com/kube-bind/kube-bind/contrib/example-backend/kubernetes/resources" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" @@ -38,37 +40,37 @@ import ( type reconciler struct { scope kubebindv1alpha2.InformerScope - listServiceExports func(ctx context.Context, ns string) ([]*kubebindv1alpha2.APIServiceExport, error) - getAPIResourceSchema func(ctx context.Context, namespace, name string) (*kubebindv1alpha2.APIResourceSchema, error) - getClusterRole func(ctx context.Context, name string) (*rbacv1.ClusterRole, error) - createClusterRole func(ctx context.Context, binding *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error) - updateClusterRole func(ctx context.Context, binding *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error) + listServiceExports func(ctx context.Context, cache cache.Cache, ns string) ([]*kubebindv1alpha2.APIServiceExport, error) + getAPIResourceSchema func(ctx context.Context, cache cache.Cache, name string) (*kubebindv1alpha2.APIResourceSchema, error) + getClusterRole func(ctx context.Context, cache cache.Cache, name string) (*rbacv1.ClusterRole, error) + createClusterRole func(ctx context.Context, client client.Client, binding *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error) + updateClusterRole func(ctx context.Context, client client.Client, binding *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error) - getClusterRoleBinding func(ctx context.Context, name string) (*rbacv1.ClusterRoleBinding, error) - createClusterRoleBinding func(ctx context.Context, binding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error) - updateClusterRoleBinding func(ctx context.Context, binding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error) - deleteClusterRoleBinding func(ctx context.Context, name string) error + getClusterRoleBinding func(ctx context.Context, cache cache.Cache, name string) (*rbacv1.ClusterRoleBinding, error) + createClusterRoleBinding func(ctx context.Context, client client.Client, binding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error) + updateClusterRoleBinding func(ctx context.Context, client client.Client, binding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error) + deleteClusterRoleBinding func(ctx context.Context, client client.Client, name string) error - getRoleBinding func(ctx context.Context, ns, name string) (*rbacv1.RoleBinding, error) - createRoleBinding func(ctx context.Context, ns string, binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error) - updateRoleBinding func(ctx context.Context, ns string, binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error) + getRoleBinding func(ctx context.Context, cache cache.Cache, ns, name string) (*rbacv1.RoleBinding, error) + createRoleBinding func(ctx context.Context, client client.Client, ns string, binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error) + updateRoleBinding func(ctx context.Context, client client.Client, ns string, binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error) - getNamespace func(ctx context.Context, name string) (*corev1.Namespace, error) + getNamespace func(ctx context.Context, cache cache.Cache, name string) (*corev1.Namespace, error) } -func (r *reconciler) reconcile(ctx context.Context, clusterBinding *kubebindv1alpha2.ClusterBinding) error { +func (r *reconciler) reconcile(ctx context.Context, client client.Client, cache cache.Cache, clusterBinding *kubebindv1alpha2.ClusterBinding) error { var errs []error if err := r.ensureClusterBindingConditions(ctx, clusterBinding); err != nil { errs = append(errs, err) } - if err := r.ensureRBACRoleBinding(ctx, clusterBinding); err != nil { + if err := r.ensureRBACRoleBinding(ctx, client, cache, clusterBinding); err != nil { errs = append(errs, err) } - if err := r.ensureRBACClusterRole(ctx, clusterBinding); err != nil { + if err := r.ensureRBACClusterRole(ctx, client, cache, clusterBinding); err != nil { errs = append(errs, err) } - if err := r.ensureRBACClusterRoleBinding(ctx, clusterBinding); err != nil { + if err := r.ensureRBACClusterRoleBinding(ctx, client, cache, clusterBinding); err != nil { errs = append(errs, err) } @@ -117,19 +119,19 @@ func (r *reconciler) ensureClusterBindingConditions(_ context.Context, clusterBi return nil } -func (r *reconciler) ensureRBACClusterRole(ctx context.Context, clusterBinding *kubebindv1alpha2.ClusterBinding) error { +func (r *reconciler) ensureRBACClusterRole(ctx context.Context, client client.Client, cache cache.Cache, clusterBinding *kubebindv1alpha2.ClusterBinding) error { name := "kube-binder-" + clusterBinding.Namespace - role, err := r.getClusterRole(ctx, name) + role, err := r.getClusterRole(ctx, cache, name) if err != nil && !errors.IsNotFound(err) { return fmt.Errorf("failed to get ClusterRole %s: %w", name, err) } - ns, err := r.getNamespace(ctx, clusterBinding.Namespace) + ns, err := r.getNamespace(ctx, cache, clusterBinding.Namespace) if err != nil { return fmt.Errorf("failed to get Namespace %s: %w", clusterBinding.Namespace, err) } - exports, err := r.listServiceExports(ctx, clusterBinding.Namespace) + exports, err := r.listServiceExports(ctx, cache, clusterBinding.Namespace) if err != nil { return fmt.Errorf("failed to list APIServiceExports: %w", err) } @@ -149,7 +151,7 @@ func (r *reconciler) ensureRBACClusterRole(ctx context.Context, clusterBinding * } for _, export := range exports { for _, res := range export.Spec.Resources { - schema, err := r.getAPIResourceSchema(ctx, clusterBinding.Namespace, res.Name) + schema, err := r.getAPIResourceSchema(ctx, cache, res.Name) if err != nil { return fmt.Errorf("failed to get APIResourceSchema %w", err) } @@ -170,13 +172,13 @@ func (r *reconciler) ensureRBACClusterRole(ctx context.Context, clusterBinding * } if role == nil { - if _, err := r.createClusterRole(ctx, expected); err != nil { + if _, err := r.createClusterRole(ctx, client, expected); err != nil { return fmt.Errorf("failed to create ClusterRole %s: %w", expected.Name, err) } } else if !reflect.DeepEqual(role.Rules, expected.Rules) { role = role.DeepCopy() role.Rules = expected.Rules - if _, err := r.updateClusterRole(ctx, role); err != nil { + if _, err := r.updateClusterRole(ctx, client, role); err != nil { return fmt.Errorf("failed to create ClusterRole %s: %w", role.Name, err) } } @@ -184,20 +186,20 @@ func (r *reconciler) ensureRBACClusterRole(ctx context.Context, clusterBinding * return nil } -func (r *reconciler) ensureRBACClusterRoleBinding(ctx context.Context, clusterBinding *kubebindv1alpha2.ClusterBinding) error { +func (r *reconciler) ensureRBACClusterRoleBinding(ctx context.Context, client client.Client, cache cache.Cache, clusterBinding *kubebindv1alpha2.ClusterBinding) error { name := "kube-binder-" + clusterBinding.Namespace - binding, err := r.getClusterRoleBinding(ctx, name) + binding, err := r.getClusterRoleBinding(ctx, cache, name) if err != nil && !errors.IsNotFound(err) { return fmt.Errorf("failed to get ClusterRoleBinding %s: %w", name, err) } if r.scope != kubebindv1alpha2.ClusterScope { - if err := r.deleteClusterRoleBinding(ctx, name); err != nil && !errors.IsNotFound(err) { + if err := r.deleteClusterRoleBinding(ctx, client, name); err != nil && !errors.IsNotFound(err) { return fmt.Errorf("failed to delete ClusterRoleBinding %s: %w", name, err) } } - ns, err := r.getNamespace(ctx, clusterBinding.Namespace) + ns, err := r.getNamespace(ctx, cache, clusterBinding.Namespace) if err != nil { return fmt.Errorf("failed to get Namespace %s: %w", clusterBinding.Namespace, err) } @@ -230,14 +232,14 @@ func (r *reconciler) ensureRBACClusterRoleBinding(ctx context.Context, clusterBi } if binding == nil { - if _, err := r.createClusterRoleBinding(ctx, expected); err != nil { + if _, err := r.createClusterRoleBinding(ctx, client, expected); err != nil { return fmt.Errorf("failed to create ClusterRoleBinding %s: %w", expected.Name, err) } } else if !reflect.DeepEqual(binding.Subjects, expected.Subjects) { binding = binding.DeepCopy() binding.Subjects = expected.Subjects // roleRef is immutable - if _, err := r.updateClusterRoleBinding(ctx, binding); err != nil { + if _, err := r.updateClusterRoleBinding(ctx, client, binding); err != nil { return fmt.Errorf("failed to create ClusterRoleBinding %s: %w", expected.Namespace, err) } } @@ -245,8 +247,8 @@ func (r *reconciler) ensureRBACClusterRoleBinding(ctx context.Context, clusterBi return nil } -func (r *reconciler) ensureRBACRoleBinding(ctx context.Context, clusterBinding *kubebindv1alpha2.ClusterBinding) error { - binding, err := r.getRoleBinding(ctx, clusterBinding.Namespace, "kube-binder") +func (r *reconciler) ensureRBACRoleBinding(ctx context.Context, client client.Client, cache cache.Cache, clusterBinding *kubebindv1alpha2.ClusterBinding) error { + binding, err := r.getRoleBinding(ctx, cache, clusterBinding.Namespace, "kube-binder") if err != nil && !errors.IsNotFound(err) { return fmt.Errorf("failed to get RoleBinding \"kube-binder\": %w", err) } @@ -270,14 +272,14 @@ func (r *reconciler) ensureRBACRoleBinding(ctx context.Context, clusterBinding * } if binding == nil { - if _, err := r.createRoleBinding(ctx, clusterBinding.Namespace, expected); err != nil { + if _, err := r.createRoleBinding(ctx, client, clusterBinding.Namespace, expected); err != nil { return fmt.Errorf("failed to create RoleBinding %s: %w", expected.Name, err) } } else if !reflect.DeepEqual(binding.Subjects, expected.Subjects) { binding = binding.DeepCopy() binding.Subjects = expected.Subjects // roleRef is immutable - if _, err := r.updateRoleBinding(ctx, clusterBinding.Namespace, binding); err != nil { + if _, err := r.updateRoleBinding(ctx, client, clusterBinding.Namespace, binding); err != nil { return fmt.Errorf("failed to create RoleBinding %s: %w", expected.Namespace, err) } } diff --git a/contrib/example-backend/controllers/serviceexport/serviceexport_controller.go b/contrib/example-backend/controllers/serviceexport/serviceexport_controller.go index 9f7137661..15e744ecc 100644 --- a/contrib/example-backend/controllers/serviceexport/serviceexport_controller.go +++ b/contrib/example-backend/controllers/serviceexport/serviceexport_controller.go @@ -24,15 +24,18 @@ import ( "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/rest" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/cluster" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/reconcile" + mcbuilder "sigs.k8s.io/multicluster-runtime/pkg/builder" + mcmanager "sigs.k8s.io/multicluster-runtime/pkg/manager" + mcreconcile "sigs.k8s.io/multicluster-runtime/pkg/reconcile" "github.com/kube-bind/kube-bind/pkg/indexers" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" @@ -45,8 +48,7 @@ const ( // APIServiceExportReconciler reconciles a APIServiceExport object. type APIServiceExportReconciler struct { - client.Client - Scheme *runtime.Scheme + manager mcmanager.Manager bindClient bindclient.Interface reconciler reconciler @@ -55,10 +57,8 @@ type APIServiceExportReconciler struct { // NewAPIServiceExportReconciler returns a new APIServiceExportReconciler to reconcile APIServiceExports. func NewAPIServiceExportReconciler( ctx context.Context, - c client.Client, - scheme *runtime.Scheme, + mgr mcmanager.Manager, config *rest.Config, - cache cache.Cache, ) (*APIServiceExportReconciler, error) { config = rest.CopyConfig(config) config = rest.AddUserAgent(config, controllerName) @@ -67,19 +67,16 @@ func NewAPIServiceExportReconciler( if err != nil { return nil, err } - - // Set up field indexer for APIServiceExports by CustomResourceDefinition name. - if err := cache.IndexField(ctx, &kubebindv1alpha2.APIServiceExport{}, indexers.ServiceExportByCustomResourceDefinition, + if err := mgr.GetFieldIndexer().IndexField(ctx, &kubebindv1alpha2.APIServiceExport{}, indexers.ServiceExportByCustomResourceDefinition, indexers.IndexServiceExportByCustomResourceDefinitionControllerRuntime); err != nil { return nil, fmt.Errorf("failed to setup ServiceExportByCustomResourceDefinition indexer: %w", err) } r := &APIServiceExportReconciler{ - Client: c, - Scheme: scheme, + manager: mgr, bindClient: bindClient, reconciler: reconciler{ - getCRD: func(ctx context.Context, name string) (*apiextensionsv1.CustomResourceDefinition, error) { + getCRD: func(ctx context.Context, cache cache.Cache, name string) (*apiextensionsv1.CustomResourceDefinition, error) { var crd apiextensionsv1.CustomResourceDefinition key := types.NamespacedName{Name: name} if err := cache.Get(ctx, key, &crd); err != nil { @@ -99,34 +96,6 @@ func NewAPIServiceExportReconciler( return r, nil } -// createCRDMapper creates a mapping function that can access the client for looking up related APIServiceExports. -func (r *APIServiceExportReconciler) createCRDMapper() handler.MapFunc { - return func(ctx context.Context, obj client.Object) []reconcile.Request { - crd := obj.(*apiextensionsv1.CustomResourceDefinition) - - // Use the field indexer to find APIServiceExports related to this CRD - // The indexer key should match the CRD name (namespace/name format for namespaced objects) - crdKey := crd.Name // CRDs are cluster-scoped, so just the name - - var exports kubebindv1alpha2.APIServiceExportList - if err := r.List(ctx, &exports, client.MatchingFields{indexers.ServiceExportByCustomResourceDefinition: crdKey}); err != nil { - return []reconcile.Request{} - } - - var requests []reconcile.Request - for _, export := range exports.Items { - requests = append(requests, reconcile.Request{ - NamespacedName: types.NamespacedName{ - Namespace: export.Namespace, - Name: export.Name, - }, - }) - } - - return requests - } -} - //+kubebuilder:rbac:groups=kubebind.k8s.io,resources=apiserviceexports,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=kubebind.k8s.io,resources=apiserviceexports/status,verbs=get;update;patch //+kubebuilder:rbac:groups=kubebind.k8s.io,resources=apiserviceexports/finalizers,verbs=update @@ -134,13 +103,21 @@ func (r *APIServiceExportReconciler) createCRDMapper() handler.MapFunc { // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. -func (r *APIServiceExportReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { +func (r *APIServiceExportReconciler) Reconcile(ctx context.Context, req mcreconcile.Request) (ctrl.Result, error) { logger := log.FromContext(ctx) - logger.Info("Reconciling APIServiceExport", "namespace", req.Namespace, "name", req.Name) + logger.Info("Reconciling APIServiceExport", "request", req) + + cl, err := r.manager.GetCluster(ctx, req.ClusterName) + if err != nil { + return ctrl.Result{}, fmt.Errorf("failed to get client for cluster %q: %w", req.ClusterName, err) + } + + client := cl.GetClient() + cache := cl.GetCache() // Fetch the APIServiceExport instance apiServiceExport := &kubebindv1alpha2.APIServiceExport{} - if err := r.Get(ctx, req.NamespacedName, apiServiceExport); err != nil { + if err := client.Get(ctx, req.NamespacedName, apiServiceExport); err != nil { if errors.IsNotFound(err) { // Request object not found, could have been deleted after reconcile request. logger.Info("APIServiceExport not found, ignoring") @@ -154,14 +131,14 @@ func (r *APIServiceExportReconciler) Reconcile(ctx context.Context, req ctrl.Req original := apiServiceExport.DeepCopy() // Run the reconciliation logic - if err := r.reconciler.reconcile(ctx, apiServiceExport); err != nil { + if err := r.reconciler.reconcile(ctx, cache, apiServiceExport); err != nil { logger.Error(err, "Failed to reconcile APIServiceExport") return ctrl.Result{}, err } // Update status if it has changed if !equality.Semantic.DeepEqual(original, apiServiceExport) { - err := r.Status().Update(ctx, apiServiceExport) + err := client.Status().Update(ctx, apiServiceExport) if err != nil { return ctrl.Result{}, fmt.Errorf("failed to update APIServiceExport status: %w", err) } @@ -171,13 +148,39 @@ func (r *APIServiceExportReconciler) Reconcile(ctx context.Context, req ctrl.Req return ctrl.Result{}, nil } +// getCRDMapper returns a mapper function that uses the manager to find related APIServiceExports. +func getCRDMapper(clusterName string, cl cluster.Cluster) handler.TypedEventHandler[client.Object, mcreconcile.Request] { + return handler.TypedEnqueueRequestsFromMapFunc[client.Object, mcreconcile.Request](func(ctx context.Context, obj client.Object) []mcreconcile.Request { + crd := obj.(*apiextensionsv1.CustomResourceDefinition) + crdKey := crd.Name + c := cl.GetClient() + + var exports kubebindv1alpha2.APIServiceExportList + if err := c.List(ctx, &exports, client.MatchingFields{indexers.ServiceExportByCustomResourceDefinition: crdKey}); err != nil { + return []mcreconcile.Request{} + } + + var requests []mcreconcile.Request + for _, export := range exports.Items { + requests = append(requests, mcreconcile.Request{ + Request: reconcile.Request{ + NamespacedName: client.ObjectKeyFromObject(&export), + }, + ClusterName: clusterName, + }) + } + + return requests + }) +} + // SetupWithManager sets up the controller with the Manager. -func (r *APIServiceExportReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). +func (r *APIServiceExportReconciler) SetupWithManager(mgr mcmanager.Manager) error { + return mcbuilder.ControllerManagedBy(mgr). For(&kubebindv1alpha2.APIServiceExport{}). Watches( &apiextensionsv1.CustomResourceDefinition{}, - handler.EnqueueRequestsFromMapFunc(r.createCRDMapper()), + getCRDMapper, ). Named(controllerName). Complete(r) diff --git a/contrib/example-backend/controllers/serviceexport/serviceexport_reconcile.go b/contrib/example-backend/controllers/serviceexport/serviceexport_reconcile.go index f26bc9ee7..b9962d64a 100644 --- a/contrib/example-backend/controllers/serviceexport/serviceexport_reconcile.go +++ b/contrib/example-backend/controllers/serviceexport/serviceexport_reconcile.go @@ -27,6 +27,7 @@ import ( "k8s.io/apimachinery/pkg/api/errors" utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/cache" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" kubebindhelpers "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2/helpers" @@ -34,12 +35,12 @@ import ( ) type reconciler struct { - getCRD func(ctx context.Context, name string) (*apiextensionsv1.CustomResourceDefinition, error) + getCRD func(ctx context.Context, cache cache.Cache, name string) (*apiextensionsv1.CustomResourceDefinition, error) getAPIResourceSchema func(ctx context.Context, name string) (*kubebindv1alpha2.APIResourceSchema, error) deleteServiceExport func(ctx context.Context, namespace, name string) error } -func (r *reconciler) reconcile(ctx context.Context, export *kubebindv1alpha2.APIServiceExport) error { +func (r *reconciler) reconcile(ctx context.Context, cache cache.Cache, export *kubebindv1alpha2.APIServiceExport) error { var errs []error if specChanged, err := r.ensureSchema(ctx, export); err != nil { diff --git a/contrib/example-backend/controllers/serviceexportrequest/serviceexportrequest_controller.go b/contrib/example-backend/controllers/serviceexportrequest/serviceexportrequest_controller.go index db7eb08e5..7570e928b 100644 --- a/contrib/example-backend/controllers/serviceexportrequest/serviceexportrequest_controller.go +++ b/contrib/example-backend/controllers/serviceexportrequest/serviceexportrequest_controller.go @@ -24,16 +24,19 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" kubernetesclient "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/cluster" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/reconcile" + mcbuilder "sigs.k8s.io/multicluster-runtime/pkg/builder" + mcmanager "sigs.k8s.io/multicluster-runtime/pkg/manager" + mcreconcile "sigs.k8s.io/multicluster-runtime/pkg/reconcile" "github.com/kube-bind/kube-bind/pkg/indexers" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" @@ -46,8 +49,7 @@ const ( // APIServiceExportRequestReconciler reconciles a APIServiceExportRequest object. type APIServiceExportRequestReconciler struct { - client.Client - Scheme *runtime.Scheme + manager mcmanager.Manager bindClient bindclient.Interface kubeClient kubernetesclient.Interface @@ -59,10 +61,8 @@ type APIServiceExportRequestReconciler struct { // NewAPIServiceExportRequestReconciler returns a new APIServiceExportRequestReconciler to reconcile APIServiceExportRequests. func NewAPIServiceExportRequestReconciler( ctx context.Context, - c client.Client, - scheme *runtime.Scheme, + mgr mcmanager.Manager, config *rest.Config, - cache cache.Cache, scope kubebindv1alpha2.InformerScope, isolation kubebindv1alpha2.Isolation, ) (*APIServiceExportRequestReconciler, error) { @@ -79,19 +79,18 @@ func NewAPIServiceExportRequestReconciler( } // Set up field indexers for APIServiceExportRequests - if err := cache.IndexField(ctx, &kubebindv1alpha2.APIServiceExportRequest{}, indexers.ServiceExportRequestByServiceExport, + if err := mgr.GetFieldIndexer().IndexField(ctx, &kubebindv1alpha2.APIServiceExportRequest{}, indexers.ServiceExportRequestByServiceExport, indexers.IndexServiceExportRequestByServiceExportControllerRuntime); err != nil { return nil, fmt.Errorf("failed to setup ServiceExportRequestByServiceExport indexer: %w", err) } - if err := cache.IndexField(ctx, &kubebindv1alpha2.APIServiceExportRequest{}, indexers.ServiceExportRequestByGroupResource, + if err := mgr.GetFieldIndexer().IndexField(ctx, &kubebindv1alpha2.APIServiceExportRequest{}, indexers.ServiceExportRequestByGroupResource, indexers.IndexServiceExportRequestByGroupResourceControllerRuntime); err != nil { return nil, fmt.Errorf("failed to setup ServiceExportRequestByGroupResource indexer: %w", err) } r := &APIServiceExportRequestReconciler{ - Client: c, - Scheme: scheme, + manager: mgr, bindClient: bindClient, kubeClient: kubeClient, informerScope: scope, @@ -99,7 +98,7 @@ func NewAPIServiceExportRequestReconciler( reconciler: reconciler{ informerScope: scope, clusterScopedIsolation: isolation, - getCRD: func(ctx context.Context, name string) (*apiextensionsv1.CustomResourceDefinition, error) { + getCRD: func(ctx context.Context, cache cache.Cache, name string) (*apiextensionsv1.CustomResourceDefinition, error) { var crd apiextensionsv1.CustomResourceDefinition key := types.NamespacedName{Name: name} if err := cache.Get(ctx, key, &crd); err != nil { @@ -107,7 +106,7 @@ func NewAPIServiceExportRequestReconciler( } return &crd, nil }, - getAPIResourceSchema: func(ctx context.Context, name string) (*kubebindv1alpha2.APIResourceSchema, error) { + getAPIResourceSchema: func(ctx context.Context, cache cache.Cache, name string) (*kubebindv1alpha2.APIResourceSchema, error) { var schema kubebindv1alpha2.APIResourceSchema key := types.NamespacedName{Name: name} if err := cache.Get(ctx, key, &schema); err != nil { @@ -115,7 +114,7 @@ func NewAPIServiceExportRequestReconciler( } return &schema, nil }, - getServiceExport: func(ctx context.Context, ns, name string) (*kubebindv1alpha2.APIServiceExport, error) { + getServiceExport: func(ctx context.Context, cache cache.Cache, ns, name string) (*kubebindv1alpha2.APIServiceExport, error) { var export kubebindv1alpha2.APIServiceExport key := types.NamespacedName{Namespace: ns, Name: name} if err := cache.Get(ctx, key, &export); err != nil { @@ -138,54 +137,64 @@ func NewAPIServiceExportRequestReconciler( return r, nil } -// createServiceExportRequestMapper creates a mapping function for ServiceExport changes. -func (r *APIServiceExportRequestReconciler) createServiceExportRequestMapper() handler.MapFunc { - return func(ctx context.Context, obj client.Object) []reconcile.Request { +// getServiceExportRequestMapper creates a mapping function for ServiceExport changes. + +func getServiceExportRequestMapper(clusterName string, cl cluster.Cluster) handler.TypedEventHandler[client.Object, mcreconcile.Request] { + return handler.TypedEnqueueRequestsFromMapFunc[client.Object, mcreconcile.Request](func(ctx context.Context, obj client.Object) []mcreconcile.Request { serviceExport := obj.(*kubebindv1alpha2.APIServiceExport) seKey := serviceExport.Namespace + "/" + serviceExport.Name + c := cl.GetClient() + var requests kubebindv1alpha2.APIServiceExportRequestList - if err := r.List(ctx, &requests, client.MatchingFields{indexers.ServiceExportRequestByServiceExport: seKey}); err != nil { - return []reconcile.Request{} + if err := c.List(ctx, &requests, client.MatchingFields{indexers.ServiceExportRequestByServiceExport: seKey}); err != nil { + return []mcreconcile.Request{} } - var result []reconcile.Request + var result []mcreconcile.Request for _, req := range requests.Items { - result = append(result, reconcile.Request{ - NamespacedName: types.NamespacedName{ - Namespace: req.Namespace, - Name: req.Name, + result = append(result, mcreconcile.Request{ + Request: reconcile.Request{ + NamespacedName: types.NamespacedName{ + Namespace: req.Namespace, + Name: req.Name, + }, }, + ClusterName: clusterName, }) } return result - } + }) } -// createCRDMapper creates a mapping function for CRD changes. -func (r *APIServiceExportRequestReconciler) createCRDMapper() handler.MapFunc { - return func(ctx context.Context, obj client.Object) []reconcile.Request { +// getCRDMapper creates a mapping function for CRD changes. +func getCRDMapper(clusterName string, cl cluster.Cluster) handler.TypedEventHandler[client.Object, mcreconcile.Request] { + return handler.TypedEnqueueRequestsFromMapFunc[client.Object, mcreconcile.Request](func(ctx context.Context, obj client.Object) []mcreconcile.Request { crd := obj.(*apiextensionsv1.CustomResourceDefinition) crdKey := crd.Name // CRDs are cluster-scoped + c := cl.GetClient() + var requests kubebindv1alpha2.APIServiceExportRequestList - if err := r.List(ctx, &requests, client.MatchingFields{indexers.ServiceExportRequestByGroupResource: crdKey}); err != nil { - return []reconcile.Request{} + if err := c.List(ctx, &requests, client.MatchingFields{indexers.ServiceExportRequestByGroupResource: crdKey}); err != nil { + return []mcreconcile.Request{} } - var result []reconcile.Request + var result []mcreconcile.Request for _, req := range requests.Items { - result = append(result, reconcile.Request{ - NamespacedName: types.NamespacedName{ - Namespace: req.Namespace, - Name: req.Name, + result = append(result, mcreconcile.Request{ + Request: reconcile.Request{ + NamespacedName: types.NamespacedName{ + Namespace: req.Namespace, + Name: req.Name, + }, }, + ClusterName: clusterName, }) } - return result - } + }) } //+kubebuilder:rbac:groups=kubebind.k8s.io,resources=apiserviceexportrequests,verbs=get;list;watch;create;update;patch;delete @@ -197,13 +206,21 @@ func (r *APIServiceExportRequestReconciler) createCRDMapper() handler.MapFunc { // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. -func (r *APIServiceExportRequestReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { +func (r *APIServiceExportRequestReconciler) Reconcile(ctx context.Context, req mcreconcile.Request) (ctrl.Result, error) { logger := log.FromContext(ctx) - logger.Info("Reconciling APIServiceExportRequest", "namespace", req.Namespace, "name", req.Name) + logger.Info("Reconciling APIServiceExportRequest", "cluster", req.ClusterName, "namespace", req.Namespace, "name", req.Name) + + cl, err := r.manager.GetCluster(ctx, req.ClusterName) + if err != nil { + return ctrl.Result{}, fmt.Errorf("failed to get client for cluster %q: %w", req.ClusterName, err) + } + + client := cl.GetClient() + cache := cl.GetCache() // Fetch the APIServiceExportRequest instance apiServiceExportRequest := &kubebindv1alpha2.APIServiceExportRequest{} - if err := r.Get(ctx, req.NamespacedName, apiServiceExportRequest); err != nil { + if err := client.Get(ctx, req.NamespacedName, apiServiceExportRequest); err != nil { if errors.IsNotFound(err) { // Request object not found, could have been deleted after reconcile request. logger.Info("APIServiceExportRequest not found, ignoring") @@ -217,14 +234,14 @@ func (r *APIServiceExportRequestReconciler) Reconcile(ctx context.Context, req c original := apiServiceExportRequest.DeepCopy() // Run the reconciliation logic - if err := r.reconciler.reconcile(ctx, apiServiceExportRequest); err != nil { + if err := r.reconciler.reconcile(ctx, cache, apiServiceExportRequest); err != nil { logger.Error(err, "Failed to reconcile APIServiceExportRequest") return ctrl.Result{}, err } // Update status if it has changed if !reflect.DeepEqual(original.Status, apiServiceExportRequest.Status) { - err := r.Status().Update(ctx, apiServiceExportRequest) + err := client.Status().Update(ctx, apiServiceExportRequest) if err != nil { logger.Error(err, "Failed to update APIServiceExportRequest status") return ctrl.Result{}, fmt.Errorf("failed to update APIServiceExportRequest status: %w", err) @@ -236,16 +253,16 @@ func (r *APIServiceExportRequestReconciler) Reconcile(ctx context.Context, req c } // SetupWithManager sets up the controller with the Manager. -func (r *APIServiceExportRequestReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). +func (r *APIServiceExportRequestReconciler) SetupWithManager(mgr mcmanager.Manager) error { + return mcbuilder.ControllerManagedBy(mgr). For(&kubebindv1alpha2.APIServiceExportRequest{}). Watches( &kubebindv1alpha2.APIServiceExport{}, - handler.EnqueueRequestsFromMapFunc(r.createServiceExportRequestMapper()), + getServiceExportRequestMapper, ). Watches( &apiextensionsv1.CustomResourceDefinition{}, - handler.EnqueueRequestsFromMapFunc(r.createCRDMapper()), + getCRDMapper, ). Named(controllerName). Complete(r) diff --git a/contrib/example-backend/controllers/serviceexportrequest/serviceexportrequest_reconcile.go b/contrib/example-backend/controllers/serviceexportrequest/serviceexportrequest_reconcile.go index 753ff11c3..353e7a1cd 100644 --- a/contrib/example-backend/controllers/serviceexportrequest/serviceexportrequest_reconcile.go +++ b/contrib/example-backend/controllers/serviceexportrequest/serviceexportrequest_reconcile.go @@ -25,6 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/cache" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2/helpers" @@ -36,18 +37,18 @@ type reconciler struct { informerScope kubebindv1alpha2.InformerScope clusterScopedIsolation kubebindv1alpha2.Isolation - getCRD func(ctx context.Context, name string) (*apiextensionsv1.CustomResourceDefinition, error) - getAPIResourceSchema func(ctx context.Context, name string) (*kubebindv1alpha2.APIResourceSchema, error) - getServiceExport func(ctx context.Context, ns, name string) (*kubebindv1alpha2.APIServiceExport, error) + getCRD func(ctx context.Context, cache cache.Cache, name string) (*apiextensionsv1.CustomResourceDefinition, error) + getAPIResourceSchema func(ctx context.Context, cache cache.Cache, name string) (*kubebindv1alpha2.APIResourceSchema, error) + getServiceExport func(ctx context.Context, cache cache.Cache, ns, name string) (*kubebindv1alpha2.APIServiceExport, error) createServiceExport func(ctx context.Context, resource *kubebindv1alpha2.APIServiceExport) (*kubebindv1alpha2.APIServiceExport, error) createAPIResourceSchema func(ctx context.Context, schema *kubebindv1alpha2.APIResourceSchema) (*kubebindv1alpha2.APIResourceSchema, error) deleteServiceExportRequest func(ctx context.Context, namespace, name string) error } -func (r *reconciler) reconcile(ctx context.Context, req *kubebindv1alpha2.APIServiceExportRequest) error { +func (r *reconciler) reconcile(ctx context.Context, cache cache.Cache, req *kubebindv1alpha2.APIServiceExportRequest) error { var errs []error - if err := r.ensureExports(ctx, req); err != nil { + if err := r.ensureExports(ctx, cache, req); err != nil { errs = append(errs, err) } @@ -56,7 +57,7 @@ func (r *reconciler) reconcile(ctx context.Context, req *kubebindv1alpha2.APISer return utilerrors.NewAggregate(errs) } -func (r *reconciler) ensureExports(ctx context.Context, req *kubebindv1alpha2.APIServiceExportRequest) error { +func (r *reconciler) ensureExports(ctx context.Context, cache cache.Cache, req *kubebindv1alpha2.APIServiceExportRequest) error { logger := klog.FromContext(ctx) if req.Status.Phase == kubebindv1alpha2.APIServiceExportRequestPhasePending { @@ -65,11 +66,11 @@ func (r *reconciler) ensureExports(ctx context.Context, req *kubebindv1alpha2.AP // backend is created using CRD's as backup. But this is not required. name := res.Resource + "." + res.Group - apiResourceSchema, err := r.getAPIResourceSchema(ctx, name) + apiResourceSchema, err := r.getAPIResourceSchema(ctx, cache, name) switch { case apierrors.IsNotFound(err): logger.V(1).Info("APIResourceSchema not found, continuing with fallback to CRD conversion to APIResourceSchema", "name", name) - crd, err := r.getCRD(ctx, name) + crd, err := r.getCRD(ctx, cache, name) if err != nil && !apierrors.IsNotFound(err) { return err } @@ -99,7 +100,7 @@ func (r *reconciler) ensureExports(ctx context.Context, req *kubebindv1alpha2.AP return err } - if _, err := r.getServiceExport(ctx, req.Namespace, name); err != nil && !apierrors.IsNotFound(err) { + if _, err := r.getServiceExport(ctx, cache, req.Namespace, name); err != nil && !apierrors.IsNotFound(err) { return err } else if err == nil { continue diff --git a/contrib/example-backend/controllers/servicenamespace/servicenamespace_controller.go b/contrib/example-backend/controllers/servicenamespace/servicenamespace_controller.go index ec20c54e6..78e336c21 100644 --- a/contrib/example-backend/controllers/servicenamespace/servicenamespace_controller.go +++ b/contrib/example-backend/controllers/servicenamespace/servicenamespace_controller.go @@ -25,16 +25,19 @@ import ( rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" kubernetesclient "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/cluster" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/reconcile" + mcbuilder "sigs.k8s.io/multicluster-runtime/pkg/builder" + mcmanager "sigs.k8s.io/multicluster-runtime/pkg/manager" + mcreconcile "sigs.k8s.io/multicluster-runtime/pkg/reconcile" "github.com/kube-bind/kube-bind/pkg/indexers" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" @@ -47,8 +50,7 @@ const ( // APIServiceNamespaceReconciler reconciles a APIServiceNamespace object. type APIServiceNamespaceReconciler struct { - client.Client - Scheme *runtime.Scheme + manager mcmanager.Manager bindClient bindclient.Interface kubeClient kubernetesclient.Interface @@ -60,10 +62,8 @@ type APIServiceNamespaceReconciler struct { // NewAPIServiceNamespaceReconciler returns a new APIServiceNamespaceReconciler to reconcile APIServiceNamespaces. func NewAPIServiceNamespaceReconciler( ctx context.Context, - c client.Client, - scheme *runtime.Scheme, + mgr mcmanager.Manager, config *rest.Config, - cache cache.Cache, scope kubebindv1alpha2.InformerScope, isolation kubebindv1alpha2.Isolation, ) (*APIServiceNamespaceReconciler, error) { @@ -80,14 +80,13 @@ func NewAPIServiceNamespaceReconciler( } // Set up field indexers for APIServiceNamespaces - if err := cache.IndexField(ctx, &kubebindv1alpha2.APIServiceNamespace{}, indexers.ServiceNamespaceByNamespace, + if err := mgr.GetFieldIndexer().IndexField(ctx, &kubebindv1alpha2.APIServiceNamespace{}, indexers.ServiceNamespaceByNamespace, indexers.IndexServiceNamespaceByNamespaceControllerRuntime); err != nil { return nil, fmt.Errorf("failed to setup ServiceNamespaceByNamespace indexer: %w", err) } r := &APIServiceNamespaceReconciler{ - Client: c, - Scheme: scheme, + manager: mgr, bindClient: bindClient, kubeClient: kubeClient, informerScope: scope, @@ -95,7 +94,7 @@ func NewAPIServiceNamespaceReconciler( reconciler: reconciler{ scope: scope, - getNamespace: func(name string) (*corev1.Namespace, error) { + getNamespace: func(ctx context.Context, cache cache.Cache, name string) (*corev1.Namespace, error) { var ns corev1.Namespace key := types.NamespacedName{Name: name} if err := cache.Get(ctx, key, &ns); err != nil { @@ -110,7 +109,7 @@ func NewAPIServiceNamespaceReconciler( return kubeClient.CoreV1().Namespaces().Delete(ctx, name, metav1.DeleteOptions{}) }, - getRoleBinding: func(ns, name string) (*rbacv1.RoleBinding, error) { + getRoleBinding: func(ctx context.Context, cache cache.Cache, ns, name string) (*rbacv1.RoleBinding, error) { var rb rbacv1.RoleBinding key := types.NamespacedName{Namespace: ns, Name: name} if err := cache.Get(ctx, key, &rb); err != nil { @@ -130,79 +129,93 @@ func NewAPIServiceNamespaceReconciler( return r, nil } -// createNamespaceMapper creates a mapping function for Namespace changes. -func (r *APIServiceNamespaceReconciler) createNamespaceMapper() handler.MapFunc { - return func(ctx context.Context, obj client.Object) []reconcile.Request { +// getNamespaceMapper creates a mapping function for Namespace changes. +func getNamespaceMapper(clusterName string, cl cluster.Cluster) handler.TypedEventHandler[client.Object, mcreconcile.Request] { + return handler.TypedEnqueueRequestsFromMapFunc[client.Object, mcreconcile.Request](func(ctx context.Context, obj client.Object) []mcreconcile.Request { namespace := obj.(*corev1.Namespace) nsKey := namespace.Name + c := cl.GetClient() + var serviceNamespaces kubebindv1alpha2.APIServiceNamespaceList - if err := r.List(ctx, &serviceNamespaces, client.MatchingFields{indexers.ServiceNamespaceByNamespace: nsKey}); err != nil { - return []reconcile.Request{} + if err := c.List(ctx, &serviceNamespaces, client.MatchingFields{indexers.ServiceNamespaceByNamespace: nsKey}); err != nil { + return []mcreconcile.Request{} } - var result []reconcile.Request + var result []mcreconcile.Request for _, sns := range serviceNamespaces.Items { - result = append(result, reconcile.Request{ - NamespacedName: types.NamespacedName{ - Namespace: sns.Namespace, - Name: sns.Name, + result = append(result, mcreconcile.Request{ + Request: reconcile.Request{ + NamespacedName: types.NamespacedName{ + Namespace: sns.Namespace, + Name: sns.Name, + }, }, + ClusterName: clusterName, }) } - return result - } + }) } // createClusterBindingMapper creates a mapping function for ClusterBinding changes. -func (r *APIServiceNamespaceReconciler) createClusterBindingMapper() handler.MapFunc { - return func(ctx context.Context, obj client.Object) []reconcile.Request { +func getClusterBindingMapper(clusterName string, cl cluster.Cluster) handler.TypedEventHandler[client.Object, mcreconcile.Request] { + return handler.TypedEnqueueRequestsFromMapFunc[client.Object, mcreconcile.Request](func(ctx context.Context, obj client.Object) []mcreconcile.Request { clusterBinding := obj.(*kubebindv1alpha2.ClusterBinding) ns := clusterBinding.Namespace + c := cl.GetClient() + var serviceNamespaces kubebindv1alpha2.APIServiceNamespaceList - if err := r.List(ctx, &serviceNamespaces, client.InNamespace(ns)); err != nil { - return []reconcile.Request{} + if err := c.List(ctx, &serviceNamespaces, client.InNamespace(ns)); err != nil { + return []mcreconcile.Request{} } - var result []reconcile.Request + var result []mcreconcile.Request for _, sns := range serviceNamespaces.Items { - result = append(result, reconcile.Request{ - NamespacedName: types.NamespacedName{ - Namespace: sns.Namespace, - Name: sns.Name, + result = append(result, mcreconcile.Request{ + Request: reconcile.Request{ + NamespacedName: types.NamespacedName{ + Namespace: sns.Namespace, + Name: sns.Name, + }, }, + ClusterName: clusterName, }) } return result - } + }) } -// createServiceExportMapper creates a mapping function for APIServiceExport changes. -func (r *APIServiceNamespaceReconciler) createServiceExportMapper() handler.MapFunc { - return func(ctx context.Context, obj client.Object) []reconcile.Request { +// getServiceExportMapper creates a mapping function for APIServiceExport changes. +func getServiceExportMapper(clusterName string, cl cluster.Cluster) handler.TypedEventHandler[client.Object, mcreconcile.Request] { + return handler.TypedEnqueueRequestsFromMapFunc[client.Object, mcreconcile.Request](func(ctx context.Context, obj client.Object) []mcreconcile.Request { serviceExport := obj.(*kubebindv1alpha2.APIServiceExport) ns := serviceExport.Namespace + c := cl.GetClient() + var serviceNamespaces kubebindv1alpha2.APIServiceNamespaceList - if err := r.List(ctx, &serviceNamespaces, client.InNamespace(ns)); err != nil { - return []reconcile.Request{} + if err := c.List(ctx, &serviceNamespaces, client.InNamespace(ns)); err != nil { + return []mcreconcile.Request{} } - var result []reconcile.Request + var result []mcreconcile.Request for _, sns := range serviceNamespaces.Items { - result = append(result, reconcile.Request{ - NamespacedName: types.NamespacedName{ - Namespace: sns.Namespace, - Name: sns.Name, + result = append(result, mcreconcile.Request{ + Request: reconcile.Request{ + NamespacedName: types.NamespacedName{ + Namespace: sns.Namespace, + Name: sns.Name, + }, }, + ClusterName: clusterName, }) } return result - } + }) } //+kubebuilder:rbac:groups=kubebind.k8s.io,resources=apiservicenamespaces,verbs=get;list;watch;create;update;patch;delete @@ -215,13 +228,21 @@ func (r *APIServiceNamespaceReconciler) createServiceExportMapper() handler.MapF // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. -func (r *APIServiceNamespaceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { +func (r *APIServiceNamespaceReconciler) Reconcile(ctx context.Context, req mcreconcile.Request) (ctrl.Result, error) { logger := log.FromContext(ctx) - logger.Info("Reconciling APIServiceNamespace", "namespace", req.Namespace, "name", req.Name) + logger.Info("Reconciling APIServiceNamespace", "cluster", req.ClusterName, "namespace", req.Namespace, "name", req.Name) + + cl, err := r.manager.GetCluster(ctx, req.ClusterName) + if err != nil { + return ctrl.Result{}, fmt.Errorf("failed to get client for cluster %q: %w", req.ClusterName, err) + } + + client := cl.GetClient() + cache := cl.GetCache() // Fetch the APIServiceNamespace instance apiServiceNamespace := &kubebindv1alpha2.APIServiceNamespace{} - if err := r.Get(ctx, req.NamespacedName, apiServiceNamespace); err != nil { + if err := client.Get(ctx, req.NamespacedName, apiServiceNamespace); err != nil { if errors.IsNotFound(err) { // Request object not found, could have been deleted after reconcile request. // Handle deletion logic here @@ -240,14 +261,14 @@ func (r *APIServiceNamespaceReconciler) Reconcile(ctx context.Context, req ctrl. original := apiServiceNamespace.DeepCopy() // Run the reconciliation logic - if err := r.reconciler.reconcile(ctx, apiServiceNamespace); err != nil { + if err := r.reconciler.reconcile(ctx, cache, apiServiceNamespace); err != nil { logger.Error(err, "Failed to reconcile APIServiceNamespace") return ctrl.Result{}, err } // Update status if it has changed if !reflect.DeepEqual(original.Status, apiServiceNamespace.Status) { - err := r.Status().Update(ctx, apiServiceNamespace) + err := client.Status().Update(ctx, apiServiceNamespace) if err != nil { logger.Error(err, "Failed to update APIServiceNamespace status") return ctrl.Result{}, fmt.Errorf("failed to update APIServiceNamespace status: %w", err) @@ -259,20 +280,20 @@ func (r *APIServiceNamespaceReconciler) Reconcile(ctx context.Context, req ctrl. } // SetupWithManager sets up the controller with the Manager. -func (r *APIServiceNamespaceReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). +func (r *APIServiceNamespaceReconciler) SetupWithManager(mgr mcmanager.Manager) error { + return mcbuilder.ControllerManagedBy(mgr). For(&kubebindv1alpha2.APIServiceNamespace{}). Watches( &corev1.Namespace{}, - handler.EnqueueRequestsFromMapFunc(r.createNamespaceMapper()), + getNamespaceMapper, ). Watches( &kubebindv1alpha2.ClusterBinding{}, - handler.EnqueueRequestsFromMapFunc(r.createClusterBindingMapper()), + getClusterBindingMapper, ). Watches( &kubebindv1alpha2.APIServiceExport{}, - handler.EnqueueRequestsFromMapFunc(r.createServiceExportMapper()), + getServiceExportMapper, ). Named(controllerName). Complete(r) diff --git a/contrib/example-backend/controllers/servicenamespace/servicenamespace_reconcile.go b/contrib/example-backend/controllers/servicenamespace/servicenamespace_reconcile.go index 232db42a3..8c854594e 100644 --- a/contrib/example-backend/controllers/servicenamespace/servicenamespace_reconcile.go +++ b/contrib/example-backend/controllers/servicenamespace/servicenamespace_reconcile.go @@ -25,6 +25,7 @@ import ( rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/cache" kuberesources "github.com/kube-bind/kube-bind/contrib/example-backend/kubernetes/resources" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" @@ -33,21 +34,21 @@ import ( type reconciler struct { scope kubebindv1alpha2.InformerScope - getNamespace func(name string) (*corev1.Namespace, error) + getNamespace func(ctx context.Context, cache cache.Cache, name string) (*corev1.Namespace, error) createNamespace func(ctx context.Context, ns *corev1.Namespace) (*corev1.Namespace, error) deleteNamespace func(ctx context.Context, name string) error - getRoleBinding func(ns, name string) (*rbacv1.RoleBinding, error) + getRoleBinding func(ctx context.Context, cache cache.Cache, ns, name string) (*rbacv1.RoleBinding, error) createRoleBinding func(ctx context.Context, crb *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error) updateRoleBinding func(ctx context.Context, cr *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error) } -func (c *reconciler) reconcile(ctx context.Context, sns *kubebindv1alpha2.APIServiceNamespace) error { +func (c *reconciler) reconcile(ctx context.Context, cache cache.Cache, sns *kubebindv1alpha2.APIServiceNamespace) error { var ns *corev1.Namespace nsName := sns.Namespace + "-" + sns.Name if sns.Status.Namespace != "" { nsName = sns.Status.Namespace - ns, _ = c.getNamespace(nsName) // golint:errcheck + ns, _ = c.getNamespace(ctx, cache, nsName) // golint:errcheck } if ns == nil { ns = &corev1.Namespace{ @@ -64,7 +65,7 @@ func (c *reconciler) reconcile(ctx context.Context, sns *kubebindv1alpha2.APISer } if c.scope == kubebindv1alpha2.NamespacedScope { - if err := c.ensureRBACRoleBinding(ctx, nsName, sns); err != nil { + if err := c.ensureRBACRoleBinding(ctx, cache, nsName, sns); err != nil { return fmt.Errorf("failed to ensure RBAC: %w", err) } } @@ -76,9 +77,9 @@ func (c *reconciler) reconcile(ctx context.Context, sns *kubebindv1alpha2.APISer return nil } -func (c *reconciler) ensureRBACRoleBinding(ctx context.Context, ns string, sns *kubebindv1alpha2.APIServiceNamespace) error { +func (c *reconciler) ensureRBACRoleBinding(ctx context.Context, cache cache.Cache, ns string, sns *kubebindv1alpha2.APIServiceNamespace) error { objName := "kube-binder" - binding, err := c.getRoleBinding(ns, objName) + binding, err := c.getRoleBinding(ctx, cache, ns, objName) if err != nil && !errors.IsNotFound(err) { return fmt.Errorf("failed to get role binding %s/%s: %w", ns, objName, err) } diff --git a/contrib/example-backend/http/handler.go b/contrib/example-backend/http/handler.go index f2d27faf0..d22f46e78 100644 --- a/contrib/example-backend/http/handler.go +++ b/contrib/example-backend/http/handler.go @@ -32,7 +32,6 @@ import ( "github.com/gorilla/mux" "github.com/gorilla/securecookie" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - apiextensionslisters "k8s.io/apiextensions-apiserver/pkg/client/listers/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" @@ -70,9 +69,8 @@ type handler struct { cookieEncryptionKey []byte cookieSigningKey []byte - client *http.Client - apiextensionsLister apiextensionslisters.CustomResourceDefinitionLister - kubeManager *kubernetes.Manager + client *http.Client + kubeManager *kubernetes.Manager } func NewHandler( @@ -81,7 +79,6 @@ func NewHandler( cookieSigningKey, cookieEncryptionKey []byte, scope kubebindv1alpha2.InformerScope, mgr *kubernetes.Manager, - apiextensionsLister apiextensionslisters.CustomResourceDefinitionLister, ) (*handler, error) { return &handler{ oidc: provider, @@ -92,26 +89,41 @@ func NewHandler( scope: scope, client: http.DefaultClient, kubeManager: mgr, - apiextensionsLister: apiextensionsLister, cookieSigningKey: cookieSigningKey, cookieEncryptionKey: cookieEncryptionKey, }, nil } func (h *handler) AddRoutes(mux *mux.Router) { - mux.HandleFunc("/export", h.handleServiceExport).Methods("GET") + // Server contains double routes for when backend is multi-cluster aware or single cluster. + // When called multi-cluster aware route in single cluster mode, it will ignore cluster parameter. + mux.HandleFunc("/clusters/{cluster}/exports", h.handleServiceExport).Methods("GET") + mux.HandleFunc("/exports", h.handleServiceExport).Methods("GET") + + mux.HandleFunc("/clusters/{cluster}/resources", h.handleResources).Methods("GET") mux.HandleFunc("/resources", h.handleResources).Methods("GET") + + mux.HandleFunc("/clusters/{cluster}/bind", h.handleBind).Methods("GET") mux.HandleFunc("/bind", h.handleBind).Methods("GET") + + mux.HandleFunc("/clusters/{cluster}/authorize", h.handleAuthorize).Methods("GET") mux.HandleFunc("/authorize", h.handleAuthorize).Methods("GET") + mux.HandleFunc("/callback", h.handleCallback).Methods("GET") } func (h *handler) handleServiceExport(w http.ResponseWriter, r *http.Request) { logger := klog.FromContext(r.Context()).WithValues("method", r.Method, "url", r.URL.String()) + cluster := mux.Vars(r)["cluster"] + singleClusterScoped := cluster == "" oidcAuthorizeURL := h.oidcAuthorizeURL if oidcAuthorizeURL == "" { - oidcAuthorizeURL = fmt.Sprintf("http://%s/authorize", r.Host) + if singleClusterScoped { + oidcAuthorizeURL = fmt.Sprintf("http://%s/authorize", r.Host) + } else { + oidcAuthorizeURL = fmt.Sprintf("http://%s/clusters/%s/authorize", r.Host, cluster) + } } ver, err := bindversion.BinaryVersion(componentbaseversion.Get().GitVersion) @@ -159,16 +171,18 @@ func prepareNoCache(w http.ResponseWriter) { func (h *handler) handleAuthorize(w http.ResponseWriter, r *http.Request) { logger := klog.FromContext(r.Context()).WithValues("method", r.Method, "url", r.URL.String()) + cluster := mux.Vars(r)["cluster"] + scopes := []string{"openid", "profile", "email", "offline_access"} code := &AuthCode{ RedirectURL: r.URL.Query().Get("u"), SessionID: r.URL.Query().Get("s"), - ClusterID: r.URL.Query().Get("c"), + ClusterID: cluster, } if p := r.URL.Query().Get("p"); p != "" && code.RedirectURL == "" { code.RedirectURL = fmt.Sprintf("http://localhost:%s/callback", p) } - if code.RedirectURL == "" || code.SessionID == "" || code.ClusterID == "" { + if code.RedirectURL == "" || code.SessionID == "" { logger.Error(errors.New("missing redirect url or session id or cluster id"), "failed to authorize") http.Error(w, "missing redirect_url or session_id", http.StatusBadRequest) return @@ -277,7 +291,11 @@ func (h *handler) handleCallback(w http.ResponseWriter, r *http.Request) { } http.SetCookie(w, cookie.MakeCookie(r, cookieName, encoded, time.Duration(1)*time.Hour)) - http.Redirect(w, r, "/resources?s="+authCode.SessionID, http.StatusFound) + if authCode.ClusterID == "" { + http.Redirect(w, r, "/resources?s="+authCode.SessionID, http.StatusFound) + } else { + http.Redirect(w, r, "/clusters/"+authCode.ClusterID+"/resources?s="+authCode.SessionID, http.StatusFound) + } } func (h *handler) handleResources(w http.ResponseWriter, r *http.Request) { @@ -285,32 +303,39 @@ func (h *handler) handleResources(w http.ResponseWriter, r *http.Request) { prepareNoCache(w) + cluster := mux.Vars(r)["cluster"] + singleClusterScoped := cluster == "" + if h.testingAutoSelect != "" { parts := strings.SplitN(h.testingAutoSelect, ".", 2) - http.Redirect(w, r, "/resources/"+parts[0]+"/"+parts[1], http.StatusFound) + if singleClusterScoped { + http.Redirect(w, r, "/resources/"+parts[0]+"/"+parts[1], http.StatusFound) + } else { + http.Redirect(w, r, "/clusters/"+cluster+"/resources/"+parts[0]+"/"+parts[1], http.StatusFound) + } return } labelSelector := labels.Set{ resources.ExportedCRDsLabel: "true", } - crds, err := h.apiextensionsLister.List(labelSelector.AsSelector()) + crds, err := h.kubeManager.ListCustomResourceDefinitions(r.Context(), cluster, labelSelector.AsSelector()) if err != nil { logger.Error(err, "failed to list crds") http.Error(w, "internal error", http.StatusInternalServerError) return } - sort.SliceStable(crds, func(i, j int) bool { - return crds[i].Name < crds[j].Name + sort.SliceStable(crds.Items, func(i, j int) bool { + return crds.Items[i].Name < crds.Items[j].Name }) rightScopedCRDs := []*apiextensionsv1.CustomResourceDefinition{} - for _, crd := range crds { + for _, crd := range crds.Items { if h.scope == kubebindv1alpha2.ClusterScope || crd.Spec.Scope == apiextensionsv1.NamespaceScoped { - rightScopedCRDs = append(rightScopedCRDs, crd) + rightScopedCRDs = append(rightScopedCRDs, &crd) } } - apiResourceSchemas, err := h.kubeManager.ListAPIResourceSchemas(r.Context()) + apiResourceSchemas, err := h.kubeManager.ListAPIResourceSchemas(r.Context(), cluster) if err != nil { logger.Error(err, "failed to get api resource schemas") http.Error(w, "internal error", http.StatusInternalServerError) @@ -319,10 +344,12 @@ func (h *handler) handleResources(w http.ResponseWriter, r *http.Request) { bs := bytes.Buffer{} if err := resourcesTemplate.Execute(&bs, struct { SessionID string + Cluster string CRDs []*apiextensionsv1.CustomResourceDefinition APIResourceSchemas []kubebindv1alpha2.APIResourceSchema }{ SessionID: r.URL.Query().Get("s"), + Cluster: cluster, CRDs: rightScopedCRDs, APIResourceSchemas: apiResourceSchemas.Items, }); err != nil { @@ -368,7 +395,9 @@ func (h *handler) handleBind(w http.ResponseWriter, r *http.Request) { group := r.URL.Query().Get("group") resource := r.URL.Query().Get("resource") - kfg, err := h.kubeManager.HandleResources(r.Context(), idToken.Subject+"#"+state.ClusterID, resource, group) + cluster := mux.Vars(r)["cluster"] + + kfg, err := h.kubeManager.HandleResources(r.Context(), idToken.Subject+"#"+state.ClusterID, cluster, resource, group) if err != nil { logger.Error(err, "failed to handle resources") http.Error(w, "internal error", http.StatusInternalServerError) @@ -414,6 +443,7 @@ func (h *handler) handleBind(w http.ResponseWriter, r *http.Request) { Kubeconfig: kfg, Requests: []runtime.RawExtension{{Raw: requestBytes}}, } + payload, err := json.Marshal(&response) if err != nil { logger.Error(err, "failed to marshal auth response") diff --git a/contrib/example-backend/kubernetes/indexers.go b/contrib/example-backend/kubernetes/indexers.go index 08a7032a6..093e9a3f5 100644 --- a/contrib/example-backend/kubernetes/indexers.go +++ b/contrib/example-backend/kubernetes/indexers.go @@ -18,6 +18,7 @@ package kubernetes import ( corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/kube-bind/kube-bind/contrib/example-backend/kubernetes/resources" ) @@ -26,15 +27,15 @@ const ( NamespacesByIdentity = "namespacesByIdentity" ) -func IndexNamespacesByIdentity(obj any) ([]string, error) { +func IndexNamespacesByIdentity(obj client.Object) []string { ns, ok := obj.(*corev1.Namespace) if !ok { - return nil, nil + return nil } if id, found := ns.Annotations[resources.IdentityAnnotationKey]; found { - return []string{id}, nil + return []string{id} } - return nil, nil + return nil } diff --git a/contrib/example-backend/kubernetes/manager.go b/contrib/example-backend/kubernetes/manager.go index 1a2335710..a807187fe 100644 --- a/contrib/example-backend/kubernetes/manager.go +++ b/contrib/example-backend/kubernetes/manager.go @@ -21,107 +21,81 @@ import ( "fmt" corev1 "k8s.io/api/core/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - corev1informers "k8s.io/client-go/informers/core/v1" - kubeclient "k8s.io/client-go/kubernetes" - corev1listers "k8s.io/client-go/listers/core/v1" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/cache" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/client" + mcmanager "sigs.k8s.io/multicluster-runtime/pkg/manager" kuberesources "github.com/kube-bind/kube-bind/contrib/example-backend/kubernetes/resources" - "github.com/kube-bind/kube-bind/pkg/indexers" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" - bindclient "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" - bindinformers "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/kubebind/v1alpha2" - bindlisters "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" ) type Manager struct { namespacePrefix string providerPrettyName string - clusterConfig *rest.Config externalAddress string externalCA []byte externalTLSServerName string - kubeClient kubeclient.Interface - bindClient bindclient.Interface - - namespaceLister corev1listers.NamespaceLister - namespaceIndexer cache.Indexer - - exportLister bindlisters.APIServiceExportLister - exportIndexer cache.Indexer + manager mcmanager.Manager } func NewKubernetesManager( + ctx context.Context, namespacePrefix, providerPrettyName string, - config *rest.Config, externalAddress string, externalCA []byte, externalTLSServerName string, - namespaceInformer corev1informers.NamespaceInformer, - exportInformer bindinformers.APIServiceExportInformer, + manager mcmanager.Manager, ) (*Manager, error) { - config = rest.CopyConfig(config) - config = rest.AddUserAgent(config, "kube-bind-example-backend-kubernetes-manager") - - kubeClient, err := kubeclient.NewForConfig(config) - if err != nil { - return nil, err - } - bindClient, err := bindclient.NewForConfig(config) - if err != nil { - return nil, err - } - m := &Manager{ namespacePrefix: namespacePrefix, providerPrettyName: providerPrettyName, - clusterConfig: config, externalAddress: externalAddress, externalCA: externalCA, externalTLSServerName: externalTLSServerName, - kubeClient: kubeClient, - bindClient: bindClient, - - namespaceLister: namespaceInformer.Lister(), - namespaceIndexer: namespaceInformer.Informer().GetIndexer(), - - exportLister: exportInformer.Lister(), - exportIndexer: exportInformer.Informer().GetIndexer(), + manager: manager, } - indexers.AddIfNotPresentOrDie(m.namespaceIndexer, cache.Indexers{ - NamespacesByIdentity: IndexNamespacesByIdentity, - }) + if err := m.manager.GetFieldIndexer().IndexField(ctx, &corev1.Namespace{}, NamespacesByIdentity, + IndexNamespacesByIdentity); err != nil { + return nil, fmt.Errorf("failed to setup NamespacesByIdentity indexer: %w", err) + } return m, nil } -func (m *Manager) HandleResources(ctx context.Context, identity, resource, group string) ([]byte, error) { +func (m *Manager) HandleResources(ctx context.Context, identity, cluster, resource, group string) ([]byte, error) { logger := klog.FromContext(ctx).WithValues("identity", identity, "resource", resource, "group", group) ctx = klog.NewContext(ctx, logger) + cl, err := m.manager.GetCluster(ctx, cluster) + if err != nil { + return nil, err + } + c := cl.GetClient() + // try to find an existing namespace by annotation, or create a new one. - nss, err := m.namespaceIndexer.ByIndex(NamespacesByIdentity, identity) + var nss corev1.NamespaceList + err = c.List(ctx, &nss, client.MatchingFields{NamespacesByIdentity: identity}) if err != nil { return nil, err } - if len(nss) > 1 { + if len(nss.Items) > 1 { logger.Error(fmt.Errorf("found multiple namespaces for identity %q", identity), "found multiple namespaces for identity") return nil, fmt.Errorf("found multiple namespaces for identity %q", identity) } var ns string - if len(nss) == 1 { - ns = nss[0].(*corev1.Namespace).Name + if len(nss.Items) == 1 { + ns = nss.Items[0].Name } else { - nsObj, err := kuberesources.CreateNamespace(ctx, m.kubeClient, m.namespacePrefix, identity) + nsObj, err := kuberesources.CreateNamespace(ctx, c, m.namespacePrefix, identity) if err != nil { return nil, err } @@ -133,10 +107,11 @@ func (m *Manager) HandleResources(ctx context.Context, identity, resource, group // first look for ClusterBinding to get old secret name kubeconfigSecretName := kuberesources.KubeconfigSecretName - cb, err := m.bindClient.KubeBindV1alpha2().ClusterBindings(ns).Get(ctx, kuberesources.ClusterBindingName, metav1.GetOptions{}) + var cb kubebindv1alpha2.ClusterBinding + err = c.Get(ctx, types.NamespacedName{Namespace: ns, Name: kuberesources.ClusterBindingName}, &cb) switch { case errors.IsNotFound(err): - if err := kuberesources.CreateClusterBinding(ctx, m.bindClient, ns, "kubeconfig", m.providerPrettyName); err != nil { + if err := kuberesources.CreateClusterBinding(ctx, c, ns, "kubeconfig", m.providerPrettyName); err != nil { return nil, err } case err != nil: @@ -146,17 +121,21 @@ func (m *Manager) HandleResources(ctx context.Context, identity, resource, group kubeconfigSecretName = cb.Spec.KubeconfigSecretRef.Name // reuse old name } - sa, err := kuberesources.CreateServiceAccount(ctx, m.kubeClient, ns, kuberesources.ServiceAccountName) + sa, err := kuberesources.CreateServiceAccount(ctx, c, ns, kuberesources.ServiceAccountName) if err != nil { return nil, err } - saSecret, err := kuberesources.CreateSASecret(ctx, m.kubeClient, ns, sa.Name) + if err := kuberesources.EnsureBinderClusterRole(ctx, c); err != nil { + return nil, err + } + + saSecret, err := kuberesources.CreateSASecret(ctx, c, ns, sa.Name) if err != nil { return nil, err } - kfgSecret, err := kuberesources.GenerateKubeconfig(ctx, m.kubeClient, m.clusterConfig, m.externalAddress, m.externalCA, m.externalTLSServerName, saSecret.Name, ns, kubeconfigSecretName) + kfgSecret, err := kuberesources.GenerateKubeconfig(ctx, c, cl.GetConfig(), m.externalAddress, m.externalCA, m.externalTLSServerName, saSecret.Name, ns, kubeconfigSecretName) if err != nil { return nil, err } @@ -164,6 +143,33 @@ func (m *Manager) HandleResources(ctx context.Context, identity, resource, group return kfgSecret.Data["kubeconfig"], nil } -func (m *Manager) ListAPIResourceSchemas(ctx context.Context) (*kubebindv1alpha2.APIResourceSchemaList, error) { - return m.bindClient.KubeBindV1alpha2().APIResourceSchemas().List(ctx, metav1.ListOptions{}) +func (m *Manager) ListAPIResourceSchemas(ctx context.Context, cluster string) (*kubebindv1alpha2.APIResourceSchemaList, error) { + cl, err := m.manager.GetCluster(ctx, cluster) + if err != nil { + return nil, err + } + c := cl.GetClient() + + var schemas kubebindv1alpha2.APIResourceSchemaList + err = c.List(ctx, &schemas) + if err != nil { + return nil, err + } + return &schemas, nil +} + +func (m *Manager) ListCustomResourceDefinitions(ctx context.Context, cluster string, selector labels.Selector) (*apiextensionsv1.CustomResourceDefinitionList, error) { + cl, err := m.manager.GetCluster(ctx, cluster) + if err != nil { + return nil, err + } + c := cl.GetClient() + + var crds apiextensionsv1.CustomResourceDefinitionList + err = c.List(ctx, &crds, client.MatchingLabelsSelector{Selector: selector}) + if err != nil { + return nil, err + } + + return &crds, nil } diff --git a/contrib/example-backend/kubernetes/resources/cluster_binding.go b/contrib/example-backend/kubernetes/resources/cluster_binding.go index 96d805aaa..b95e95e03 100644 --- a/contrib/example-backend/kubernetes/resources/cluster_binding.go +++ b/contrib/example-backend/kubernetes/resources/cluster_binding.go @@ -21,12 +21,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/client" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" - bindclient "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" ) -func CreateClusterBinding(ctx context.Context, client bindclient.Interface, ns, secretName, providerPrettyName string) error { +func CreateClusterBinding(ctx context.Context, client client.Client, ns, secretName, providerPrettyName string) error { logger := klog.FromContext(ctx) clusterBinding := &kubebindv1alpha2.ClusterBinding{ @@ -44,6 +44,6 @@ func CreateClusterBinding(ctx context.Context, client bindclient.Interface, ns, } logger.V(3).Info("Creating ClusterBinding") - _, err := client.KubeBindV1alpha2().ClusterBindings(ns).Create(ctx, clusterBinding, metav1.CreateOptions{}) + err := client.Create(ctx, clusterBinding) return err } diff --git a/contrib/example-backend/kubernetes/resources/kubeconfig.go b/contrib/example-backend/kubernetes/resources/kubeconfig.go index 51c03a66e..b4ff587f2 100644 --- a/contrib/example-backend/kubernetes/resources/kubeconfig.go +++ b/contrib/example-backend/kubernetes/resources/kubeconfig.go @@ -25,17 +25,18 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" "k8s.io/client-go/util/retry" "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/client" ) func GenerateKubeconfig(ctx context.Context, - client kubernetes.Interface, + client client.Client, clusterConfig *rest.Config, externalAddress string, externalCA []byte, @@ -59,10 +60,10 @@ func GenerateKubeconfig(ctx context.Context, } } - var saSecret *corev1.Secret + var saSecret corev1.Secret logger.V(2).Info("Waiting for service account secret to be updated with a token", "name", saSecretName) if err := wait.PollUntilContextTimeout(ctx, 500*time.Millisecond, 10*time.Second, true, func(ctx context.Context) (done bool, err error) { - saSecret, err = client.CoreV1().Secrets(ns).Get(ctx, saSecretName, v1.GetOptions{}) + err = client.Get(ctx, types.NamespacedName{Namespace: ns, Name: saSecretName}, &saSecret) if err != nil && !errors.IsNotFound(err) { return false, err } else if errors.IsNotFound(err) { @@ -112,24 +113,24 @@ func GenerateKubeconfig(ctx context.Context, } logger.V(1).Info("Creating kubeconfig secret", "name", kubeconfigSecretName) - if secret, err := client.CoreV1().Secrets(ns).Create(ctx, kubeconfigSecret, v1.CreateOptions{}); err != nil && !errors.IsAlreadyExists(err) { + if err := client.Create(ctx, kubeconfigSecret); err != nil && !errors.IsAlreadyExists(err) { return nil, err } else if err == nil { - return secret, nil + return kubeconfigSecret, nil } - var updated *corev1.Secret + var existing corev1.Secret if err := retry.RetryOnConflict(retry.DefaultRetry, func() error { - existing, err := client.CoreV1().Secrets(ns).Get(ctx, kubeconfigSecret.Name, v1.GetOptions{}) + err := client.Get(ctx, types.NamespacedName{Namespace: ns, Name: kubeconfigSecret.Name}, &existing) if err != nil { return err } existing.Data = kubeconfigSecret.Data logger.V(1).Info("Updating kubeconfig secret", "name", kubeconfigSecretName) - updated, err = client.CoreV1().Secrets(ns).Update(ctx, existing, v1.UpdateOptions{}) + err = client.Update(ctx, &existing) return err }); err != nil { return nil, err } - return updated, nil + return &existing, nil } diff --git a/contrib/example-backend/kubernetes/resources/namespace.go b/contrib/example-backend/kubernetes/resources/namespace.go index 5d8583e8b..4e3f01a26 100644 --- a/contrib/example-backend/kubernetes/resources/namespace.go +++ b/contrib/example-backend/kubernetes/resources/namespace.go @@ -23,14 +23,15 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" ) const ( IdentityAnnotationKey = "example-backend.kube-bind.io/identity" ) -func CreateNamespace(ctx context.Context, client kubernetes.Interface, generateName, id string) (*corev1.Namespace, error) { +func CreateNamespace(ctx context.Context, client client.Client, generateName, id string) (*corev1.Namespace, error) { if !strings.HasSuffix(generateName, "-") { generateName += "-" } @@ -43,18 +44,18 @@ func CreateNamespace(ctx context.Context, client kubernetes.Interface, generateN }, } - ns, err := client.CoreV1().Namespaces().Create(ctx, namespace, metav1.CreateOptions{}) + err := client.Create(ctx, namespace) if err != nil && !errors.IsAlreadyExists(err) { return nil, err } else if errors.IsAlreadyExists(err) { - ns, err := client.CoreV1().Namespaces().Get(ctx, namespace.Name, metav1.GetOptions{}) + err := client.Get(ctx, types.NamespacedName{Name: namespace.Name}, namespace) if err != nil { return nil, err } - if ns.Annotations[IdentityAnnotationKey] != id { - return nil, errors.NewAlreadyExists(corev1.Resource("namespace"), ns.Name) + if namespace.Annotations[IdentityAnnotationKey] != id { + return nil, errors.NewAlreadyExists(corev1.Resource("namespace"), namespace.Name) } } - return ns, err + return namespace, nil } diff --git a/contrib/example-backend/kubernetes/resources/rbac.go b/contrib/example-backend/kubernetes/resources/rbac.go index 57d8c10da..082e62a2f 100644 --- a/contrib/example-backend/kubernetes/resources/rbac.go +++ b/contrib/example-backend/kubernetes/resources/rbac.go @@ -18,21 +18,25 @@ package resources import ( "context" + "slices" corev1 "k8s.io/api/core/v1" + rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kubeclient "k8s.io/client-go/kubernetes" + "k8s.io/apimachinery/pkg/types" "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/client" ) -func CreateServiceAccount(ctx context.Context, client kubeclient.Interface, ns, name string) (*corev1.ServiceAccount, error) { +func CreateServiceAccount(ctx context.Context, client client.Client, ns, name string) (*corev1.ServiceAccount, error) { logger := klog.FromContext(ctx) - sa, err := client.CoreV1().ServiceAccounts(ns).Get(ctx, name, metav1.GetOptions{}) + var sa corev1.ServiceAccount + err := client.Get(ctx, types.NamespacedName{Namespace: ns, Name: name}, &sa) if err != nil { if errors.IsNotFound(err) { - sa = &corev1.ServiceAccount{ + sa = corev1.ServiceAccount{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: ns, @@ -40,9 +44,140 @@ func CreateServiceAccount(ctx context.Context, client kubeclient.Interface, ns, } logger.Info("Creating service account", "name", sa.Name) - return client.CoreV1().ServiceAccounts(ns).Create(ctx, sa, metav1.CreateOptions{}) + err = client.Create(ctx, &sa) + return &sa, err } } - return sa, err + return &sa, err +} + +// EnsureBinderClusterRole ensures that the binder cluster role is present in the cluster. This runs multiple times on bind. +func EnsureBinderClusterRole(ctx context.Context, client client.Client) error { + logger := klog.FromContext(ctx) + + // Define the ClusterRole rules based on the YAML specification + clusterRole := &rbacv1.ClusterRole{ + ObjectMeta: metav1.ObjectMeta{ + Name: "kube-binder", + }, + Rules: []rbacv1.PolicyRule{ + { + APIGroups: []string{"kube-bind.io"}, + Resources: []string{"apiserviceexportrequests"}, + Verbs: []string{"create", "delete", "patch", "update", "get", "list", "watch"}, + }, + { + APIGroups: []string{""}, + Resources: []string{"namespaces"}, + Verbs: []string{"get"}, + }, + { + APIGroups: []string{""}, + Resources: []string{"secrets"}, + Verbs: []string{"get", "watch", "list"}, + }, + { + APIGroups: []string{"kube-bind.io"}, + Resources: []string{"clusterbindings"}, + Verbs: []string{"get", "watch", "list"}, + }, + { + APIGroups: []string{"kube-bind.io"}, + Resources: []string{"clusterbindings/status"}, + Verbs: []string{"get", "patch", "update"}, + }, + { + APIGroups: []string{"kube-bind.io"}, + Resources: []string{"apiserviceexports"}, + Verbs: []string{"get", "watch", "list"}, + }, + { + APIGroups: []string{"kube-bind.io"}, + Resources: []string{"apiserviceexports/status"}, + Verbs: []string{"get", "patch", "update"}, + }, + { + APIGroups: []string{"kube-bind.io"}, + Resources: []string{"apiservicenamespaces"}, + Verbs: []string{"create", "delete", "patch", "update", "get", "list", "watch"}, + }, + { + APIGroups: []string{"kube-bind.io"}, + Resources: []string{"apiresourceschemas"}, + Verbs: []string{"create", "delete", "patch", "update", "get", "list", "watch"}, + }, + { + APIGroups: []string{"kube-bind.io"}, + Resources: []string{"apiresourceschemas/status"}, + Verbs: []string{"get", "patch", "update"}, + }, + { + APIGroups: []string{"kube-bind.io"}, + Resources: []string{"boundapiresourceschemas"}, + Verbs: []string{"create", "delete", "patch", "update", "get", "list", "watch"}, + }, + { + APIGroups: []string{"kube-bind.io"}, + Resources: []string{"boundapiresourceschemas/status"}, + Verbs: []string{"get", "patch", "update"}, + }, + }, + } + + // Try to get existing ClusterRole + var existing rbacv1.ClusterRole + err := client.Get(ctx, types.NamespacedName{Name: "kube-binder"}, &existing) + if err != nil { + if errors.IsNotFound(err) { + // Create new ClusterRole + logger.Info("Creating kube-binder ClusterRole") + return client.Create(ctx, clusterRole) + } + return err + } + + // Update existing ClusterRole if rules have changed + if !rulesEqual(existing.Rules, clusterRole.Rules) { + logger.Info("Updating kube-binder ClusterRole") + existing.Rules = clusterRole.Rules + return client.Update(ctx, &existing) + } + + logger.V(2).Info("kube-binder ClusterRole already exists and is up to date") + return nil +} + +// rulesEqual compares two PolicyRule slices for equality. +func rulesEqual(a, b []rbacv1.PolicyRule) bool { + if len(a) != len(b) { + return false + } + + for i := range a { + if !policyRuleEqual(a[i], b[i]) { + return false + } + } + return true +} + +// policyRuleEqual compares two PolicyRule structs for equality. +func policyRuleEqual(a, b rbacv1.PolicyRule) bool { + if !slices.Equal(a.APIGroups, b.APIGroups) { + return false + } + if !slices.Equal(a.Resources, b.Resources) { + return false + } + if !slices.Equal(a.Verbs, b.Verbs) { + return false + } + if !slices.Equal(a.ResourceNames, b.ResourceNames) { + return false + } + if !slices.Equal(a.NonResourceURLs, b.NonResourceURLs) { + return false + } + return true } diff --git a/contrib/example-backend/kubernetes/resources/secret.go b/contrib/example-backend/kubernetes/resources/secret.go index c605ddde1..0cdf25a8b 100644 --- a/contrib/example-backend/kubernetes/resources/secret.go +++ b/contrib/example-backend/kubernetes/resources/secret.go @@ -22,17 +22,19 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes" + "k8s.io/apimachinery/pkg/types" "k8s.io/klog/v2" + "sigs.k8s.io/controller-runtime/pkg/client" ) -func CreateSASecret(ctx context.Context, client kubernetes.Interface, ns, saName string) (*corev1.Secret, error) { +func CreateSASecret(ctx context.Context, client client.Client, ns, saName string) (*corev1.Secret, error) { logger := klog.FromContext(ctx) - secret, err := client.CoreV1().Secrets(ns).Get(ctx, saName, metav1.GetOptions{}) + var secret corev1.Secret + err := client.Get(ctx, types.NamespacedName{Namespace: ns, Name: saName}, &secret) if err != nil { if errors.IsNotFound(err) { - secret = &corev1.Secret{ + secret = corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: saName, Namespace: ns, @@ -44,11 +46,12 @@ func CreateSASecret(ctx context.Context, client kubernetes.Interface, ns, saName } logger.V(1).Info("Creating service account secret", "name", secret.Name) - return client.CoreV1().Secrets(ns).Create(ctx, secret, metav1.CreateOptions{}) + err = client.Create(ctx, &secret) + return &secret, err } return nil, err } - return secret, nil + return &secret, nil } diff --git a/contrib/example-backend/options/options.go b/contrib/example-backend/options/options.go index 1f5b5f00b..64fd26ba6 100644 --- a/contrib/example-backend/options/options.go +++ b/contrib/example-backend/options/options.go @@ -23,6 +23,7 @@ import ( "strings" "github.com/spf13/pflag" + "k8s.io/apimachinery/pkg/util/sets" "k8s.io/component-base/logs" logsv1 "k8s.io/component-base/logs/api/v1" @@ -40,6 +41,8 @@ type Options struct { type ExtraOptions struct { KubeConfig string + Provider string + NamespacePrefix string PrettyName string ConsumerScope string @@ -49,7 +52,8 @@ type ExtraOptions struct { ExternalCA []byte TLSExternalServerName string - TestingAutoSelect string + TestingAutoSelect string + TestingSkipNameValidation bool } type completedOptions struct { @@ -77,6 +81,7 @@ func NewOptions() *Options { Serve: NewServe(), ExtraOptions: ExtraOptions{ + Provider: "kubernetes", NamespacePrefix: "cluster", PrettyName: "Example Backend", ConsumerScope: string(kubebindv1alpha2.NamespacedScope), @@ -85,6 +90,12 @@ func NewOptions() *Options { } } +var providerAliases = map[string]string{ + "kcp": "kcp", + "kubernetes": "kubernetes", + "": "kubernetes", +} + func (options *Options) AddFlags(fs *pflag.FlagSet) { logsv1.AddFlags(options.Logs, fs) options.OIDC.AddFlags(fs) @@ -100,6 +111,10 @@ func (options *Options) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&options.ExternalCAFile, "external-ca-file", options.ExternalCAFile, "The external CA file for the service provider cluster. If not specified, service account's CA is used.") fs.StringVar(&options.TLSExternalServerName, "external-server-name", options.TLSExternalServerName, "The external (TLS) server name used by consumers to talk to the service provider cluster. This can be useful to select the right certificate via SNI.") + fs.StringVar(&options.Provider, "multicluster-runtime-provider", options.Provider, + fmt.Sprintf("The multicluster runtime provider. Possible values are: %v", sets.List(sets.Set[string](sets.StringKeySet(providerAliases)))), + ) + fs.StringVar(&options.TestingAutoSelect, "testing-auto-select", options.TestingAutoSelect, ". that is automatically selected on th bind screen for testing") fs.MarkHidden("testing-auto-select") //nolint:errcheck } @@ -141,7 +156,6 @@ func (options *Options) Complete() (*CompletedOptions, error) { } options.ExternalCA = ca } - return &CompletedOptions{ completedOptions: &completedOptions{ Logs: options.Logs, @@ -181,5 +195,11 @@ func (options *CompletedOptions) Validate() error { } } + provider := providerAliases[options.Provider] + if provider == "" { + return fmt.Errorf("unknown provider %q, must be one of %v", options.Provider, sets.List(sets.Set[string](sets.StringKeySet(providerAliases)))) + } + options.Provider = provider + return nil } diff --git a/contrib/example-backend/server.go b/contrib/example-backend/server.go index 880632681..5040a1f60 100644 --- a/contrib/example-backend/server.go +++ b/contrib/example-backend/server.go @@ -24,21 +24,18 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/client-go/dynamic" clientgoscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/klog/v2" "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/config" - "sigs.k8s.io/controller-runtime/pkg/manager" metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" + mcmanager "sigs.k8s.io/multicluster-runtime/pkg/manager" "github.com/kube-bind/kube-bind/contrib/example-backend/controllers/clusterbinding" "github.com/kube-bind/kube-bind/contrib/example-backend/controllers/serviceexport" "github.com/kube-bind/kube-bind/contrib/example-backend/controllers/serviceexportrequest" "github.com/kube-bind/kube-bind/contrib/example-backend/controllers/servicenamespace" - "github.com/kube-bind/kube-bind/contrib/example-backend/deploy" examplehttp "github.com/kube-bind/kube-bind/contrib/example-backend/http" examplekube "github.com/kube-bind/kube-bind/contrib/example-backend/kubernetes" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" @@ -50,7 +47,7 @@ type Server struct { OIDC *examplehttp.OIDCServiceProvider Kubernetes *examplekube.Manager WebServer *examplehttp.Server - Manager manager.Manager + Manager mcmanager.Manager Controllers } @@ -74,6 +71,33 @@ func NewServer(ctx context.Context, c *Config) (*Server, error) { return nil, fmt.Errorf("error setting up HTTP Server: %w", err) } + // Set up controller-runtime manager + scheme := runtime.NewScheme() + if err := clientgoscheme.AddToScheme(scheme); err != nil { + return nil, fmt.Errorf("error adding client-go scheme: %w", err) + } + if err := apiextensionsv1.AddToScheme(scheme); err != nil { + return nil, fmt.Errorf("error adding apiextensions scheme: %w", err) + } + if err := kubebindv1alpha2.AddToScheme(scheme); err != nil { + return nil, fmt.Errorf("error adding kubebind scheme: %w", err) + } + + opts := ctrl.Options{ + Controller: config.Controller{ + SkipNameValidation: ptr.To(c.Options.ExtraOptions.TestingSkipNameValidation), + }, + Metrics: metricsserver.Options{ + BindAddress: "0", + }, + Scheme: scheme, + } + + s.Manager, err = mcmanager.New(s.Config.ClientConfig, s.Config.Provider, opts) + if err != nil { + return nil, fmt.Errorf("error setting up controller manager: %w", err) + } + // setup oidc backend callback := c.Options.OIDC.CallbackURL if callback == "" { @@ -89,14 +113,13 @@ func NewServer(ctx context.Context, c *Config) (*Server, error) { return nil, fmt.Errorf("error setting up OIDC: %w", err) } s.Kubernetes, err = examplekube.NewKubernetesManager( + ctx, c.Options.NamespacePrefix, c.Options.PrettyName, - c.ClientConfig, c.Options.ExternalAddress, c.Options.ExternalCA, c.Options.TLSExternalServerName, - c.KubeInformers.Core().V1().Namespaces(), - c.BindInformers.KubeBind().V1alpha2().APIServiceExports(), + s.Manager, ) if err != nil { return nil, fmt.Errorf("error setting up Kubernetes Manager: %w", err) @@ -126,45 +149,17 @@ func NewServer(ctx context.Context, c *Config) (*Server, error) { encryptionKey, kubebindv1alpha2.InformerScope(c.Options.ConsumerScope), s.Kubernetes, - c.ApiextensionsInformers.Apiextensions().V1().CustomResourceDefinitions().Lister(), ) if err != nil { return nil, fmt.Errorf("error setting up HTTP Handler: %w", err) } handler.AddRoutes(s.WebServer.Router) - // Set up controller-runtime manager - scheme := runtime.NewScheme() - if err := clientgoscheme.AddToScheme(scheme); err != nil { - return nil, fmt.Errorf("error adding client-go scheme: %w", err) - } - if err := apiextensionsv1.AddToScheme(scheme); err != nil { - return nil, fmt.Errorf("error adding apiextensions scheme: %w", err) - } - if err := kubebindv1alpha2.AddToScheme(scheme); err != nil { - return nil, fmt.Errorf("error adding kubebind scheme: %w", err) - } - - s.Manager, err = ctrl.NewManager(c.ClientConfig, ctrl.Options{ - Controller: config.Controller{ - SkipNameValidation: ptr.To(true), // TODO(mjudeikis): Currently tests are setting came controller many times. Refactor this in follow up. - }, - Metrics: metricsserver.Options{ - BindAddress: "0", - }, - Scheme: scheme, - }) - if err != nil { - return nil, fmt.Errorf("error setting up controller manager: %w", err) - } - // construct controllers s.ClusterBinding, err = clusterbinding.NewClusterBindingReconciler( - s.Manager.GetClient(), - s.Manager.GetScheme(), + s.Manager, c.ClientConfig, kubebindv1alpha2.InformerScope(c.Options.ConsumerScope), - s.Manager.GetCache(), ) if err != nil { return nil, fmt.Errorf("error setting up ClusterBinding Controller: %w", err) @@ -175,13 +170,11 @@ func NewServer(ctx context.Context, c *Config) (*Server, error) { return nil, fmt.Errorf("error setting up ClusterBinding controller with manager: %w", err) } - // construct APIServiceExport controller with controller-runtime + // construct APIServiceExport controller with multicluster-runtime s.ServiceExport, err = serviceexport.NewAPIServiceExportReconciler( ctx, - s.Manager.GetClient(), - s.Manager.GetScheme(), + s.Manager, c.ClientConfig, - s.Manager.GetCache(), ) if err != nil { return nil, fmt.Errorf("error setting up APIServiceExport Controller: %w", err) @@ -194,10 +187,8 @@ func NewServer(ctx context.Context, c *Config) (*Server, error) { s.ServiceNamespace, err = servicenamespace.NewAPIServiceNamespaceReconciler( ctx, - s.Manager.GetClient(), - s.Manager.GetScheme(), + s.Manager, c.ClientConfig, - s.Manager.GetCache(), kubebindv1alpha2.InformerScope(c.Options.ConsumerScope), kubebindv1alpha2.Isolation(c.Options.ClusterScopedIsolation), ) @@ -211,10 +202,8 @@ func NewServer(ctx context.Context, c *Config) (*Server, error) { } s.ServiceExportRequest, err = serviceexportrequest.NewAPIServiceExportRequestReconciler( ctx, - s.Manager.GetClient(), - s.Manager.GetScheme(), + s.Manager, c.ClientConfig, - s.Manager.GetCache(), kubebindv1alpha2.InformerScope(c.Options.ConsumerScope), kubebindv1alpha2.Isolation(c.Options.ClusterScopedIsolation), ) @@ -230,39 +219,12 @@ func NewServer(ctx context.Context, c *Config) (*Server, error) { return s, nil } -func (s *Server) OptionallyStartInformers(ctx context.Context) { - logger := klog.FromContext(ctx) - - // start informer factories - logger.Info("starting informers") - s.Config.KubeInformers.Start(ctx.Done()) - s.Config.BindInformers.Start(ctx.Done()) - s.Config.ApiextensionsInformers.Start(ctx.Done()) - kubeSynced := s.Config.KubeInformers.WaitForCacheSync(ctx.Done()) - kubeBindSynced := s.Config.BindInformers.WaitForCacheSync(ctx.Done()) - apiextensionsSynced := s.Config.ApiextensionsInformers.WaitForCacheSync(ctx.Done()) - - logger.Info("local informers are synced", - "kubeSynced", fmt.Sprintf("%v", kubeSynced), - "kubeBindSynced", fmt.Sprintf("%v", kubeBindSynced), - "apiextensionsSynced", fmt.Sprintf("%v", apiextensionsSynced), - ) -} - func (s *Server) Addr() net.Addr { return s.WebServer.Addr() } func (s *Server) Run(ctx context.Context) error { logger := klog.FromContext(ctx) - dynamicClient, err := dynamic.NewForConfig(s.Config.ClientConfig) - if err != nil { - return err - } - - if err := deploy.Bootstrap(ctx, s.Config.KubeClient.Discovery(), dynamicClient, sets.Set[string]{}); err != nil { - return err - } // start controller-runtime manager after bootstrap completes go func() { diff --git a/contrib/example-backend/template/resources.gohtml b/contrib/example-backend/template/resources.gohtml index fb8321c1e..4d395ee80 100644 --- a/contrib/example-backend/template/resources.gohtml +++ b/contrib/example-backend/template/resources.gohtml @@ -21,7 +21,7 @@
  • Scope: {{.Spec.Scope}}
  • - Bind + Bind
    {{end}} @@ -36,7 +36,7 @@
  • Scope: {{.Spec.Scope}}
  • - Bind + Bind
    {{end}} diff --git a/deploy/konnector/90-deployment.yaml b/deploy/konnector/90-deployment.yaml index b7abc20c0..f01629822 100644 --- a/deploy/konnector/90-deployment.yaml +++ b/deploy/konnector/90-deployment.yaml @@ -32,4 +32,4 @@ spec: readinessProbe: httpGet: path: "/healthz" - port: 8080 + port: 8090 diff --git a/docs/content/setup/quickstart.md b/docs/content/setup/quickstart.md index b59d253af..17147c244 100644 --- a/docs/content/setup/quickstart.md +++ b/docs/content/setup/quickstart.md @@ -49,13 +49,19 @@ and that you have at least one k8s cluster. Take a look at the backend option in Create copy of kcp kubeconfig and create provider cluster: ```shell -$ cp .kcp/admin.kubeconfig .kcp/provider.kubeconfig -$ export KUBECONFIG=.kcp/provider.kubeconfig -$ kubectl ws create provider --enter +cp .kcp/admin.kubeconfig .kcp/provider.kubeconfig +export KUBECONFIG=.kcp/provider.kubeconfig +kubectl ws create provider --enter ``` * apply the CRDs: `kubectl apply -f deploy/crd` * In order to populate binding list on website, we need a CRD with label `kube-bind.io/exported: true`. Apply example APIResourceSchema for the CRD: `kubectl apply -f deploy/examples/crd-mangodb.yaml` + +```shell +kubectl apply -f deploy/crd +kubectl apply -f deploy/examples/crd-mangodb.yaml +``` + * start the backend binary with the right flags: ```shell $ make build @@ -95,7 +101,7 @@ Now create the APIServiceExportRequest: $ ./bin/kubectl-bind http://127.0.0.1:8080/export --dry-run -o yaml > apiserviceexport.yaml # This will wait for konnector to be ready. Once this gets running - start the konnector bellow # IMPORTANT: Check namespace to be used! -$ ./bin/kubectl-bind apiservice --remote-namespace kube-bind-tf92m --remote-kubeconfig .kcp/provider.kubeconfig -f apiserviceexport.yaml --skip-konnector +$ ./bin/kubectl-bind apiservice --remote-kubeconfig .kcp/provider.kubeconfig -f apiserviceexport.yaml --skip-konnector --remote-namespace # run konnector $ go run ./cmd/konnector/ --lease-namespace default ``` diff --git a/docs/generators/cli-doc/go.mod b/docs/generators/cli-doc/go.mod index 377034b8d..3fdc52189 100644 --- a/docs/generators/cli-doc/go.mod +++ b/docs/generators/cli-doc/go.mod @@ -1,6 +1,6 @@ module github.com/kube-bind/kube-bind/docs/generators/cli-doc -go 1.23.4 +go 1.24.0 replace ( github.com/kube-bind/kube-bind => ../../../ @@ -19,7 +19,6 @@ require ( github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect @@ -41,10 +40,9 @@ require ( 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.22.1 // indirect + github.com/google/cel-go v0.23.2 // indirect github.com/google/gnostic-models v0.6.9 // indirect github.com/google/go-cmp v0.7.0 // indirect - github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect @@ -53,7 +51,6 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.11 // indirect github.com/kube-bind/kube-bind v0.4.8 // indirect github.com/kube-bind/kube-bind/sdk/apis v0.4.8 // indirect github.com/kube-bind/kube-bind/sdk/client v0.4.8 // indirect @@ -73,9 +70,9 @@ require ( github.com/onsi/gomega v1.36.2 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_golang v1.22.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.61.0 // indirect + github.com/prometheus/common v0.62.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/spf13/cobra v1.9.1 // indirect @@ -83,9 +80,9 @@ require ( github.com/stoewer/go-strcase v1.3.0 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xlab/treeprint v1.2.0 // indirect - go.etcd.io/etcd/api/v3 v3.5.17 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.17 // indirect - go.etcd.io/etcd/client/v3 v3.5.17 // indirect + go.etcd.io/etcd/api/v3 v3.5.21 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.21 // indirect + go.etcd.io/etcd/client/v3 v3.5.21 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect @@ -110,25 +107,26 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 // indirect google.golang.org/grpc v1.69.2 // indirect - google.golang.org/protobuf v1.36.2 // indirect + google.golang.org/protobuf v1.36.5 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.32.3 // indirect - k8s.io/apiextensions-apiserver v0.32.3 // indirect - k8s.io/apimachinery v0.32.3 // indirect - k8s.io/apiserver v0.32.3 // indirect + k8s.io/api v0.33.0 // indirect + k8s.io/apiextensions-apiserver v0.33.0 // indirect + k8s.io/apimachinery v0.33.0 // indirect + k8s.io/apiserver v0.33.0 // indirect k8s.io/cli-runtime v0.32.0 // indirect - k8s.io/client-go v0.32.3 // indirect - k8s.io/component-base v0.32.3 // indirect + k8s.io/client-go v0.33.0 // indirect + k8s.io/component-base v0.33.0 // indirect k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 // indirect + k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect k8s.io/utils v0.0.0-20241210054802-24370beab758 // indirect rsc.io/qr v0.2.0 // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1 // indirect + sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect sigs.k8s.io/kustomize/api v0.18.0 // indirect sigs.k8s.io/kustomize/kyaml v0.18.1 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/docs/generators/cli-doc/go.sum b/docs/generators/cli-doc/go.sum index 52bb25227..873bcc788 100644 --- a/docs/generators/cli-doc/go.sum +++ b/docs/generators/cli-doc/go.sum @@ -8,8 +8,6 @@ github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cq github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= @@ -61,30 +59,28 @@ github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= 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/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI= +github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= 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.22.1 h1:AfVXx3chM2qwoSbM7Da8g8hX8OVSkBFwX+rz2+PcK40= -github.com/google/cel-go v0.22.1/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8= +github.com/google/cel-go v0.23.2 h1:UdEe3CvQh3Nv+E/j9r1Y//WO0K0cSyD7/y0bzyLIMI4= +github.com/google/cel-go v0.23.2/go.mod h1:52Pb6QsDbC5kvgxvZhiL9QX1oZEkcUF/ZqaPx1J5Wwo= github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= 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.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +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/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= @@ -107,8 +103,8 @@ github.com/kcp-dev/kcp v0.26.1 h1:64i6gB5KMnbtuH+Ae9t5rVGgZZ+lMb5w4IYpc4VoIvs= github.com/kcp-dev/kcp v0.26.1/go.mod h1:8RwbIysrwQXYq1vfWjoGQkqCMwLe6cEJMGUBnIdMLuQ= 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.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= -github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -154,12 +150,12 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= -github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= +github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ= -github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -204,20 +200,20 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0= go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I= -go.etcd.io/etcd/api/v3 v3.5.17 h1:cQB8eb8bxwuxOilBpMJAEo8fAONyrdXTHUNcMd8yT1w= -go.etcd.io/etcd/api/v3 v3.5.17/go.mod h1:d1hvkRuXkts6PmaYk2Vrgqbv7H4ADfAKhyJqHNLJCB4= -go.etcd.io/etcd/client/pkg/v3 v3.5.17 h1:XxnDXAWq2pnxqx76ljWwiQ9jylbpC4rvkAeRVOUKKVw= -go.etcd.io/etcd/client/pkg/v3 v3.5.17/go.mod h1:4DqK1TKacp/86nJk4FLQqo6Mn2vvQFBmruW3pP14H/w= -go.etcd.io/etcd/client/v2 v2.305.16 h1:kQrn9o5czVNaukf2A2At43cE9ZtWauOtf9vRZuiKXow= -go.etcd.io/etcd/client/v2 v2.305.16/go.mod h1:h9YxWCzcdvZENbfzBTFCnoNumr2ax3F19sKMqHFmXHE= -go.etcd.io/etcd/client/v3 v3.5.17 h1:o48sINNeWz5+pjy/Z0+HKpj/xSnBkuVhVvXkjEXbqZY= -go.etcd.io/etcd/client/v3 v3.5.17/go.mod h1:j2d4eXTHWkT2ClBgnnEPm/Wuu7jsqku41v9DZ3OtjQo= -go.etcd.io/etcd/pkg/v3 v3.5.16 h1:cnavs5WSPWeK4TYwPYfmcr3Joz9BH+TZ6qoUtz6/+mc= -go.etcd.io/etcd/pkg/v3 v3.5.16/go.mod h1:+lutCZHG5MBBFI/U4eYT5yL7sJfnexsoM20Y0t2uNuY= -go.etcd.io/etcd/raft/v3 v3.5.16 h1:zBXA3ZUpYs1AwiLGPafYAKKl/CORn/uaxYDwlNwndAk= -go.etcd.io/etcd/raft/v3 v3.5.16/go.mod h1:P4UP14AxofMJ/54boWilabqqWoW9eLodl6I5GdGzazI= -go.etcd.io/etcd/server/v3 v3.5.16 h1:d0/SAdJ3vVsZvF8IFVb1k8zqMZ+heGcNfft71ul9GWE= -go.etcd.io/etcd/server/v3 v3.5.16/go.mod h1:ynhyZZpdDp1Gq49jkUg5mfkDWZwXnn3eIqCqtJnrD/s= +go.etcd.io/etcd/api/v3 v3.5.21 h1:A6O2/JDb3tvHhiIz3xf9nJ7REHvtEFJJ3veW3FbCnS8= +go.etcd.io/etcd/api/v3 v3.5.21/go.mod h1:c3aH5wcvXv/9dqIw2Y810LDXJfhSYdHQ0vxmP3CCHVY= +go.etcd.io/etcd/client/pkg/v3 v3.5.21 h1:lPBu71Y7osQmzlflM9OfeIV2JlmpBjqBNlLtcoBqUTc= +go.etcd.io/etcd/client/pkg/v3 v3.5.21/go.mod h1:BgqT/IXPjK9NkeSDjbzwsHySX3yIle2+ndz28nVsjUs= +go.etcd.io/etcd/client/v2 v2.305.21 h1:eLiFfexc2mE+pTLz9WwnoEsX5JTTpLCYVivKkmVXIRA= +go.etcd.io/etcd/client/v2 v2.305.21/go.mod h1:OKkn4hlYNf43hpjEM3Ke3aRdUkhSl8xjKjSf8eCq2J8= +go.etcd.io/etcd/client/v3 v3.5.21 h1:T6b1Ow6fNjOLOtM0xSoKNQt1ASPCLWrF9XMHcH9pEyY= +go.etcd.io/etcd/client/v3 v3.5.21/go.mod h1:mFYy67IOqmbRf/kRUvsHixzo3iG+1OF2W2+jVIQRAnU= +go.etcd.io/etcd/pkg/v3 v3.5.21 h1:jUItxeKyrDuVuWhdh0HtjUANwyuzcb7/FAeUfABmQsk= +go.etcd.io/etcd/pkg/v3 v3.5.21/go.mod h1:wpZx8Egv1g4y+N7JAsqi2zoUiBIUWznLjqJbylDjWgU= +go.etcd.io/etcd/raft/v3 v3.5.21 h1:dOmE0mT55dIUsX77TKBLq+RgyumsQuYeiRQnW/ylugk= +go.etcd.io/etcd/raft/v3 v3.5.21/go.mod h1:fmcuY5R2SNkklU4+fKVBQi2biVp5vafMrWUEj4TJ4Cs= +go.etcd.io/etcd/server/v3 v3.5.21 h1:9w0/k12majtgarGmlMVuhwXRI2ob3/d1Ik3X5TKo0yU= +go.etcd.io/etcd/server/v3 v3.5.21/go.mod h1:G1mOzdwuzKT1VRL7SqRchli/qcFrtLBTAQ4lV20sXXo= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 h1:PS8wXpbyaDJQ2VDHHncMe9Vct0Zn1fEjpsjrLxGJoSc= @@ -302,8 +298,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= -google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= -google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -316,39 +312,42 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYs gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls= -k8s.io/api v0.32.3/go.mod h1:2wEDTXADtm/HA7CCMD8D8bK4yuBUptzaRhYcYEEYA3k= -k8s.io/apiextensions-apiserver v0.32.3 h1:4D8vy+9GWerlErCwVIbcQjsWunF9SUGNu7O7hiQTyPY= -k8s.io/apiextensions-apiserver v0.32.3/go.mod h1:8YwcvVRMVzw0r1Stc7XfGAzB/SIVLunqApySV5V7Dss= -k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U= -k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= -k8s.io/apiserver v0.32.3 h1:kOw2KBuHOA+wetX1MkmrxgBr648ksz653j26ESuWNY8= -k8s.io/apiserver v0.32.3/go.mod h1:q1x9B8E/WzShF49wh3ADOh6muSfpmFL0I2t+TG0Zdgc= +k8s.io/api v0.33.0 h1:yTgZVn1XEe6opVpP1FylmNrIFWuDqe2H0V8CT5gxfIU= +k8s.io/api v0.33.0/go.mod h1:CTO61ECK/KU7haa3qq8sarQ0biLq2ju405IZAd9zsiM= +k8s.io/apiextensions-apiserver v0.33.0 h1:d2qpYL7Mngbsc1taA4IjJPRJ9ilnsXIrndH+r9IimOs= +k8s.io/apiextensions-apiserver v0.33.0/go.mod h1:VeJ8u9dEEN+tbETo+lFkwaaZPg6uFKLGj5vyNEwwSzc= +k8s.io/apimachinery v0.33.0 h1:1a6kHrJxb2hs4t8EE5wuR/WxKDwGN1FKH3JvDtA0CIQ= +k8s.io/apimachinery v0.33.0/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= +k8s.io/apiserver v0.33.0 h1:QqcM6c+qEEjkOODHppFXRiw/cE2zP85704YrQ9YaBbc= +k8s.io/apiserver v0.33.0/go.mod h1:EixYOit0YTxt8zrO2kBU7ixAtxFce9gKGq367nFmqI8= k8s.io/cli-runtime v0.32.0 h1:dP+OZqs7zHPpGQMCGAhectbHU2SNCuZtIimRKTv2T1c= k8s.io/cli-runtime v0.32.0/go.mod h1:Mai8ht2+esoDRK5hr861KRy6z0zHsSTYttNVJXgP3YQ= -k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU= -k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY= -k8s.io/component-base v0.32.3 h1:98WJvvMs3QZ2LYHBzvltFSeJjEx7t5+8s71P7M74u8k= -k8s.io/component-base v0.32.3/go.mod h1:LWi9cR+yPAv7cu2X9rZanTiFKB2kHA+JjmhkKjCZRpI= +k8s.io/client-go v0.33.0 h1:UASR0sAYVUzs2kYuKn/ZakZlcs2bEHaizrrHUZg0G98= +k8s.io/client-go v0.33.0/go.mod h1:kGkd+l/gNGg8GYWAPr0xF1rRKvVWvzh9vmZAMXtaKOg= +k8s.io/component-base v0.33.0 h1:Ot4PyJI+0JAD9covDhwLp9UNkUja209OzsJ4FzScBNk= +k8s.io/component-base v0.33.0/go.mod h1:aXYZLbw3kihdkOPMDhWbjGCO6sg+luw554KP51t8qCU= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kms v0.32.3 h1:HhHw5+pRCzEJp3oFFJ1q5W2N6gAI7YkUg4ay4Z0dgwM= -k8s.io/kms v0.32.3/go.mod h1:Bk2evz/Yvk0oVrvm4MvZbgq8BD34Ksxs2SRHn4/UiOM= -k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 h1:hcha5B1kVACrLujCKLbr8XWMxCxzQx42DY8QKYJrDLg= -k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7/go.mod h1:GewRfANuJ70iYzvn+i4lezLDAFzvjxZYK1gn1lWcfas= +k8s.io/kms v0.33.0 h1:fhQSW/vyaWDhMp0vDuO/sLg2RlGZf4F77beSXcB4/eE= +k8s.io/kms v0.33.0/go.mod h1:C1I8mjFFBNzfUZXYt9FZVJ8MJl7ynFbGgZFbBzkBJ3E= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8= k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0= k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/qr v0.2.0 h1:6vBLea5/NRMVTz8V66gipeLycZMl/+UlFmk8DvqQ6WY= rsc.io/qr v0.2.0/go.mod h1:IF+uZjkb9fqyeF/4tlBoynqmQxUoPfWEKh921coOuXs= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1 h1:uOuSLOMBWkJH0TWa9X6l+mj5nZdm6Ay6Bli8HL8rNfk= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/kustomize/api v0.18.0 h1:hTzp67k+3NEVInwz5BHyzc9rGxIauoXferXyjv5lWPo= sigs.k8s.io/kustomize/api v0.18.0/go.mod h1:f8isXnX+8b+SGLHQ6yO4JG1rdkZlvhaCf/uZbLVMb0U= sigs.k8s.io/kustomize/kyaml v0.18.1 h1:WvBo56Wzw3fjS+7vBjN6TeivvpbW9GmRaWZ9CIVmt4E= sigs.k8s.io/kustomize/kyaml v0.18.1/go.mod h1:C3L2BFVU1jgcddNBE1TxuVLgS46TjObMwW5FT9FcjYo= -sigs.k8s.io/structured-merge-diff/v4 v4.5.0 h1:nbCitCK2hfnhyiKo6uf2HxUPTCodY6Qaf85SbDIaMBk= -sigs.k8s.io/structured-merge-diff/v4 v4.5.0/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= +sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +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/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/go.mod b/go.mod index c08d458eb..e961e2776 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kube-bind/kube-bind -go 1.23.4 +go 1.24.0 replace ( github.com/kube-bind/kube-bind => ./ @@ -11,7 +11,7 @@ replace ( ) require ( - github.com/coreos/go-oidc v2.2.1+incompatible + github.com/coreos/go-oidc v2.3.0+incompatible github.com/dexidp/dex/api/v2 v2.1.0 github.com/evanphx/json-patch v5.6.0+incompatible github.com/google/go-cmp v0.7.0 @@ -21,6 +21,7 @@ require ( github.com/kcp-dev/code-generator/v3 v3.0.0-20250707080944-4094fb87e20f github.com/kcp-dev/kcp/pkg/apis v0.11.0 github.com/kcp-dev/kcp/sdk v0.28.0 + github.com/kcp-dev/multicluster-provider v0.1.0 github.com/kube-bind/kube-bind/cli v0.0.0-20250515145715-d9f20e7c840d github.com/kube-bind/kube-bind/sdk/apis v0.4.8 github.com/kube-bind/kube-bind/sdk/client v0.0.0-20250515145715-d9f20e7c840d @@ -33,18 +34,19 @@ require ( golang.org/x/oauth2 v0.29.0 google.golang.org/grpc v1.69.2 gopkg.in/headzoo/surf.v1 v1.0.1 - k8s.io/api v0.32.3 - k8s.io/apiextensions-apiserver v0.32.3 - k8s.io/apimachinery v0.32.3 - k8s.io/apiserver v0.32.3 + k8s.io/api v0.33.0 + k8s.io/apiextensions-apiserver v0.33.0 + k8s.io/apimachinery v0.33.0 + k8s.io/apiserver v0.33.0 k8s.io/cli-runtime v0.32.0 - k8s.io/client-go v0.32.3 - k8s.io/code-generator v0.32.3 - k8s.io/component-base v0.32.3 + k8s.io/client-go v0.33.0 + k8s.io/code-generator v0.33.0 + k8s.io/component-base v0.33.0 k8s.io/klog/v2 v2.130.1 k8s.io/utils v0.0.0-20241210054802-24370beab758 - sigs.k8s.io/controller-runtime v0.19.0 + sigs.k8s.io/controller-runtime v0.21.0 sigs.k8s.io/controller-tools v0.16.1 + sigs.k8s.io/multicluster-runtime v0.21.0-alpha.8 sigs.k8s.io/yaml v1.4.0 ) @@ -67,7 +69,7 @@ require ( github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.12.1 // indirect - github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/evanphx/json-patch/v5 v5.9.11 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/frankban/quicktest v1.14.3 // indirect @@ -84,7 +86,7 @@ require ( 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.22.1 // indirect + github.com/google/cel-go v0.23.2 // indirect github.com/google/gnostic-models v0.6.9 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect @@ -96,8 +98,8 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250512171935-ebb573a40077 // indirect github.com/kcp-dev/logicalcluster/v3 v3.0.5 // indirect - github.com/klauspost/compress v1.17.11 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.9.0 // indirect @@ -114,18 +116,18 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/pquerna/cachecontrol v0.1.0 // indirect - github.com/prometheus/client_golang v1.20.5 // indirect + github.com/prometheus/client_golang v1.22.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.61.0 // indirect + github.com/prometheus/common v0.62.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/vmihailenco/tagparser v0.1.1 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xlab/treeprint v1.2.0 // indirect - go.etcd.io/etcd/api/v3 v3.5.17 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.17 // indirect - go.etcd.io/etcd/client/v3 v3.5.17 // indirect + go.etcd.io/etcd/api/v3 v3.5.21 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.21 // indirect + go.etcd.io/etcd/client/v3 v3.5.21 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect @@ -152,21 +154,34 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 // indirect - google.golang.org/protobuf v1.36.2 // indirect + google.golang.org/protobuf v1.36.5 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect + gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect - k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 // indirect + k8s.io/gengo/v2 v2.0.0-20250207200755-1244d31929d7 // indirect + k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect rsc.io/qr v0.2.0 // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1 // indirect + sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect sigs.k8s.io/kustomize/api v0.18.0 // indirect sigs.k8s.io/kustomize/kyaml v0.18.1 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect ) -// This is needed for update-codegen-clients.sh to pin the version of code-generator. -replace k8s.io/code-generator => k8s.io/code-generator v0.31.0 +// Matches multicluster-runtime v0.21.0-alpha.8 +replace ( + github.com/google/cel-go => github.com/google/cel-go v0.22.0 + k8s.io/api => k8s.io/api v0.32.3 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.32.3 + k8s.io/apimachinery => k8s.io/apimachinery v0.32.3 + k8s.io/apiserver => k8s.io/apiserver v0.32.3 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.32.3 + k8s.io/client-go => k8s.io/client-go v0.32.3 + k8s.io/code-generator => k8s.io/code-generator v0.32.3 + k8s.io/component-base => k8s.io/component-base v0.32.3 + sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.20.4 + sigs.k8s.io/multicluster-runtime => sigs.k8s.io/multicluster-runtime v0.20.4-alpha.7 +) diff --git a/go.sum b/go.sum index 6f3b9f1cc..46fceeda0 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,8 @@ github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK3 github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk= -github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-oidc v2.3.0+incompatible h1:+5vEsrgprdLjjQ9FzIKAzQz1wwPD+83hQRfUIPh7rO0= +github.com/coreos/go-oidc v2.3.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= @@ -44,8 +44,8 @@ github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtz github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= -github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= +github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= @@ -86,8 +86,8 @@ 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.22.1 h1:AfVXx3chM2qwoSbM7Da8g8hX8OVSkBFwX+rz2+PcK40= -github.com/google/cel-go v0.22.1/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8= +github.com/google/cel-go v0.22.0 h1:b3FJZxpiv1vTMo2/5RDUqAHPxkT8mmMfJIrq1llbf7g= +github.com/google/cel-go v0.22.0/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8= github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= @@ -131,6 +131,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= 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/kcp-dev/apimachinery/v2 v2.0.1-0.20250512171935-ebb573a40077 h1:lDi9nZ75ypmRJwDFXUN70Cdu8+HxAjPU1kcnn+l4MvI= +github.com/kcp-dev/apimachinery/v2 v2.0.1-0.20250512171935-ebb573a40077/go.mod h1:jnMZxVnCuKlkIXc4J1Qtmy1Lyo171CDF/RQhNAo0tvA= github.com/kcp-dev/code-generator/v3 v3.0.0-20250707080944-4094fb87e20f h1:Qfpk7+Y5gwWV8FNY6zu+l5hbKWlFZ6oJqgL67RoCEJg= github.com/kcp-dev/code-generator/v3 v3.0.0-20250707080944-4094fb87e20f/go.mod h1:1EZhJqiFvXq1N0xKJnJOf8kQ++wuwLkqFGIRVSoVACk= github.com/kcp-dev/kcp/pkg/apis v0.11.0 h1:K6p+tNHNcvfACCPLcHgY0EMLeaIwR1jS491FyLfXMII= @@ -139,10 +141,12 @@ github.com/kcp-dev/kcp/sdk v0.28.0 h1:AOgGrgpqhrplbXMSbcvjFwCqwg4UlysTwIFZ0LvFxl github.com/kcp-dev/kcp/sdk v0.28.0/go.mod h1:8oZpWxkoMu2TDpx5DgdIGDigByKHKkeqVMA4GiWneoI= github.com/kcp-dev/logicalcluster/v3 v3.0.5 h1:JbYakokb+5Uinz09oTXomSUJVQsqfxEvU4RyHUYxHOU= github.com/kcp-dev/logicalcluster/v3 v3.0.5/go.mod h1:EWBUBxdr49fUB1cLMO4nOdBWmYifLbP1LfoL20KkXYY= +github.com/kcp-dev/multicluster-provider v0.1.0 h1:LS4z4d6AbsYg7Lj9Hlmkbv1M+ZIyw4laNpSsUgF3tRI= +github.com/kcp-dev/multicluster-provider v0.1.0/go.mod h1:8a53s17AhgsEq5mL7VDHZ30eflhu7sFS0isHG1zRz0Y= 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.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= -github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -196,12 +200,12 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pquerna/cachecontrol v0.1.0 h1:yJMy84ti9h/+OEWa752kBTKv4XC30OtVVHYv/8cTqKc= github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= -github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= -github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= +github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ= -github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -249,14 +253,14 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0= go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I= -go.etcd.io/etcd/api/v3 v3.5.17 h1:cQB8eb8bxwuxOilBpMJAEo8fAONyrdXTHUNcMd8yT1w= -go.etcd.io/etcd/api/v3 v3.5.17/go.mod h1:d1hvkRuXkts6PmaYk2Vrgqbv7H4ADfAKhyJqHNLJCB4= -go.etcd.io/etcd/client/pkg/v3 v3.5.17 h1:XxnDXAWq2pnxqx76ljWwiQ9jylbpC4rvkAeRVOUKKVw= -go.etcd.io/etcd/client/pkg/v3 v3.5.17/go.mod h1:4DqK1TKacp/86nJk4FLQqo6Mn2vvQFBmruW3pP14H/w= +go.etcd.io/etcd/api/v3 v3.5.21 h1:A6O2/JDb3tvHhiIz3xf9nJ7REHvtEFJJ3veW3FbCnS8= +go.etcd.io/etcd/api/v3 v3.5.21/go.mod h1:c3aH5wcvXv/9dqIw2Y810LDXJfhSYdHQ0vxmP3CCHVY= +go.etcd.io/etcd/client/pkg/v3 v3.5.21 h1:lPBu71Y7osQmzlflM9OfeIV2JlmpBjqBNlLtcoBqUTc= +go.etcd.io/etcd/client/pkg/v3 v3.5.21/go.mod h1:BgqT/IXPjK9NkeSDjbzwsHySX3yIle2+ndz28nVsjUs= go.etcd.io/etcd/client/v2 v2.305.16 h1:kQrn9o5czVNaukf2A2At43cE9ZtWauOtf9vRZuiKXow= go.etcd.io/etcd/client/v2 v2.305.16/go.mod h1:h9YxWCzcdvZENbfzBTFCnoNumr2ax3F19sKMqHFmXHE= -go.etcd.io/etcd/client/v3 v3.5.17 h1:o48sINNeWz5+pjy/Z0+HKpj/xSnBkuVhVvXkjEXbqZY= -go.etcd.io/etcd/client/v3 v3.5.17/go.mod h1:j2d4eXTHWkT2ClBgnnEPm/Wuu7jsqku41v9DZ3OtjQo= +go.etcd.io/etcd/client/v3 v3.5.21 h1:T6b1Ow6fNjOLOtM0xSoKNQt1ASPCLWrF9XMHcH9pEyY= +go.etcd.io/etcd/client/v3 v3.5.21/go.mod h1:mFYy67IOqmbRf/kRUvsHixzo3iG+1OF2W2+jVIQRAnU= go.etcd.io/etcd/pkg/v3 v3.5.16 h1:cnavs5WSPWeK4TYwPYfmcr3Joz9BH+TZ6qoUtz6/+mc= go.etcd.io/etcd/pkg/v3 v3.5.16/go.mod h1:+lutCZHG5MBBFI/U4eYT5yL7sJfnexsoM20Y0t2uNuY= go.etcd.io/etcd/raft/v3 v3.5.16 h1:zBXA3ZUpYs1AwiLGPafYAKKl/CORn/uaxYDwlNwndAk= @@ -363,8 +367,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= -google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= -google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= @@ -372,14 +376,14 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= +gopkg.in/go-jose/go-jose.v2 v2.6.3 h1:nt80fvSDlhKWQgSWyHyy5CfmlQr+asih51R8PTWNKKs= +gopkg.in/go-jose/go-jose.v2 v2.6.3/go.mod h1:zzZDPkNNw/c9IE7Z9jr11mBZQhKQTMzoEEIoEdZlFBI= gopkg.in/headzoo/surf.v1 v1.0.1 h1:oDBy9b5NlTb2Hvl3hF8NN+Qy7ypC9/g5YDP85pPh13k= gopkg.in/headzoo/surf.v1 v1.0.1/go.mod h1:T0BH8276y+OPL0E4tisxCFjBVIAKGbwdYU7AS7/EpQQ= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= -gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= @@ -395,30 +399,30 @@ k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U= k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= k8s.io/apiserver v0.32.3 h1:kOw2KBuHOA+wetX1MkmrxgBr648ksz653j26ESuWNY8= k8s.io/apiserver v0.32.3/go.mod h1:q1x9B8E/WzShF49wh3ADOh6muSfpmFL0I2t+TG0Zdgc= -k8s.io/cli-runtime v0.32.0 h1:dP+OZqs7zHPpGQMCGAhectbHU2SNCuZtIimRKTv2T1c= -k8s.io/cli-runtime v0.32.0/go.mod h1:Mai8ht2+esoDRK5hr861KRy6z0zHsSTYttNVJXgP3YQ= +k8s.io/cli-runtime v0.32.3 h1:khLF2ivU2T6Q77H97atx3REY9tXiA3OLOjWJxUrdvss= +k8s.io/cli-runtime v0.32.3/go.mod h1:vZT6dZq7mZAca53rwUfdFSZjdtLyfF61mkf/8q+Xjak= k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU= k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY= -k8s.io/code-generator v0.31.0 h1:w607nrMi1KeDKB3/F/J4lIoOgAwc+gV9ZKew4XRfMp8= -k8s.io/code-generator v0.31.0/go.mod h1:84y4w3es8rOJOUUP1rLsIiGlO1JuEaPFXQPA9e/K6U0= +k8s.io/code-generator v0.32.3 h1:31p2TVzC9+hVdSkAFruAk3JY+iSfzrJ83Qij1yZutyw= +k8s.io/code-generator v0.32.3/go.mod h1:+mbiYID5NLsBuqxjQTygKM/DAdKpAjvBzrJd64NU1G8= k8s.io/component-base v0.32.3 h1:98WJvvMs3QZ2LYHBzvltFSeJjEx7t5+8s71P7M74u8k= k8s.io/component-base v0.32.3/go.mod h1:LWi9cR+yPAv7cu2X9rZanTiFKB2kHA+JjmhkKjCZRpI= -k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 h1:si3PfKm8dDYxgfbeA6orqrtLkvvIeH8UqffFJDl0bz4= -k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU= +k8s.io/gengo/v2 v2.0.0-20250207200755-1244d31929d7 h1:2OX19X59HxDprNCVrWi6jb7LW1PoqTlYqEq5H2oetog= +k8s.io/gengo/v2 v2.0.0-20250207200755-1244d31929d7/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kms v0.32.3 h1:HhHw5+pRCzEJp3oFFJ1q5W2N6gAI7YkUg4ay4Z0dgwM= k8s.io/kms v0.32.3/go.mod h1:Bk2evz/Yvk0oVrvm4MvZbgq8BD34Ksxs2SRHn4/UiOM= -k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 h1:hcha5B1kVACrLujCKLbr8XWMxCxzQx42DY8QKYJrDLg= -k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7/go.mod h1:GewRfANuJ70iYzvn+i4lezLDAFzvjxZYK1gn1lWcfas= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8= k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0= k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/qr v0.2.0 h1:6vBLea5/NRMVTz8V66gipeLycZMl/+UlFmk8DvqQ6WY= rsc.io/qr v0.2.0/go.mod h1:IF+uZjkb9fqyeF/4tlBoynqmQxUoPfWEKh921coOuXs= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1 h1:uOuSLOMBWkJH0TWa9X6l+mj5nZdm6Ay6Bli8HL8rNfk= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.1/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q= -sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= +sigs.k8s.io/controller-runtime v0.20.4 h1:X3c+Odnxz+iPTRobG4tp092+CvBU9UK0t/bRf+n0DGU= +sigs.k8s.io/controller-runtime v0.20.4/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY= sigs.k8s.io/controller-tools v0.16.1 h1:gvIsZm+2aimFDIBiDKumR7EBkc+oLxljoUVfRbDI6RI= sigs.k8s.io/controller-tools v0.16.1/go.mod h1:0I0xqjR65YTfoO12iR+mZR6s6UAVcUARgXRlsu0ljB0= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= @@ -427,7 +431,12 @@ sigs.k8s.io/kustomize/api v0.18.0 h1:hTzp67k+3NEVInwz5BHyzc9rGxIauoXferXyjv5lWPo sigs.k8s.io/kustomize/api v0.18.0/go.mod h1:f8isXnX+8b+SGLHQ6yO4JG1rdkZlvhaCf/uZbLVMb0U= sigs.k8s.io/kustomize/kyaml v0.18.1 h1:WvBo56Wzw3fjS+7vBjN6TeivvpbW9GmRaWZ9CIVmt4E= sigs.k8s.io/kustomize/kyaml v0.18.1/go.mod h1:C3L2BFVU1jgcddNBE1TxuVLgS46TjObMwW5FT9FcjYo= -sigs.k8s.io/structured-merge-diff/v4 v4.5.0 h1:nbCitCK2hfnhyiKo6uf2HxUPTCodY6Qaf85SbDIaMBk= -sigs.k8s.io/structured-merge-diff/v4 v4.5.0/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= +sigs.k8s.io/multicluster-runtime v0.20.4-alpha.7 h1:AFlM/TFQaESxtCRX6scodEKensLhcbfGwXfjJIvoaT8= +sigs.k8s.io/multicluster-runtime v0.20.4-alpha.7/go.mod h1:2N2/c3p08bYC9eDaRs0dllTxgAm5xiLDSkmGZpWKyw4= +sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +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/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/pkg/konnector/healthz/server.go b/pkg/konnector/healthz/server.go index 5865d236b..c8cec44d8 100644 --- a/pkg/konnector/healthz/server.go +++ b/pkg/konnector/healthz/server.go @@ -26,7 +26,7 @@ import ( "k8s.io/klog/v2" ) -const listenAddr = ":8080" +const listenAddr = ":8090" type Server struct { Router *mux.Router diff --git a/sdk/client/clientset/versioned/clientset.go b/sdk/client/clientset/versioned/clientset.go index cceba1e28..a8ecfae67 100644 --- a/sdk/client/clientset/versioned/clientset.go +++ b/sdk/client/clientset/versioned/clientset.go @@ -19,8 +19,8 @@ limitations under the License. package versioned import ( - "fmt" - "net/http" + fmt "fmt" + http "net/http" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiservicebinding.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiservicebinding.go index fcf69c3a1..5e583e705 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiservicebinding.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiservicebinding.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) @@ -38,33 +38,34 @@ type APIServiceBindingsGetter interface { // APIServiceBindingInterface has methods to work with APIServiceBinding resources. type APIServiceBindingInterface interface { - Create(ctx context.Context, aPIServiceBinding *v1alpha1.APIServiceBinding, opts v1.CreateOptions) (*v1alpha1.APIServiceBinding, error) - Update(ctx context.Context, aPIServiceBinding *v1alpha1.APIServiceBinding, opts v1.UpdateOptions) (*v1alpha1.APIServiceBinding, error) + Create(ctx context.Context, aPIServiceBinding *kubebindv1alpha1.APIServiceBinding, opts v1.CreateOptions) (*kubebindv1alpha1.APIServiceBinding, error) + Update(ctx context.Context, aPIServiceBinding *kubebindv1alpha1.APIServiceBinding, opts v1.UpdateOptions) (*kubebindv1alpha1.APIServiceBinding, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, aPIServiceBinding *v1alpha1.APIServiceBinding, opts v1.UpdateOptions) (*v1alpha1.APIServiceBinding, error) + UpdateStatus(ctx context.Context, aPIServiceBinding *kubebindv1alpha1.APIServiceBinding, opts v1.UpdateOptions) (*kubebindv1alpha1.APIServiceBinding, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.APIServiceBinding, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.APIServiceBindingList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubebindv1alpha1.APIServiceBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*kubebindv1alpha1.APIServiceBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.APIServiceBinding, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubebindv1alpha1.APIServiceBinding, err error) APIServiceBindingExpansion } // aPIServiceBindings implements APIServiceBindingInterface type aPIServiceBindings struct { - *gentype.ClientWithList[*v1alpha1.APIServiceBinding, *v1alpha1.APIServiceBindingList] + *gentype.ClientWithList[*kubebindv1alpha1.APIServiceBinding, *kubebindv1alpha1.APIServiceBindingList] } // newAPIServiceBindings returns a APIServiceBindings func newAPIServiceBindings(c *KubeBindV1alpha1Client) *aPIServiceBindings { return &aPIServiceBindings{ - gentype.NewClientWithList[*v1alpha1.APIServiceBinding, *v1alpha1.APIServiceBindingList]( + gentype.NewClientWithList[*kubebindv1alpha1.APIServiceBinding, *kubebindv1alpha1.APIServiceBindingList]( "apiservicebindings", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1alpha1.APIServiceBinding { return &v1alpha1.APIServiceBinding{} }, - func() *v1alpha1.APIServiceBindingList { return &v1alpha1.APIServiceBindingList{} }), + func() *kubebindv1alpha1.APIServiceBinding { return &kubebindv1alpha1.APIServiceBinding{} }, + func() *kubebindv1alpha1.APIServiceBindingList { return &kubebindv1alpha1.APIServiceBindingList{} }, + ), } } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiserviceexport.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiserviceexport.go index 36b267575..b9d632da5 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiserviceexport.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiserviceexport.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) @@ -38,33 +38,34 @@ type APIServiceExportsGetter interface { // APIServiceExportInterface has methods to work with APIServiceExport resources. type APIServiceExportInterface interface { - Create(ctx context.Context, aPIServiceExport *v1alpha1.APIServiceExport, opts v1.CreateOptions) (*v1alpha1.APIServiceExport, error) - Update(ctx context.Context, aPIServiceExport *v1alpha1.APIServiceExport, opts v1.UpdateOptions) (*v1alpha1.APIServiceExport, error) + Create(ctx context.Context, aPIServiceExport *kubebindv1alpha1.APIServiceExport, opts v1.CreateOptions) (*kubebindv1alpha1.APIServiceExport, error) + Update(ctx context.Context, aPIServiceExport *kubebindv1alpha1.APIServiceExport, opts v1.UpdateOptions) (*kubebindv1alpha1.APIServiceExport, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, aPIServiceExport *v1alpha1.APIServiceExport, opts v1.UpdateOptions) (*v1alpha1.APIServiceExport, error) + UpdateStatus(ctx context.Context, aPIServiceExport *kubebindv1alpha1.APIServiceExport, opts v1.UpdateOptions) (*kubebindv1alpha1.APIServiceExport, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.APIServiceExport, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.APIServiceExportList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubebindv1alpha1.APIServiceExport, error) + List(ctx context.Context, opts v1.ListOptions) (*kubebindv1alpha1.APIServiceExportList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.APIServiceExport, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubebindv1alpha1.APIServiceExport, err error) APIServiceExportExpansion } // aPIServiceExports implements APIServiceExportInterface type aPIServiceExports struct { - *gentype.ClientWithList[*v1alpha1.APIServiceExport, *v1alpha1.APIServiceExportList] + *gentype.ClientWithList[*kubebindv1alpha1.APIServiceExport, *kubebindv1alpha1.APIServiceExportList] } // newAPIServiceExports returns a APIServiceExports func newAPIServiceExports(c *KubeBindV1alpha1Client, namespace string) *aPIServiceExports { return &aPIServiceExports{ - gentype.NewClientWithList[*v1alpha1.APIServiceExport, *v1alpha1.APIServiceExportList]( + gentype.NewClientWithList[*kubebindv1alpha1.APIServiceExport, *kubebindv1alpha1.APIServiceExportList]( "apiserviceexports", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha1.APIServiceExport { return &v1alpha1.APIServiceExport{} }, - func() *v1alpha1.APIServiceExportList { return &v1alpha1.APIServiceExportList{} }), + func() *kubebindv1alpha1.APIServiceExport { return &kubebindv1alpha1.APIServiceExport{} }, + func() *kubebindv1alpha1.APIServiceExportList { return &kubebindv1alpha1.APIServiceExportList{} }, + ), } } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiserviceexportrequest.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiserviceexportrequest.go index 74ec8bb67..e68ee5338 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiserviceexportrequest.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiserviceexportrequest.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) @@ -38,33 +38,36 @@ type APIServiceExportRequestsGetter interface { // APIServiceExportRequestInterface has methods to work with APIServiceExportRequest resources. type APIServiceExportRequestInterface interface { - Create(ctx context.Context, aPIServiceExportRequest *v1alpha1.APIServiceExportRequest, opts v1.CreateOptions) (*v1alpha1.APIServiceExportRequest, error) - Update(ctx context.Context, aPIServiceExportRequest *v1alpha1.APIServiceExportRequest, opts v1.UpdateOptions) (*v1alpha1.APIServiceExportRequest, error) + Create(ctx context.Context, aPIServiceExportRequest *kubebindv1alpha1.APIServiceExportRequest, opts v1.CreateOptions) (*kubebindv1alpha1.APIServiceExportRequest, error) + Update(ctx context.Context, aPIServiceExportRequest *kubebindv1alpha1.APIServiceExportRequest, opts v1.UpdateOptions) (*kubebindv1alpha1.APIServiceExportRequest, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, aPIServiceExportRequest *v1alpha1.APIServiceExportRequest, opts v1.UpdateOptions) (*v1alpha1.APIServiceExportRequest, error) + UpdateStatus(ctx context.Context, aPIServiceExportRequest *kubebindv1alpha1.APIServiceExportRequest, opts v1.UpdateOptions) (*kubebindv1alpha1.APIServiceExportRequest, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.APIServiceExportRequest, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.APIServiceExportRequestList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubebindv1alpha1.APIServiceExportRequest, error) + List(ctx context.Context, opts v1.ListOptions) (*kubebindv1alpha1.APIServiceExportRequestList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.APIServiceExportRequest, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubebindv1alpha1.APIServiceExportRequest, err error) APIServiceExportRequestExpansion } // aPIServiceExportRequests implements APIServiceExportRequestInterface type aPIServiceExportRequests struct { - *gentype.ClientWithList[*v1alpha1.APIServiceExportRequest, *v1alpha1.APIServiceExportRequestList] + *gentype.ClientWithList[*kubebindv1alpha1.APIServiceExportRequest, *kubebindv1alpha1.APIServiceExportRequestList] } // newAPIServiceExportRequests returns a APIServiceExportRequests func newAPIServiceExportRequests(c *KubeBindV1alpha1Client, namespace string) *aPIServiceExportRequests { return &aPIServiceExportRequests{ - gentype.NewClientWithList[*v1alpha1.APIServiceExportRequest, *v1alpha1.APIServiceExportRequestList]( + gentype.NewClientWithList[*kubebindv1alpha1.APIServiceExportRequest, *kubebindv1alpha1.APIServiceExportRequestList]( "apiserviceexportrequests", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha1.APIServiceExportRequest { return &v1alpha1.APIServiceExportRequest{} }, - func() *v1alpha1.APIServiceExportRequestList { return &v1alpha1.APIServiceExportRequestList{} }), + func() *kubebindv1alpha1.APIServiceExportRequest { return &kubebindv1alpha1.APIServiceExportRequest{} }, + func() *kubebindv1alpha1.APIServiceExportRequestList { + return &kubebindv1alpha1.APIServiceExportRequestList{} + }, + ), } } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiservicenamespace.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiservicenamespace.go index 6651043bc..2e23d4477 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiservicenamespace.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/apiservicenamespace.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) @@ -38,33 +38,34 @@ type APIServiceNamespacesGetter interface { // APIServiceNamespaceInterface has methods to work with APIServiceNamespace resources. type APIServiceNamespaceInterface interface { - Create(ctx context.Context, aPIServiceNamespace *v1alpha1.APIServiceNamespace, opts v1.CreateOptions) (*v1alpha1.APIServiceNamespace, error) - Update(ctx context.Context, aPIServiceNamespace *v1alpha1.APIServiceNamespace, opts v1.UpdateOptions) (*v1alpha1.APIServiceNamespace, error) + Create(ctx context.Context, aPIServiceNamespace *kubebindv1alpha1.APIServiceNamespace, opts v1.CreateOptions) (*kubebindv1alpha1.APIServiceNamespace, error) + Update(ctx context.Context, aPIServiceNamespace *kubebindv1alpha1.APIServiceNamespace, opts v1.UpdateOptions) (*kubebindv1alpha1.APIServiceNamespace, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, aPIServiceNamespace *v1alpha1.APIServiceNamespace, opts v1.UpdateOptions) (*v1alpha1.APIServiceNamespace, error) + UpdateStatus(ctx context.Context, aPIServiceNamespace *kubebindv1alpha1.APIServiceNamespace, opts v1.UpdateOptions) (*kubebindv1alpha1.APIServiceNamespace, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.APIServiceNamespace, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.APIServiceNamespaceList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubebindv1alpha1.APIServiceNamespace, error) + List(ctx context.Context, opts v1.ListOptions) (*kubebindv1alpha1.APIServiceNamespaceList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.APIServiceNamespace, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubebindv1alpha1.APIServiceNamespace, err error) APIServiceNamespaceExpansion } // aPIServiceNamespaces implements APIServiceNamespaceInterface type aPIServiceNamespaces struct { - *gentype.ClientWithList[*v1alpha1.APIServiceNamespace, *v1alpha1.APIServiceNamespaceList] + *gentype.ClientWithList[*kubebindv1alpha1.APIServiceNamespace, *kubebindv1alpha1.APIServiceNamespaceList] } // newAPIServiceNamespaces returns a APIServiceNamespaces func newAPIServiceNamespaces(c *KubeBindV1alpha1Client, namespace string) *aPIServiceNamespaces { return &aPIServiceNamespaces{ - gentype.NewClientWithList[*v1alpha1.APIServiceNamespace, *v1alpha1.APIServiceNamespaceList]( + gentype.NewClientWithList[*kubebindv1alpha1.APIServiceNamespace, *kubebindv1alpha1.APIServiceNamespaceList]( "apiservicenamespaces", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha1.APIServiceNamespace { return &v1alpha1.APIServiceNamespace{} }, - func() *v1alpha1.APIServiceNamespaceList { return &v1alpha1.APIServiceNamespaceList{} }), + func() *kubebindv1alpha1.APIServiceNamespace { return &kubebindv1alpha1.APIServiceNamespace{} }, + func() *kubebindv1alpha1.APIServiceNamespaceList { return &kubebindv1alpha1.APIServiceNamespaceList{} }, + ), } } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/clusterbinding.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/clusterbinding.go index 89c3091a2..40b7f6c0d 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/clusterbinding.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/clusterbinding.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) @@ -38,33 +38,34 @@ type ClusterBindingsGetter interface { // ClusterBindingInterface has methods to work with ClusterBinding resources. type ClusterBindingInterface interface { - Create(ctx context.Context, clusterBinding *v1alpha1.ClusterBinding, opts v1.CreateOptions) (*v1alpha1.ClusterBinding, error) - Update(ctx context.Context, clusterBinding *v1alpha1.ClusterBinding, opts v1.UpdateOptions) (*v1alpha1.ClusterBinding, error) + Create(ctx context.Context, clusterBinding *kubebindv1alpha1.ClusterBinding, opts v1.CreateOptions) (*kubebindv1alpha1.ClusterBinding, error) + Update(ctx context.Context, clusterBinding *kubebindv1alpha1.ClusterBinding, opts v1.UpdateOptions) (*kubebindv1alpha1.ClusterBinding, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, clusterBinding *v1alpha1.ClusterBinding, opts v1.UpdateOptions) (*v1alpha1.ClusterBinding, error) + UpdateStatus(ctx context.Context, clusterBinding *kubebindv1alpha1.ClusterBinding, opts v1.UpdateOptions) (*kubebindv1alpha1.ClusterBinding, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterBinding, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterBindingList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubebindv1alpha1.ClusterBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*kubebindv1alpha1.ClusterBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterBinding, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubebindv1alpha1.ClusterBinding, err error) ClusterBindingExpansion } // clusterBindings implements ClusterBindingInterface type clusterBindings struct { - *gentype.ClientWithList[*v1alpha1.ClusterBinding, *v1alpha1.ClusterBindingList] + *gentype.ClientWithList[*kubebindv1alpha1.ClusterBinding, *kubebindv1alpha1.ClusterBindingList] } // newClusterBindings returns a ClusterBindings func newClusterBindings(c *KubeBindV1alpha1Client, namespace string) *clusterBindings { return &clusterBindings{ - gentype.NewClientWithList[*v1alpha1.ClusterBinding, *v1alpha1.ClusterBindingList]( + gentype.NewClientWithList[*kubebindv1alpha1.ClusterBinding, *kubebindv1alpha1.ClusterBindingList]( "clusterbindings", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha1.ClusterBinding { return &v1alpha1.ClusterBinding{} }, - func() *v1alpha1.ClusterBindingList { return &v1alpha1.ClusterBindingList{} }), + func() *kubebindv1alpha1.ClusterBinding { return &kubebindv1alpha1.ClusterBinding{} }, + func() *kubebindv1alpha1.ClusterBindingList { return &kubebindv1alpha1.ClusterBindingList{} }, + ), } } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicebinding.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicebinding.go index 868ee9463..7b23d1ba8 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicebinding.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicebinding.go @@ -19,121 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/typed/kubebind/v1alpha1" ) -// FakeAPIServiceBindings implements APIServiceBindingInterface -type FakeAPIServiceBindings struct { +// fakeAPIServiceBindings implements APIServiceBindingInterface +type fakeAPIServiceBindings struct { + *gentype.FakeClientWithList[*v1alpha1.APIServiceBinding, *v1alpha1.APIServiceBindingList] Fake *FakeKubeBindV1alpha1 } -var apiservicebindingsResource = v1alpha1.SchemeGroupVersion.WithResource("apiservicebindings") - -var apiservicebindingsKind = v1alpha1.SchemeGroupVersion.WithKind("APIServiceBinding") - -// Get takes name of the aPIServiceBinding, and returns the corresponding aPIServiceBinding object, and an error if there is any. -func (c *FakeAPIServiceBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.APIServiceBinding, err error) { - emptyResult := &v1alpha1.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(apiservicebindingsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceBinding), err -} - -// List takes label and field selectors, and returns the list of APIServiceBindings that match those selectors. -func (c *FakeAPIServiceBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.APIServiceBindingList, err error) { - emptyResult := &v1alpha1.APIServiceBindingList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(apiservicebindingsResource, apiservicebindingsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.APIServiceBindingList{ListMeta: obj.(*v1alpha1.APIServiceBindingList).ListMeta} - for _, item := range obj.(*v1alpha1.APIServiceBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceBindings. -func (c *FakeAPIServiceBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(apiservicebindingsResource, opts)) -} - -// Create takes the representation of a aPIServiceBinding and creates it. Returns the server's representation of the aPIServiceBinding, and an error, if there is any. -func (c *FakeAPIServiceBindings) Create(ctx context.Context, aPIServiceBinding *v1alpha1.APIServiceBinding, opts v1.CreateOptions) (result *v1alpha1.APIServiceBinding, err error) { - emptyResult := &v1alpha1.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(apiservicebindingsResource, aPIServiceBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceBinding), err -} - -// Update takes the representation of a aPIServiceBinding and updates it. Returns the server's representation of the aPIServiceBinding, and an error, if there is any. -func (c *FakeAPIServiceBindings) Update(ctx context.Context, aPIServiceBinding *v1alpha1.APIServiceBinding, opts v1.UpdateOptions) (result *v1alpha1.APIServiceBinding, err error) { - emptyResult := &v1alpha1.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(apiservicebindingsResource, aPIServiceBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceBinding), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceBindings) UpdateStatus(ctx context.Context, aPIServiceBinding *v1alpha1.APIServiceBinding, opts v1.UpdateOptions) (result *v1alpha1.APIServiceBinding, err error) { - emptyResult := &v1alpha1.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(apiservicebindingsResource, "status", aPIServiceBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceBinding), err -} - -// Delete takes name of the aPIServiceBinding and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(apiservicebindingsResource, name, opts), &v1alpha1.APIServiceBinding{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(apiservicebindingsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.APIServiceBindingList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceBinding. -func (c *FakeAPIServiceBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.APIServiceBinding, err error) { - emptyResult := &v1alpha1.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiservicebindingsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeAPIServiceBindings(fake *FakeKubeBindV1alpha1) kubebindv1alpha1.APIServiceBindingInterface { + return &fakeAPIServiceBindings{ + gentype.NewFakeClientWithList[*v1alpha1.APIServiceBinding, *v1alpha1.APIServiceBindingList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("apiservicebindings"), + v1alpha1.SchemeGroupVersion.WithKind("APIServiceBinding"), + func() *v1alpha1.APIServiceBinding { return &v1alpha1.APIServiceBinding{} }, + func() *v1alpha1.APIServiceBindingList { return &v1alpha1.APIServiceBindingList{} }, + func(dst, src *v1alpha1.APIServiceBindingList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.APIServiceBindingList) []*v1alpha1.APIServiceBinding { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.APIServiceBindingList, items []*v1alpha1.APIServiceBinding) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.APIServiceBinding), err } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexport.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexport.go index f7172257b..efe9a3197 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexport.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexport.go @@ -19,130 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/typed/kubebind/v1alpha1" ) -// FakeAPIServiceExports implements APIServiceExportInterface -type FakeAPIServiceExports struct { +// fakeAPIServiceExports implements APIServiceExportInterface +type fakeAPIServiceExports struct { + *gentype.FakeClientWithList[*v1alpha1.APIServiceExport, *v1alpha1.APIServiceExportList] Fake *FakeKubeBindV1alpha1 - ns string -} - -var apiserviceexportsResource = v1alpha1.SchemeGroupVersion.WithResource("apiserviceexports") - -var apiserviceexportsKind = v1alpha1.SchemeGroupVersion.WithKind("APIServiceExport") - -// Get takes name of the aPIServiceExport, and returns the corresponding aPIServiceExport object, and an error if there is any. -func (c *FakeAPIServiceExports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.APIServiceExport, err error) { - emptyResult := &v1alpha1.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(apiserviceexportsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExport), err -} - -// List takes label and field selectors, and returns the list of APIServiceExports that match those selectors. -func (c *FakeAPIServiceExports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.APIServiceExportList, err error) { - emptyResult := &v1alpha1.APIServiceExportList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(apiserviceexportsResource, apiserviceexportsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.APIServiceExportList{ListMeta: obj.(*v1alpha1.APIServiceExportList).ListMeta} - for _, item := range obj.(*v1alpha1.APIServiceExportList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceExports. -func (c *FakeAPIServiceExports) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(apiserviceexportsResource, c.ns, opts)) - -} - -// Create takes the representation of a aPIServiceExport and creates it. Returns the server's representation of the aPIServiceExport, and an error, if there is any. -func (c *FakeAPIServiceExports) Create(ctx context.Context, aPIServiceExport *v1alpha1.APIServiceExport, opts v1.CreateOptions) (result *v1alpha1.APIServiceExport, err error) { - emptyResult := &v1alpha1.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(apiserviceexportsResource, c.ns, aPIServiceExport, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExport), err -} - -// Update takes the representation of a aPIServiceExport and updates it. Returns the server's representation of the aPIServiceExport, and an error, if there is any. -func (c *FakeAPIServiceExports) Update(ctx context.Context, aPIServiceExport *v1alpha1.APIServiceExport, opts v1.UpdateOptions) (result *v1alpha1.APIServiceExport, err error) { - emptyResult := &v1alpha1.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(apiserviceexportsResource, c.ns, aPIServiceExport, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExport), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceExports) UpdateStatus(ctx context.Context, aPIServiceExport *v1alpha1.APIServiceExport, opts v1.UpdateOptions) (result *v1alpha1.APIServiceExport, err error) { - emptyResult := &v1alpha1.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(apiserviceexportsResource, "status", c.ns, aPIServiceExport, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExport), err -} - -// Delete takes name of the aPIServiceExport and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceExports) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(apiserviceexportsResource, c.ns, name, opts), &v1alpha1.APIServiceExport{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceExports) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(apiserviceexportsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.APIServiceExportList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceExport. -func (c *FakeAPIServiceExports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.APIServiceExport, err error) { - emptyResult := &v1alpha1.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeAPIServiceExports(fake *FakeKubeBindV1alpha1, namespace string) kubebindv1alpha1.APIServiceExportInterface { + return &fakeAPIServiceExports{ + gentype.NewFakeClientWithList[*v1alpha1.APIServiceExport, *v1alpha1.APIServiceExportList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("apiserviceexports"), + v1alpha1.SchemeGroupVersion.WithKind("APIServiceExport"), + func() *v1alpha1.APIServiceExport { return &v1alpha1.APIServiceExport{} }, + func() *v1alpha1.APIServiceExportList { return &v1alpha1.APIServiceExportList{} }, + func(dst, src *v1alpha1.APIServiceExportList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.APIServiceExportList) []*v1alpha1.APIServiceExport { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.APIServiceExportList, items []*v1alpha1.APIServiceExport) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.APIServiceExport), err } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexportrequest.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexportrequest.go index 62b7f6db5..1a247f610 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexportrequest.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexportrequest.go @@ -19,130 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/typed/kubebind/v1alpha1" ) -// FakeAPIServiceExportRequests implements APIServiceExportRequestInterface -type FakeAPIServiceExportRequests struct { +// fakeAPIServiceExportRequests implements APIServiceExportRequestInterface +type fakeAPIServiceExportRequests struct { + *gentype.FakeClientWithList[*v1alpha1.APIServiceExportRequest, *v1alpha1.APIServiceExportRequestList] Fake *FakeKubeBindV1alpha1 - ns string -} - -var apiserviceexportrequestsResource = v1alpha1.SchemeGroupVersion.WithResource("apiserviceexportrequests") - -var apiserviceexportrequestsKind = v1alpha1.SchemeGroupVersion.WithKind("APIServiceExportRequest") - -// Get takes name of the aPIServiceExportRequest, and returns the corresponding aPIServiceExportRequest object, and an error if there is any. -func (c *FakeAPIServiceExportRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.APIServiceExportRequest, err error) { - emptyResult := &v1alpha1.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(apiserviceexportrequestsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExportRequest), err -} - -// List takes label and field selectors, and returns the list of APIServiceExportRequests that match those selectors. -func (c *FakeAPIServiceExportRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.APIServiceExportRequestList, err error) { - emptyResult := &v1alpha1.APIServiceExportRequestList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(apiserviceexportrequestsResource, apiserviceexportrequestsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.APIServiceExportRequestList{ListMeta: obj.(*v1alpha1.APIServiceExportRequestList).ListMeta} - for _, item := range obj.(*v1alpha1.APIServiceExportRequestList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceExportRequests. -func (c *FakeAPIServiceExportRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(apiserviceexportrequestsResource, c.ns, opts)) - -} - -// Create takes the representation of a aPIServiceExportRequest and creates it. Returns the server's representation of the aPIServiceExportRequest, and an error, if there is any. -func (c *FakeAPIServiceExportRequests) Create(ctx context.Context, aPIServiceExportRequest *v1alpha1.APIServiceExportRequest, opts v1.CreateOptions) (result *v1alpha1.APIServiceExportRequest, err error) { - emptyResult := &v1alpha1.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(apiserviceexportrequestsResource, c.ns, aPIServiceExportRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExportRequest), err -} - -// Update takes the representation of a aPIServiceExportRequest and updates it. Returns the server's representation of the aPIServiceExportRequest, and an error, if there is any. -func (c *FakeAPIServiceExportRequests) Update(ctx context.Context, aPIServiceExportRequest *v1alpha1.APIServiceExportRequest, opts v1.UpdateOptions) (result *v1alpha1.APIServiceExportRequest, err error) { - emptyResult := &v1alpha1.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(apiserviceexportrequestsResource, c.ns, aPIServiceExportRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExportRequest), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceExportRequests) UpdateStatus(ctx context.Context, aPIServiceExportRequest *v1alpha1.APIServiceExportRequest, opts v1.UpdateOptions) (result *v1alpha1.APIServiceExportRequest, err error) { - emptyResult := &v1alpha1.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(apiserviceexportrequestsResource, "status", c.ns, aPIServiceExportRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExportRequest), err -} - -// Delete takes name of the aPIServiceExportRequest and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceExportRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(apiserviceexportrequestsResource, c.ns, name, opts), &v1alpha1.APIServiceExportRequest{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceExportRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(apiserviceexportrequestsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.APIServiceExportRequestList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceExportRequest. -func (c *FakeAPIServiceExportRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.APIServiceExportRequest, err error) { - emptyResult := &v1alpha1.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportrequestsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeAPIServiceExportRequests(fake *FakeKubeBindV1alpha1, namespace string) kubebindv1alpha1.APIServiceExportRequestInterface { + return &fakeAPIServiceExportRequests{ + gentype.NewFakeClientWithList[*v1alpha1.APIServiceExportRequest, *v1alpha1.APIServiceExportRequestList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("apiserviceexportrequests"), + v1alpha1.SchemeGroupVersion.WithKind("APIServiceExportRequest"), + func() *v1alpha1.APIServiceExportRequest { return &v1alpha1.APIServiceExportRequest{} }, + func() *v1alpha1.APIServiceExportRequestList { return &v1alpha1.APIServiceExportRequestList{} }, + func(dst, src *v1alpha1.APIServiceExportRequestList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.APIServiceExportRequestList) []*v1alpha1.APIServiceExportRequest { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.APIServiceExportRequestList, items []*v1alpha1.APIServiceExportRequest) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.APIServiceExportRequest), err } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicenamespace.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicenamespace.go index b2861121c..6fa139bb8 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicenamespace.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicenamespace.go @@ -19,130 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/typed/kubebind/v1alpha1" ) -// FakeAPIServiceNamespaces implements APIServiceNamespaceInterface -type FakeAPIServiceNamespaces struct { +// fakeAPIServiceNamespaces implements APIServiceNamespaceInterface +type fakeAPIServiceNamespaces struct { + *gentype.FakeClientWithList[*v1alpha1.APIServiceNamespace, *v1alpha1.APIServiceNamespaceList] Fake *FakeKubeBindV1alpha1 - ns string -} - -var apiservicenamespacesResource = v1alpha1.SchemeGroupVersion.WithResource("apiservicenamespaces") - -var apiservicenamespacesKind = v1alpha1.SchemeGroupVersion.WithKind("APIServiceNamespace") - -// Get takes name of the aPIServiceNamespace, and returns the corresponding aPIServiceNamespace object, and an error if there is any. -func (c *FakeAPIServiceNamespaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.APIServiceNamespace, err error) { - emptyResult := &v1alpha1.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(apiservicenamespacesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceNamespace), err -} - -// List takes label and field selectors, and returns the list of APIServiceNamespaces that match those selectors. -func (c *FakeAPIServiceNamespaces) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.APIServiceNamespaceList, err error) { - emptyResult := &v1alpha1.APIServiceNamespaceList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(apiservicenamespacesResource, apiservicenamespacesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.APIServiceNamespaceList{ListMeta: obj.(*v1alpha1.APIServiceNamespaceList).ListMeta} - for _, item := range obj.(*v1alpha1.APIServiceNamespaceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceNamespaces. -func (c *FakeAPIServiceNamespaces) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(apiservicenamespacesResource, c.ns, opts)) - -} - -// Create takes the representation of a aPIServiceNamespace and creates it. Returns the server's representation of the aPIServiceNamespace, and an error, if there is any. -func (c *FakeAPIServiceNamespaces) Create(ctx context.Context, aPIServiceNamespace *v1alpha1.APIServiceNamespace, opts v1.CreateOptions) (result *v1alpha1.APIServiceNamespace, err error) { - emptyResult := &v1alpha1.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(apiservicenamespacesResource, c.ns, aPIServiceNamespace, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceNamespace), err -} - -// Update takes the representation of a aPIServiceNamespace and updates it. Returns the server's representation of the aPIServiceNamespace, and an error, if there is any. -func (c *FakeAPIServiceNamespaces) Update(ctx context.Context, aPIServiceNamespace *v1alpha1.APIServiceNamespace, opts v1.UpdateOptions) (result *v1alpha1.APIServiceNamespace, err error) { - emptyResult := &v1alpha1.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(apiservicenamespacesResource, c.ns, aPIServiceNamespace, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceNamespace), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceNamespaces) UpdateStatus(ctx context.Context, aPIServiceNamespace *v1alpha1.APIServiceNamespace, opts v1.UpdateOptions) (result *v1alpha1.APIServiceNamespace, err error) { - emptyResult := &v1alpha1.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(apiservicenamespacesResource, "status", c.ns, aPIServiceNamespace, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceNamespace), err -} - -// Delete takes name of the aPIServiceNamespace and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceNamespaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(apiservicenamespacesResource, c.ns, name, opts), &v1alpha1.APIServiceNamespace{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceNamespaces) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(apiservicenamespacesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.APIServiceNamespaceList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceNamespace. -func (c *FakeAPIServiceNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.APIServiceNamespace, err error) { - emptyResult := &v1alpha1.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiservicenamespacesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeAPIServiceNamespaces(fake *FakeKubeBindV1alpha1, namespace string) kubebindv1alpha1.APIServiceNamespaceInterface { + return &fakeAPIServiceNamespaces{ + gentype.NewFakeClientWithList[*v1alpha1.APIServiceNamespace, *v1alpha1.APIServiceNamespaceList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("apiservicenamespaces"), + v1alpha1.SchemeGroupVersion.WithKind("APIServiceNamespace"), + func() *v1alpha1.APIServiceNamespace { return &v1alpha1.APIServiceNamespace{} }, + func() *v1alpha1.APIServiceNamespaceList { return &v1alpha1.APIServiceNamespaceList{} }, + func(dst, src *v1alpha1.APIServiceNamespaceList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.APIServiceNamespaceList) []*v1alpha1.APIServiceNamespace { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.APIServiceNamespaceList, items []*v1alpha1.APIServiceNamespace) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.APIServiceNamespace), err } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_clusterbinding.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_clusterbinding.go index 38b37a78b..ff62ee38f 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_clusterbinding.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_clusterbinding.go @@ -19,130 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/typed/kubebind/v1alpha1" ) -// FakeClusterBindings implements ClusterBindingInterface -type FakeClusterBindings struct { +// fakeClusterBindings implements ClusterBindingInterface +type fakeClusterBindings struct { + *gentype.FakeClientWithList[*v1alpha1.ClusterBinding, *v1alpha1.ClusterBindingList] Fake *FakeKubeBindV1alpha1 - ns string -} - -var clusterbindingsResource = v1alpha1.SchemeGroupVersion.WithResource("clusterbindings") - -var clusterbindingsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterBinding") - -// Get takes name of the clusterBinding, and returns the corresponding clusterBinding object, and an error if there is any. -func (c *FakeClusterBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterBinding, err error) { - emptyResult := &v1alpha1.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(clusterbindingsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterBinding), err -} - -// List takes label and field selectors, and returns the list of ClusterBindings that match those selectors. -func (c *FakeClusterBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterBindingList, err error) { - emptyResult := &v1alpha1.ClusterBindingList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(clusterbindingsResource, clusterbindingsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ClusterBindingList{ListMeta: obj.(*v1alpha1.ClusterBindingList).ListMeta} - for _, item := range obj.(*v1alpha1.ClusterBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterBindings. -func (c *FakeClusterBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(clusterbindingsResource, c.ns, opts)) - -} - -// Create takes the representation of a clusterBinding and creates it. Returns the server's representation of the clusterBinding, and an error, if there is any. -func (c *FakeClusterBindings) Create(ctx context.Context, clusterBinding *v1alpha1.ClusterBinding, opts v1.CreateOptions) (result *v1alpha1.ClusterBinding, err error) { - emptyResult := &v1alpha1.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(clusterbindingsResource, c.ns, clusterBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterBinding), err -} - -// Update takes the representation of a clusterBinding and updates it. Returns the server's representation of the clusterBinding, and an error, if there is any. -func (c *FakeClusterBindings) Update(ctx context.Context, clusterBinding *v1alpha1.ClusterBinding, opts v1.UpdateOptions) (result *v1alpha1.ClusterBinding, err error) { - emptyResult := &v1alpha1.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(clusterbindingsResource, c.ns, clusterBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterBinding), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusterBindings) UpdateStatus(ctx context.Context, clusterBinding *v1alpha1.ClusterBinding, opts v1.UpdateOptions) (result *v1alpha1.ClusterBinding, err error) { - emptyResult := &v1alpha1.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(clusterbindingsResource, "status", c.ns, clusterBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterBinding), err -} - -// Delete takes name of the clusterBinding and deletes it. Returns an error if one occurs. -func (c *FakeClusterBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(clusterbindingsResource, c.ns, name, opts), &v1alpha1.ClusterBinding{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(clusterbindingsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ClusterBindingList{}) - return err -} - -// Patch applies the patch and returns the patched clusterBinding. -func (c *FakeClusterBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterBinding, err error) { - emptyResult := &v1alpha1.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(clusterbindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeClusterBindings(fake *FakeKubeBindV1alpha1, namespace string) kubebindv1alpha1.ClusterBindingInterface { + return &fakeClusterBindings{ + gentype.NewFakeClientWithList[*v1alpha1.ClusterBinding, *v1alpha1.ClusterBindingList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("clusterbindings"), + v1alpha1.SchemeGroupVersion.WithKind("ClusterBinding"), + func() *v1alpha1.ClusterBinding { return &v1alpha1.ClusterBinding{} }, + func() *v1alpha1.ClusterBindingList { return &v1alpha1.ClusterBindingList{} }, + func(dst, src *v1alpha1.ClusterBindingList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ClusterBindingList) []*v1alpha1.ClusterBinding { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ClusterBindingList, items []*v1alpha1.ClusterBinding) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.ClusterBinding), err } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_kubebind_client.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_kubebind_client.go index 6d91f79b0..0a79be8c1 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_kubebind_client.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_kubebind_client.go @@ -30,23 +30,23 @@ type FakeKubeBindV1alpha1 struct { } func (c *FakeKubeBindV1alpha1) APIServiceBindings() v1alpha1.APIServiceBindingInterface { - return &FakeAPIServiceBindings{c} + return newFakeAPIServiceBindings(c) } func (c *FakeKubeBindV1alpha1) APIServiceExports(namespace string) v1alpha1.APIServiceExportInterface { - return &FakeAPIServiceExports{c, namespace} + return newFakeAPIServiceExports(c, namespace) } func (c *FakeKubeBindV1alpha1) APIServiceExportRequests(namespace string) v1alpha1.APIServiceExportRequestInterface { - return &FakeAPIServiceExportRequests{c, namespace} + return newFakeAPIServiceExportRequests(c, namespace) } func (c *FakeKubeBindV1alpha1) APIServiceNamespaces(namespace string) v1alpha1.APIServiceNamespaceInterface { - return &FakeAPIServiceNamespaces{c, namespace} + return newFakeAPIServiceNamespaces(c, namespace) } func (c *FakeKubeBindV1alpha1) ClusterBindings(namespace string) v1alpha1.ClusterBindingInterface { - return &FakeClusterBindings{c, namespace} + return newFakeClusterBindings(c, namespace) } // RESTClient returns a RESTClient that is used to communicate diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/kubebind_client.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/kubebind_client.go index 26b8b5b75..124ec4ae8 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/kubebind_client.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha1/kubebind_client.go @@ -19,12 +19,12 @@ limitations under the License. package v1alpha1 import ( - "net/http" + http "net/http" rest "k8s.io/client-go/rest" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" - "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) type KubeBindV1alpha1Interface interface { @@ -106,10 +106,10 @@ func New(c rest.Interface) *KubeBindV1alpha1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion + gv := kubebindv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiresourceschema.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiresourceschema.go index f5d39689d..d7d6a01ab 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiresourceschema.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiresourceschema.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) @@ -38,31 +38,32 @@ type APIResourceSchemasGetter interface { // APIResourceSchemaInterface has methods to work with APIResourceSchema resources. type APIResourceSchemaInterface interface { - Create(ctx context.Context, aPIResourceSchema *v1alpha2.APIResourceSchema, opts v1.CreateOptions) (*v1alpha2.APIResourceSchema, error) - Update(ctx context.Context, aPIResourceSchema *v1alpha2.APIResourceSchema, opts v1.UpdateOptions) (*v1alpha2.APIResourceSchema, error) + Create(ctx context.Context, aPIResourceSchema *kubebindv1alpha2.APIResourceSchema, opts v1.CreateOptions) (*kubebindv1alpha2.APIResourceSchema, error) + Update(ctx context.Context, aPIResourceSchema *kubebindv1alpha2.APIResourceSchema, opts v1.UpdateOptions) (*kubebindv1alpha2.APIResourceSchema, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.APIResourceSchema, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.APIResourceSchemaList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubebindv1alpha2.APIResourceSchema, error) + List(ctx context.Context, opts v1.ListOptions) (*kubebindv1alpha2.APIResourceSchemaList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIResourceSchema, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubebindv1alpha2.APIResourceSchema, err error) APIResourceSchemaExpansion } // aPIResourceSchemas implements APIResourceSchemaInterface type aPIResourceSchemas struct { - *gentype.ClientWithList[*v1alpha2.APIResourceSchema, *v1alpha2.APIResourceSchemaList] + *gentype.ClientWithList[*kubebindv1alpha2.APIResourceSchema, *kubebindv1alpha2.APIResourceSchemaList] } // newAPIResourceSchemas returns a APIResourceSchemas func newAPIResourceSchemas(c *KubeBindV1alpha2Client) *aPIResourceSchemas { return &aPIResourceSchemas{ - gentype.NewClientWithList[*v1alpha2.APIResourceSchema, *v1alpha2.APIResourceSchemaList]( + gentype.NewClientWithList[*kubebindv1alpha2.APIResourceSchema, *kubebindv1alpha2.APIResourceSchemaList]( "apiresourceschemas", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1alpha2.APIResourceSchema { return &v1alpha2.APIResourceSchema{} }, - func() *v1alpha2.APIResourceSchemaList { return &v1alpha2.APIResourceSchemaList{} }), + func() *kubebindv1alpha2.APIResourceSchema { return &kubebindv1alpha2.APIResourceSchema{} }, + func() *kubebindv1alpha2.APIResourceSchemaList { return &kubebindv1alpha2.APIResourceSchemaList{} }, + ), } } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiservicebinding.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiservicebinding.go index 620ac77a2..09733fe90 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiservicebinding.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiservicebinding.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) @@ -38,33 +38,34 @@ type APIServiceBindingsGetter interface { // APIServiceBindingInterface has methods to work with APIServiceBinding resources. type APIServiceBindingInterface interface { - Create(ctx context.Context, aPIServiceBinding *v1alpha2.APIServiceBinding, opts v1.CreateOptions) (*v1alpha2.APIServiceBinding, error) - Update(ctx context.Context, aPIServiceBinding *v1alpha2.APIServiceBinding, opts v1.UpdateOptions) (*v1alpha2.APIServiceBinding, error) + Create(ctx context.Context, aPIServiceBinding *kubebindv1alpha2.APIServiceBinding, opts v1.CreateOptions) (*kubebindv1alpha2.APIServiceBinding, error) + Update(ctx context.Context, aPIServiceBinding *kubebindv1alpha2.APIServiceBinding, opts v1.UpdateOptions) (*kubebindv1alpha2.APIServiceBinding, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, aPIServiceBinding *v1alpha2.APIServiceBinding, opts v1.UpdateOptions) (*v1alpha2.APIServiceBinding, error) + UpdateStatus(ctx context.Context, aPIServiceBinding *kubebindv1alpha2.APIServiceBinding, opts v1.UpdateOptions) (*kubebindv1alpha2.APIServiceBinding, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.APIServiceBinding, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.APIServiceBindingList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubebindv1alpha2.APIServiceBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*kubebindv1alpha2.APIServiceBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIServiceBinding, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubebindv1alpha2.APIServiceBinding, err error) APIServiceBindingExpansion } // aPIServiceBindings implements APIServiceBindingInterface type aPIServiceBindings struct { - *gentype.ClientWithList[*v1alpha2.APIServiceBinding, *v1alpha2.APIServiceBindingList] + *gentype.ClientWithList[*kubebindv1alpha2.APIServiceBinding, *kubebindv1alpha2.APIServiceBindingList] } // newAPIServiceBindings returns a APIServiceBindings func newAPIServiceBindings(c *KubeBindV1alpha2Client) *aPIServiceBindings { return &aPIServiceBindings{ - gentype.NewClientWithList[*v1alpha2.APIServiceBinding, *v1alpha2.APIServiceBindingList]( + gentype.NewClientWithList[*kubebindv1alpha2.APIServiceBinding, *kubebindv1alpha2.APIServiceBindingList]( "apiservicebindings", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1alpha2.APIServiceBinding { return &v1alpha2.APIServiceBinding{} }, - func() *v1alpha2.APIServiceBindingList { return &v1alpha2.APIServiceBindingList{} }), + func() *kubebindv1alpha2.APIServiceBinding { return &kubebindv1alpha2.APIServiceBinding{} }, + func() *kubebindv1alpha2.APIServiceBindingList { return &kubebindv1alpha2.APIServiceBindingList{} }, + ), } } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiserviceexport.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiserviceexport.go index 81b40f360..2d6681ef3 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiserviceexport.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiserviceexport.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) @@ -38,33 +38,34 @@ type APIServiceExportsGetter interface { // APIServiceExportInterface has methods to work with APIServiceExport resources. type APIServiceExportInterface interface { - Create(ctx context.Context, aPIServiceExport *v1alpha2.APIServiceExport, opts v1.CreateOptions) (*v1alpha2.APIServiceExport, error) - Update(ctx context.Context, aPIServiceExport *v1alpha2.APIServiceExport, opts v1.UpdateOptions) (*v1alpha2.APIServiceExport, error) + Create(ctx context.Context, aPIServiceExport *kubebindv1alpha2.APIServiceExport, opts v1.CreateOptions) (*kubebindv1alpha2.APIServiceExport, error) + Update(ctx context.Context, aPIServiceExport *kubebindv1alpha2.APIServiceExport, opts v1.UpdateOptions) (*kubebindv1alpha2.APIServiceExport, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, aPIServiceExport *v1alpha2.APIServiceExport, opts v1.UpdateOptions) (*v1alpha2.APIServiceExport, error) + UpdateStatus(ctx context.Context, aPIServiceExport *kubebindv1alpha2.APIServiceExport, opts v1.UpdateOptions) (*kubebindv1alpha2.APIServiceExport, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.APIServiceExport, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.APIServiceExportList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubebindv1alpha2.APIServiceExport, error) + List(ctx context.Context, opts v1.ListOptions) (*kubebindv1alpha2.APIServiceExportList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIServiceExport, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubebindv1alpha2.APIServiceExport, err error) APIServiceExportExpansion } // aPIServiceExports implements APIServiceExportInterface type aPIServiceExports struct { - *gentype.ClientWithList[*v1alpha2.APIServiceExport, *v1alpha2.APIServiceExportList] + *gentype.ClientWithList[*kubebindv1alpha2.APIServiceExport, *kubebindv1alpha2.APIServiceExportList] } // newAPIServiceExports returns a APIServiceExports func newAPIServiceExports(c *KubeBindV1alpha2Client, namespace string) *aPIServiceExports { return &aPIServiceExports{ - gentype.NewClientWithList[*v1alpha2.APIServiceExport, *v1alpha2.APIServiceExportList]( + gentype.NewClientWithList[*kubebindv1alpha2.APIServiceExport, *kubebindv1alpha2.APIServiceExportList]( "apiserviceexports", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.APIServiceExport { return &v1alpha2.APIServiceExport{} }, - func() *v1alpha2.APIServiceExportList { return &v1alpha2.APIServiceExportList{} }), + func() *kubebindv1alpha2.APIServiceExport { return &kubebindv1alpha2.APIServiceExport{} }, + func() *kubebindv1alpha2.APIServiceExportList { return &kubebindv1alpha2.APIServiceExportList{} }, + ), } } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiserviceexportrequest.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiserviceexportrequest.go index 138ad5b57..c5da294c1 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiserviceexportrequest.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiserviceexportrequest.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) @@ -38,33 +38,36 @@ type APIServiceExportRequestsGetter interface { // APIServiceExportRequestInterface has methods to work with APIServiceExportRequest resources. type APIServiceExportRequestInterface interface { - Create(ctx context.Context, aPIServiceExportRequest *v1alpha2.APIServiceExportRequest, opts v1.CreateOptions) (*v1alpha2.APIServiceExportRequest, error) - Update(ctx context.Context, aPIServiceExportRequest *v1alpha2.APIServiceExportRequest, opts v1.UpdateOptions) (*v1alpha2.APIServiceExportRequest, error) + Create(ctx context.Context, aPIServiceExportRequest *kubebindv1alpha2.APIServiceExportRequest, opts v1.CreateOptions) (*kubebindv1alpha2.APIServiceExportRequest, error) + Update(ctx context.Context, aPIServiceExportRequest *kubebindv1alpha2.APIServiceExportRequest, opts v1.UpdateOptions) (*kubebindv1alpha2.APIServiceExportRequest, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, aPIServiceExportRequest *v1alpha2.APIServiceExportRequest, opts v1.UpdateOptions) (*v1alpha2.APIServiceExportRequest, error) + UpdateStatus(ctx context.Context, aPIServiceExportRequest *kubebindv1alpha2.APIServiceExportRequest, opts v1.UpdateOptions) (*kubebindv1alpha2.APIServiceExportRequest, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.APIServiceExportRequest, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.APIServiceExportRequestList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubebindv1alpha2.APIServiceExportRequest, error) + List(ctx context.Context, opts v1.ListOptions) (*kubebindv1alpha2.APIServiceExportRequestList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIServiceExportRequest, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubebindv1alpha2.APIServiceExportRequest, err error) APIServiceExportRequestExpansion } // aPIServiceExportRequests implements APIServiceExportRequestInterface type aPIServiceExportRequests struct { - *gentype.ClientWithList[*v1alpha2.APIServiceExportRequest, *v1alpha2.APIServiceExportRequestList] + *gentype.ClientWithList[*kubebindv1alpha2.APIServiceExportRequest, *kubebindv1alpha2.APIServiceExportRequestList] } // newAPIServiceExportRequests returns a APIServiceExportRequests func newAPIServiceExportRequests(c *KubeBindV1alpha2Client, namespace string) *aPIServiceExportRequests { return &aPIServiceExportRequests{ - gentype.NewClientWithList[*v1alpha2.APIServiceExportRequest, *v1alpha2.APIServiceExportRequestList]( + gentype.NewClientWithList[*kubebindv1alpha2.APIServiceExportRequest, *kubebindv1alpha2.APIServiceExportRequestList]( "apiserviceexportrequests", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.APIServiceExportRequest { return &v1alpha2.APIServiceExportRequest{} }, - func() *v1alpha2.APIServiceExportRequestList { return &v1alpha2.APIServiceExportRequestList{} }), + func() *kubebindv1alpha2.APIServiceExportRequest { return &kubebindv1alpha2.APIServiceExportRequest{} }, + func() *kubebindv1alpha2.APIServiceExportRequestList { + return &kubebindv1alpha2.APIServiceExportRequestList{} + }, + ), } } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiservicenamespace.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiservicenamespace.go index 739636de6..23ea1205d 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiservicenamespace.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/apiservicenamespace.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) @@ -38,33 +38,34 @@ type APIServiceNamespacesGetter interface { // APIServiceNamespaceInterface has methods to work with APIServiceNamespace resources. type APIServiceNamespaceInterface interface { - Create(ctx context.Context, aPIServiceNamespace *v1alpha2.APIServiceNamespace, opts v1.CreateOptions) (*v1alpha2.APIServiceNamespace, error) - Update(ctx context.Context, aPIServiceNamespace *v1alpha2.APIServiceNamespace, opts v1.UpdateOptions) (*v1alpha2.APIServiceNamespace, error) + Create(ctx context.Context, aPIServiceNamespace *kubebindv1alpha2.APIServiceNamespace, opts v1.CreateOptions) (*kubebindv1alpha2.APIServiceNamespace, error) + Update(ctx context.Context, aPIServiceNamespace *kubebindv1alpha2.APIServiceNamespace, opts v1.UpdateOptions) (*kubebindv1alpha2.APIServiceNamespace, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, aPIServiceNamespace *v1alpha2.APIServiceNamespace, opts v1.UpdateOptions) (*v1alpha2.APIServiceNamespace, error) + UpdateStatus(ctx context.Context, aPIServiceNamespace *kubebindv1alpha2.APIServiceNamespace, opts v1.UpdateOptions) (*kubebindv1alpha2.APIServiceNamespace, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.APIServiceNamespace, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.APIServiceNamespaceList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubebindv1alpha2.APIServiceNamespace, error) + List(ctx context.Context, opts v1.ListOptions) (*kubebindv1alpha2.APIServiceNamespaceList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIServiceNamespace, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubebindv1alpha2.APIServiceNamespace, err error) APIServiceNamespaceExpansion } // aPIServiceNamespaces implements APIServiceNamespaceInterface type aPIServiceNamespaces struct { - *gentype.ClientWithList[*v1alpha2.APIServiceNamespace, *v1alpha2.APIServiceNamespaceList] + *gentype.ClientWithList[*kubebindv1alpha2.APIServiceNamespace, *kubebindv1alpha2.APIServiceNamespaceList] } // newAPIServiceNamespaces returns a APIServiceNamespaces func newAPIServiceNamespaces(c *KubeBindV1alpha2Client, namespace string) *aPIServiceNamespaces { return &aPIServiceNamespaces{ - gentype.NewClientWithList[*v1alpha2.APIServiceNamespace, *v1alpha2.APIServiceNamespaceList]( + gentype.NewClientWithList[*kubebindv1alpha2.APIServiceNamespace, *kubebindv1alpha2.APIServiceNamespaceList]( "apiservicenamespaces", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.APIServiceNamespace { return &v1alpha2.APIServiceNamespace{} }, - func() *v1alpha2.APIServiceNamespaceList { return &v1alpha2.APIServiceNamespaceList{} }), + func() *kubebindv1alpha2.APIServiceNamespace { return &kubebindv1alpha2.APIServiceNamespace{} }, + func() *kubebindv1alpha2.APIServiceNamespaceList { return &kubebindv1alpha2.APIServiceNamespaceList{} }, + ), } } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/boundapiresourceschema.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/boundapiresourceschema.go index cc1b3f870..5781d3925 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/boundapiresourceschema.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/boundapiresourceschema.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) @@ -38,33 +38,36 @@ type BoundAPIResourceSchemasGetter interface { // BoundAPIResourceSchemaInterface has methods to work with BoundAPIResourceSchema resources. type BoundAPIResourceSchemaInterface interface { - Create(ctx context.Context, boundAPIResourceSchema *v1alpha2.BoundAPIResourceSchema, opts v1.CreateOptions) (*v1alpha2.BoundAPIResourceSchema, error) - Update(ctx context.Context, boundAPIResourceSchema *v1alpha2.BoundAPIResourceSchema, opts v1.UpdateOptions) (*v1alpha2.BoundAPIResourceSchema, error) + Create(ctx context.Context, boundAPIResourceSchema *kubebindv1alpha2.BoundAPIResourceSchema, opts v1.CreateOptions) (*kubebindv1alpha2.BoundAPIResourceSchema, error) + Update(ctx context.Context, boundAPIResourceSchema *kubebindv1alpha2.BoundAPIResourceSchema, opts v1.UpdateOptions) (*kubebindv1alpha2.BoundAPIResourceSchema, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, boundAPIResourceSchema *v1alpha2.BoundAPIResourceSchema, opts v1.UpdateOptions) (*v1alpha2.BoundAPIResourceSchema, error) + UpdateStatus(ctx context.Context, boundAPIResourceSchema *kubebindv1alpha2.BoundAPIResourceSchema, opts v1.UpdateOptions) (*kubebindv1alpha2.BoundAPIResourceSchema, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.BoundAPIResourceSchema, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.BoundAPIResourceSchemaList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubebindv1alpha2.BoundAPIResourceSchema, error) + List(ctx context.Context, opts v1.ListOptions) (*kubebindv1alpha2.BoundAPIResourceSchemaList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BoundAPIResourceSchema, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubebindv1alpha2.BoundAPIResourceSchema, err error) BoundAPIResourceSchemaExpansion } // boundAPIResourceSchemas implements BoundAPIResourceSchemaInterface type boundAPIResourceSchemas struct { - *gentype.ClientWithList[*v1alpha2.BoundAPIResourceSchema, *v1alpha2.BoundAPIResourceSchemaList] + *gentype.ClientWithList[*kubebindv1alpha2.BoundAPIResourceSchema, *kubebindv1alpha2.BoundAPIResourceSchemaList] } // newBoundAPIResourceSchemas returns a BoundAPIResourceSchemas func newBoundAPIResourceSchemas(c *KubeBindV1alpha2Client, namespace string) *boundAPIResourceSchemas { return &boundAPIResourceSchemas{ - gentype.NewClientWithList[*v1alpha2.BoundAPIResourceSchema, *v1alpha2.BoundAPIResourceSchemaList]( + gentype.NewClientWithList[*kubebindv1alpha2.BoundAPIResourceSchema, *kubebindv1alpha2.BoundAPIResourceSchemaList]( "boundapiresourceschemas", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.BoundAPIResourceSchema { return &v1alpha2.BoundAPIResourceSchema{} }, - func() *v1alpha2.BoundAPIResourceSchemaList { return &v1alpha2.BoundAPIResourceSchemaList{} }), + func() *kubebindv1alpha2.BoundAPIResourceSchema { return &kubebindv1alpha2.BoundAPIResourceSchema{} }, + func() *kubebindv1alpha2.BoundAPIResourceSchemaList { + return &kubebindv1alpha2.BoundAPIResourceSchemaList{} + }, + ), } } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/clusterbinding.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/clusterbinding.go index 717fd8064..83d5300ff 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/clusterbinding.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/clusterbinding.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) @@ -38,33 +38,34 @@ type ClusterBindingsGetter interface { // ClusterBindingInterface has methods to work with ClusterBinding resources. type ClusterBindingInterface interface { - Create(ctx context.Context, clusterBinding *v1alpha2.ClusterBinding, opts v1.CreateOptions) (*v1alpha2.ClusterBinding, error) - Update(ctx context.Context, clusterBinding *v1alpha2.ClusterBinding, opts v1.UpdateOptions) (*v1alpha2.ClusterBinding, error) + Create(ctx context.Context, clusterBinding *kubebindv1alpha2.ClusterBinding, opts v1.CreateOptions) (*kubebindv1alpha2.ClusterBinding, error) + Update(ctx context.Context, clusterBinding *kubebindv1alpha2.ClusterBinding, opts v1.UpdateOptions) (*kubebindv1alpha2.ClusterBinding, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, clusterBinding *v1alpha2.ClusterBinding, opts v1.UpdateOptions) (*v1alpha2.ClusterBinding, error) + UpdateStatus(ctx context.Context, clusterBinding *kubebindv1alpha2.ClusterBinding, opts v1.UpdateOptions) (*kubebindv1alpha2.ClusterBinding, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ClusterBinding, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ClusterBindingList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*kubebindv1alpha2.ClusterBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*kubebindv1alpha2.ClusterBindingList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ClusterBinding, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *kubebindv1alpha2.ClusterBinding, err error) ClusterBindingExpansion } // clusterBindings implements ClusterBindingInterface type clusterBindings struct { - *gentype.ClientWithList[*v1alpha2.ClusterBinding, *v1alpha2.ClusterBindingList] + *gentype.ClientWithList[*kubebindv1alpha2.ClusterBinding, *kubebindv1alpha2.ClusterBindingList] } // newClusterBindings returns a ClusterBindings func newClusterBindings(c *KubeBindV1alpha2Client, namespace string) *clusterBindings { return &clusterBindings{ - gentype.NewClientWithList[*v1alpha2.ClusterBinding, *v1alpha2.ClusterBindingList]( + gentype.NewClientWithList[*kubebindv1alpha2.ClusterBinding, *kubebindv1alpha2.ClusterBindingList]( "clusterbindings", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.ClusterBinding { return &v1alpha2.ClusterBinding{} }, - func() *v1alpha2.ClusterBindingList { return &v1alpha2.ClusterBindingList{} }), + func() *kubebindv1alpha2.ClusterBinding { return &kubebindv1alpha2.ClusterBinding{} }, + func() *kubebindv1alpha2.ClusterBindingList { return &kubebindv1alpha2.ClusterBindingList{} }, + ), } } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiresourceschema.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiresourceschema.go index f747ed636..684c48354 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiresourceschema.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiresourceschema.go @@ -19,109 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeAPIResourceSchemas implements APIResourceSchemaInterface -type FakeAPIResourceSchemas struct { +// fakeAPIResourceSchemas implements APIResourceSchemaInterface +type fakeAPIResourceSchemas struct { + *gentype.FakeClientWithList[*v1alpha2.APIResourceSchema, *v1alpha2.APIResourceSchemaList] Fake *FakeKubeBindV1alpha2 } -var apiresourceschemasResource = v1alpha2.SchemeGroupVersion.WithResource("apiresourceschemas") - -var apiresourceschemasKind = v1alpha2.SchemeGroupVersion.WithKind("APIResourceSchema") - -// Get takes name of the aPIResourceSchema, and returns the corresponding aPIResourceSchema object, and an error if there is any. -func (c *FakeAPIResourceSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.APIResourceSchema, err error) { - emptyResult := &v1alpha2.APIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(apiresourceschemasResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIResourceSchema), err -} - -// List takes label and field selectors, and returns the list of APIResourceSchemas that match those selectors. -func (c *FakeAPIResourceSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.APIResourceSchemaList, err error) { - emptyResult := &v1alpha2.APIResourceSchemaList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(apiresourceschemasResource, apiresourceschemasKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.APIResourceSchemaList{ListMeta: obj.(*v1alpha2.APIResourceSchemaList).ListMeta} - for _, item := range obj.(*v1alpha2.APIResourceSchemaList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIResourceSchemas. -func (c *FakeAPIResourceSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(apiresourceschemasResource, opts)) -} - -// Create takes the representation of a aPIResourceSchema and creates it. Returns the server's representation of the aPIResourceSchema, and an error, if there is any. -func (c *FakeAPIResourceSchemas) Create(ctx context.Context, aPIResourceSchema *v1alpha2.APIResourceSchema, opts v1.CreateOptions) (result *v1alpha2.APIResourceSchema, err error) { - emptyResult := &v1alpha2.APIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(apiresourceschemasResource, aPIResourceSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIResourceSchema), err -} - -// Update takes the representation of a aPIResourceSchema and updates it. Returns the server's representation of the aPIResourceSchema, and an error, if there is any. -func (c *FakeAPIResourceSchemas) Update(ctx context.Context, aPIResourceSchema *v1alpha2.APIResourceSchema, opts v1.UpdateOptions) (result *v1alpha2.APIResourceSchema, err error) { - emptyResult := &v1alpha2.APIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(apiresourceschemasResource, aPIResourceSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIResourceSchema), err -} - -// Delete takes name of the aPIResourceSchema and deletes it. Returns an error if one occurs. -func (c *FakeAPIResourceSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(apiresourceschemasResource, name, opts), &v1alpha2.APIResourceSchema{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIResourceSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(apiresourceschemasResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.APIResourceSchemaList{}) - return err -} - -// Patch applies the patch and returns the patched aPIResourceSchema. -func (c *FakeAPIResourceSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIResourceSchema, err error) { - emptyResult := &v1alpha2.APIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiresourceschemasResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeAPIResourceSchemas(fake *FakeKubeBindV1alpha2) kubebindv1alpha2.APIResourceSchemaInterface { + return &fakeAPIResourceSchemas{ + gentype.NewFakeClientWithList[*v1alpha2.APIResourceSchema, *v1alpha2.APIResourceSchemaList]( + fake.Fake, + "", + v1alpha2.SchemeGroupVersion.WithResource("apiresourceschemas"), + v1alpha2.SchemeGroupVersion.WithKind("APIResourceSchema"), + func() *v1alpha2.APIResourceSchema { return &v1alpha2.APIResourceSchema{} }, + func() *v1alpha2.APIResourceSchemaList { return &v1alpha2.APIResourceSchemaList{} }, + func(dst, src *v1alpha2.APIResourceSchemaList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.APIResourceSchemaList) []*v1alpha2.APIResourceSchema { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.APIResourceSchemaList, items []*v1alpha2.APIResourceSchema) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.APIResourceSchema), err } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicebinding.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicebinding.go index f88627fdd..2d5951cf6 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicebinding.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicebinding.go @@ -19,121 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeAPIServiceBindings implements APIServiceBindingInterface -type FakeAPIServiceBindings struct { +// fakeAPIServiceBindings implements APIServiceBindingInterface +type fakeAPIServiceBindings struct { + *gentype.FakeClientWithList[*v1alpha2.APIServiceBinding, *v1alpha2.APIServiceBindingList] Fake *FakeKubeBindV1alpha2 } -var apiservicebindingsResource = v1alpha2.SchemeGroupVersion.WithResource("apiservicebindings") - -var apiservicebindingsKind = v1alpha2.SchemeGroupVersion.WithKind("APIServiceBinding") - -// Get takes name of the aPIServiceBinding, and returns the corresponding aPIServiceBinding object, and an error if there is any. -func (c *FakeAPIServiceBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.APIServiceBinding, err error) { - emptyResult := &v1alpha2.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(apiservicebindingsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceBinding), err -} - -// List takes label and field selectors, and returns the list of APIServiceBindings that match those selectors. -func (c *FakeAPIServiceBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.APIServiceBindingList, err error) { - emptyResult := &v1alpha2.APIServiceBindingList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(apiservicebindingsResource, apiservicebindingsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.APIServiceBindingList{ListMeta: obj.(*v1alpha2.APIServiceBindingList).ListMeta} - for _, item := range obj.(*v1alpha2.APIServiceBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceBindings. -func (c *FakeAPIServiceBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(apiservicebindingsResource, opts)) -} - -// Create takes the representation of a aPIServiceBinding and creates it. Returns the server's representation of the aPIServiceBinding, and an error, if there is any. -func (c *FakeAPIServiceBindings) Create(ctx context.Context, aPIServiceBinding *v1alpha2.APIServiceBinding, opts v1.CreateOptions) (result *v1alpha2.APIServiceBinding, err error) { - emptyResult := &v1alpha2.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(apiservicebindingsResource, aPIServiceBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceBinding), err -} - -// Update takes the representation of a aPIServiceBinding and updates it. Returns the server's representation of the aPIServiceBinding, and an error, if there is any. -func (c *FakeAPIServiceBindings) Update(ctx context.Context, aPIServiceBinding *v1alpha2.APIServiceBinding, opts v1.UpdateOptions) (result *v1alpha2.APIServiceBinding, err error) { - emptyResult := &v1alpha2.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(apiservicebindingsResource, aPIServiceBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceBinding), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceBindings) UpdateStatus(ctx context.Context, aPIServiceBinding *v1alpha2.APIServiceBinding, opts v1.UpdateOptions) (result *v1alpha2.APIServiceBinding, err error) { - emptyResult := &v1alpha2.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(apiservicebindingsResource, "status", aPIServiceBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceBinding), err -} - -// Delete takes name of the aPIServiceBinding and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(apiservicebindingsResource, name, opts), &v1alpha2.APIServiceBinding{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(apiservicebindingsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.APIServiceBindingList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceBinding. -func (c *FakeAPIServiceBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIServiceBinding, err error) { - emptyResult := &v1alpha2.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiservicebindingsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeAPIServiceBindings(fake *FakeKubeBindV1alpha2) kubebindv1alpha2.APIServiceBindingInterface { + return &fakeAPIServiceBindings{ + gentype.NewFakeClientWithList[*v1alpha2.APIServiceBinding, *v1alpha2.APIServiceBindingList]( + fake.Fake, + "", + v1alpha2.SchemeGroupVersion.WithResource("apiservicebindings"), + v1alpha2.SchemeGroupVersion.WithKind("APIServiceBinding"), + func() *v1alpha2.APIServiceBinding { return &v1alpha2.APIServiceBinding{} }, + func() *v1alpha2.APIServiceBindingList { return &v1alpha2.APIServiceBindingList{} }, + func(dst, src *v1alpha2.APIServiceBindingList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.APIServiceBindingList) []*v1alpha2.APIServiceBinding { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.APIServiceBindingList, items []*v1alpha2.APIServiceBinding) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.APIServiceBinding), err } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexport.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexport.go index 88e0f068b..c60c4b8e3 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexport.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexport.go @@ -19,130 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeAPIServiceExports implements APIServiceExportInterface -type FakeAPIServiceExports struct { +// fakeAPIServiceExports implements APIServiceExportInterface +type fakeAPIServiceExports struct { + *gentype.FakeClientWithList[*v1alpha2.APIServiceExport, *v1alpha2.APIServiceExportList] Fake *FakeKubeBindV1alpha2 - ns string -} - -var apiserviceexportsResource = v1alpha2.SchemeGroupVersion.WithResource("apiserviceexports") - -var apiserviceexportsKind = v1alpha2.SchemeGroupVersion.WithKind("APIServiceExport") - -// Get takes name of the aPIServiceExport, and returns the corresponding aPIServiceExport object, and an error if there is any. -func (c *FakeAPIServiceExports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.APIServiceExport, err error) { - emptyResult := &v1alpha2.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(apiserviceexportsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExport), err -} - -// List takes label and field selectors, and returns the list of APIServiceExports that match those selectors. -func (c *FakeAPIServiceExports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.APIServiceExportList, err error) { - emptyResult := &v1alpha2.APIServiceExportList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(apiserviceexportsResource, apiserviceexportsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.APIServiceExportList{ListMeta: obj.(*v1alpha2.APIServiceExportList).ListMeta} - for _, item := range obj.(*v1alpha2.APIServiceExportList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceExports. -func (c *FakeAPIServiceExports) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(apiserviceexportsResource, c.ns, opts)) - -} - -// Create takes the representation of a aPIServiceExport and creates it. Returns the server's representation of the aPIServiceExport, and an error, if there is any. -func (c *FakeAPIServiceExports) Create(ctx context.Context, aPIServiceExport *v1alpha2.APIServiceExport, opts v1.CreateOptions) (result *v1alpha2.APIServiceExport, err error) { - emptyResult := &v1alpha2.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(apiserviceexportsResource, c.ns, aPIServiceExport, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExport), err -} - -// Update takes the representation of a aPIServiceExport and updates it. Returns the server's representation of the aPIServiceExport, and an error, if there is any. -func (c *FakeAPIServiceExports) Update(ctx context.Context, aPIServiceExport *v1alpha2.APIServiceExport, opts v1.UpdateOptions) (result *v1alpha2.APIServiceExport, err error) { - emptyResult := &v1alpha2.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(apiserviceexportsResource, c.ns, aPIServiceExport, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExport), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceExports) UpdateStatus(ctx context.Context, aPIServiceExport *v1alpha2.APIServiceExport, opts v1.UpdateOptions) (result *v1alpha2.APIServiceExport, err error) { - emptyResult := &v1alpha2.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(apiserviceexportsResource, "status", c.ns, aPIServiceExport, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExport), err -} - -// Delete takes name of the aPIServiceExport and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceExports) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(apiserviceexportsResource, c.ns, name, opts), &v1alpha2.APIServiceExport{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceExports) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(apiserviceexportsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.APIServiceExportList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceExport. -func (c *FakeAPIServiceExports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIServiceExport, err error) { - emptyResult := &v1alpha2.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeAPIServiceExports(fake *FakeKubeBindV1alpha2, namespace string) kubebindv1alpha2.APIServiceExportInterface { + return &fakeAPIServiceExports{ + gentype.NewFakeClientWithList[*v1alpha2.APIServiceExport, *v1alpha2.APIServiceExportList]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("apiserviceexports"), + v1alpha2.SchemeGroupVersion.WithKind("APIServiceExport"), + func() *v1alpha2.APIServiceExport { return &v1alpha2.APIServiceExport{} }, + func() *v1alpha2.APIServiceExportList { return &v1alpha2.APIServiceExportList{} }, + func(dst, src *v1alpha2.APIServiceExportList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.APIServiceExportList) []*v1alpha2.APIServiceExport { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.APIServiceExportList, items []*v1alpha2.APIServiceExport) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.APIServiceExport), err } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexportrequest.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexportrequest.go index d5bb1da3f..9c913d6e7 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexportrequest.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexportrequest.go @@ -19,130 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeAPIServiceExportRequests implements APIServiceExportRequestInterface -type FakeAPIServiceExportRequests struct { +// fakeAPIServiceExportRequests implements APIServiceExportRequestInterface +type fakeAPIServiceExportRequests struct { + *gentype.FakeClientWithList[*v1alpha2.APIServiceExportRequest, *v1alpha2.APIServiceExportRequestList] Fake *FakeKubeBindV1alpha2 - ns string -} - -var apiserviceexportrequestsResource = v1alpha2.SchemeGroupVersion.WithResource("apiserviceexportrequests") - -var apiserviceexportrequestsKind = v1alpha2.SchemeGroupVersion.WithKind("APIServiceExportRequest") - -// Get takes name of the aPIServiceExportRequest, and returns the corresponding aPIServiceExportRequest object, and an error if there is any. -func (c *FakeAPIServiceExportRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.APIServiceExportRequest, err error) { - emptyResult := &v1alpha2.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(apiserviceexportrequestsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExportRequest), err -} - -// List takes label and field selectors, and returns the list of APIServiceExportRequests that match those selectors. -func (c *FakeAPIServiceExportRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.APIServiceExportRequestList, err error) { - emptyResult := &v1alpha2.APIServiceExportRequestList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(apiserviceexportrequestsResource, apiserviceexportrequestsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.APIServiceExportRequestList{ListMeta: obj.(*v1alpha2.APIServiceExportRequestList).ListMeta} - for _, item := range obj.(*v1alpha2.APIServiceExportRequestList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceExportRequests. -func (c *FakeAPIServiceExportRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(apiserviceexportrequestsResource, c.ns, opts)) - -} - -// Create takes the representation of a aPIServiceExportRequest and creates it. Returns the server's representation of the aPIServiceExportRequest, and an error, if there is any. -func (c *FakeAPIServiceExportRequests) Create(ctx context.Context, aPIServiceExportRequest *v1alpha2.APIServiceExportRequest, opts v1.CreateOptions) (result *v1alpha2.APIServiceExportRequest, err error) { - emptyResult := &v1alpha2.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(apiserviceexportrequestsResource, c.ns, aPIServiceExportRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExportRequest), err -} - -// Update takes the representation of a aPIServiceExportRequest and updates it. Returns the server's representation of the aPIServiceExportRequest, and an error, if there is any. -func (c *FakeAPIServiceExportRequests) Update(ctx context.Context, aPIServiceExportRequest *v1alpha2.APIServiceExportRequest, opts v1.UpdateOptions) (result *v1alpha2.APIServiceExportRequest, err error) { - emptyResult := &v1alpha2.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(apiserviceexportrequestsResource, c.ns, aPIServiceExportRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExportRequest), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceExportRequests) UpdateStatus(ctx context.Context, aPIServiceExportRequest *v1alpha2.APIServiceExportRequest, opts v1.UpdateOptions) (result *v1alpha2.APIServiceExportRequest, err error) { - emptyResult := &v1alpha2.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(apiserviceexportrequestsResource, "status", c.ns, aPIServiceExportRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExportRequest), err -} - -// Delete takes name of the aPIServiceExportRequest and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceExportRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(apiserviceexportrequestsResource, c.ns, name, opts), &v1alpha2.APIServiceExportRequest{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceExportRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(apiserviceexportrequestsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.APIServiceExportRequestList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceExportRequest. -func (c *FakeAPIServiceExportRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIServiceExportRequest, err error) { - emptyResult := &v1alpha2.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportrequestsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeAPIServiceExportRequests(fake *FakeKubeBindV1alpha2, namespace string) kubebindv1alpha2.APIServiceExportRequestInterface { + return &fakeAPIServiceExportRequests{ + gentype.NewFakeClientWithList[*v1alpha2.APIServiceExportRequest, *v1alpha2.APIServiceExportRequestList]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("apiserviceexportrequests"), + v1alpha2.SchemeGroupVersion.WithKind("APIServiceExportRequest"), + func() *v1alpha2.APIServiceExportRequest { return &v1alpha2.APIServiceExportRequest{} }, + func() *v1alpha2.APIServiceExportRequestList { return &v1alpha2.APIServiceExportRequestList{} }, + func(dst, src *v1alpha2.APIServiceExportRequestList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.APIServiceExportRequestList) []*v1alpha2.APIServiceExportRequest { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.APIServiceExportRequestList, items []*v1alpha2.APIServiceExportRequest) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.APIServiceExportRequest), err } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicenamespace.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicenamespace.go index 56e908710..39115dffb 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicenamespace.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicenamespace.go @@ -19,130 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeAPIServiceNamespaces implements APIServiceNamespaceInterface -type FakeAPIServiceNamespaces struct { +// fakeAPIServiceNamespaces implements APIServiceNamespaceInterface +type fakeAPIServiceNamespaces struct { + *gentype.FakeClientWithList[*v1alpha2.APIServiceNamespace, *v1alpha2.APIServiceNamespaceList] Fake *FakeKubeBindV1alpha2 - ns string -} - -var apiservicenamespacesResource = v1alpha2.SchemeGroupVersion.WithResource("apiservicenamespaces") - -var apiservicenamespacesKind = v1alpha2.SchemeGroupVersion.WithKind("APIServiceNamespace") - -// Get takes name of the aPIServiceNamespace, and returns the corresponding aPIServiceNamespace object, and an error if there is any. -func (c *FakeAPIServiceNamespaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.APIServiceNamespace, err error) { - emptyResult := &v1alpha2.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(apiservicenamespacesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceNamespace), err -} - -// List takes label and field selectors, and returns the list of APIServiceNamespaces that match those selectors. -func (c *FakeAPIServiceNamespaces) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.APIServiceNamespaceList, err error) { - emptyResult := &v1alpha2.APIServiceNamespaceList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(apiservicenamespacesResource, apiservicenamespacesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.APIServiceNamespaceList{ListMeta: obj.(*v1alpha2.APIServiceNamespaceList).ListMeta} - for _, item := range obj.(*v1alpha2.APIServiceNamespaceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceNamespaces. -func (c *FakeAPIServiceNamespaces) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(apiservicenamespacesResource, c.ns, opts)) - -} - -// Create takes the representation of a aPIServiceNamespace and creates it. Returns the server's representation of the aPIServiceNamespace, and an error, if there is any. -func (c *FakeAPIServiceNamespaces) Create(ctx context.Context, aPIServiceNamespace *v1alpha2.APIServiceNamespace, opts v1.CreateOptions) (result *v1alpha2.APIServiceNamespace, err error) { - emptyResult := &v1alpha2.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(apiservicenamespacesResource, c.ns, aPIServiceNamespace, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceNamespace), err -} - -// Update takes the representation of a aPIServiceNamespace and updates it. Returns the server's representation of the aPIServiceNamespace, and an error, if there is any. -func (c *FakeAPIServiceNamespaces) Update(ctx context.Context, aPIServiceNamespace *v1alpha2.APIServiceNamespace, opts v1.UpdateOptions) (result *v1alpha2.APIServiceNamespace, err error) { - emptyResult := &v1alpha2.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(apiservicenamespacesResource, c.ns, aPIServiceNamespace, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceNamespace), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceNamespaces) UpdateStatus(ctx context.Context, aPIServiceNamespace *v1alpha2.APIServiceNamespace, opts v1.UpdateOptions) (result *v1alpha2.APIServiceNamespace, err error) { - emptyResult := &v1alpha2.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(apiservicenamespacesResource, "status", c.ns, aPIServiceNamespace, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceNamespace), err -} - -// Delete takes name of the aPIServiceNamespace and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceNamespaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(apiservicenamespacesResource, c.ns, name, opts), &v1alpha2.APIServiceNamespace{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceNamespaces) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(apiservicenamespacesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.APIServiceNamespaceList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceNamespace. -func (c *FakeAPIServiceNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIServiceNamespace, err error) { - emptyResult := &v1alpha2.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiservicenamespacesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeAPIServiceNamespaces(fake *FakeKubeBindV1alpha2, namespace string) kubebindv1alpha2.APIServiceNamespaceInterface { + return &fakeAPIServiceNamespaces{ + gentype.NewFakeClientWithList[*v1alpha2.APIServiceNamespace, *v1alpha2.APIServiceNamespaceList]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("apiservicenamespaces"), + v1alpha2.SchemeGroupVersion.WithKind("APIServiceNamespace"), + func() *v1alpha2.APIServiceNamespace { return &v1alpha2.APIServiceNamespace{} }, + func() *v1alpha2.APIServiceNamespaceList { return &v1alpha2.APIServiceNamespaceList{} }, + func(dst, src *v1alpha2.APIServiceNamespaceList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.APIServiceNamespaceList) []*v1alpha2.APIServiceNamespace { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.APIServiceNamespaceList, items []*v1alpha2.APIServiceNamespace) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.APIServiceNamespace), err } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_boundapiresourceschema.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_boundapiresourceschema.go index 597797297..d91d8c8a6 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_boundapiresourceschema.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_boundapiresourceschema.go @@ -19,130 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeBoundAPIResourceSchemas implements BoundAPIResourceSchemaInterface -type FakeBoundAPIResourceSchemas struct { +// fakeBoundAPIResourceSchemas implements BoundAPIResourceSchemaInterface +type fakeBoundAPIResourceSchemas struct { + *gentype.FakeClientWithList[*v1alpha2.BoundAPIResourceSchema, *v1alpha2.BoundAPIResourceSchemaList] Fake *FakeKubeBindV1alpha2 - ns string -} - -var boundapiresourceschemasResource = v1alpha2.SchemeGroupVersion.WithResource("boundapiresourceschemas") - -var boundapiresourceschemasKind = v1alpha2.SchemeGroupVersion.WithKind("BoundAPIResourceSchema") - -// Get takes name of the boundAPIResourceSchema, and returns the corresponding boundAPIResourceSchema object, and an error if there is any. -func (c *FakeBoundAPIResourceSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BoundAPIResourceSchema, err error) { - emptyResult := &v1alpha2.BoundAPIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(boundapiresourceschemasResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BoundAPIResourceSchema), err -} - -// List takes label and field selectors, and returns the list of BoundAPIResourceSchemas that match those selectors. -func (c *FakeBoundAPIResourceSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BoundAPIResourceSchemaList, err error) { - emptyResult := &v1alpha2.BoundAPIResourceSchemaList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(boundapiresourceschemasResource, boundapiresourceschemasKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.BoundAPIResourceSchemaList{ListMeta: obj.(*v1alpha2.BoundAPIResourceSchemaList).ListMeta} - for _, item := range obj.(*v1alpha2.BoundAPIResourceSchemaList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested boundAPIResourceSchemas. -func (c *FakeBoundAPIResourceSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(boundapiresourceschemasResource, c.ns, opts)) - -} - -// Create takes the representation of a boundAPIResourceSchema and creates it. Returns the server's representation of the boundAPIResourceSchema, and an error, if there is any. -func (c *FakeBoundAPIResourceSchemas) Create(ctx context.Context, boundAPIResourceSchema *v1alpha2.BoundAPIResourceSchema, opts v1.CreateOptions) (result *v1alpha2.BoundAPIResourceSchema, err error) { - emptyResult := &v1alpha2.BoundAPIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(boundapiresourceschemasResource, c.ns, boundAPIResourceSchema, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BoundAPIResourceSchema), err -} - -// Update takes the representation of a boundAPIResourceSchema and updates it. Returns the server's representation of the boundAPIResourceSchema, and an error, if there is any. -func (c *FakeBoundAPIResourceSchemas) Update(ctx context.Context, boundAPIResourceSchema *v1alpha2.BoundAPIResourceSchema, opts v1.UpdateOptions) (result *v1alpha2.BoundAPIResourceSchema, err error) { - emptyResult := &v1alpha2.BoundAPIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(boundapiresourceschemasResource, c.ns, boundAPIResourceSchema, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BoundAPIResourceSchema), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeBoundAPIResourceSchemas) UpdateStatus(ctx context.Context, boundAPIResourceSchema *v1alpha2.BoundAPIResourceSchema, opts v1.UpdateOptions) (result *v1alpha2.BoundAPIResourceSchema, err error) { - emptyResult := &v1alpha2.BoundAPIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(boundapiresourceschemasResource, "status", c.ns, boundAPIResourceSchema, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BoundAPIResourceSchema), err -} - -// Delete takes name of the boundAPIResourceSchema and deletes it. Returns an error if one occurs. -func (c *FakeBoundAPIResourceSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(boundapiresourceschemasResource, c.ns, name, opts), &v1alpha2.BoundAPIResourceSchema{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeBoundAPIResourceSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(boundapiresourceschemasResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.BoundAPIResourceSchemaList{}) - return err -} - -// Patch applies the patch and returns the patched boundAPIResourceSchema. -func (c *FakeBoundAPIResourceSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BoundAPIResourceSchema, err error) { - emptyResult := &v1alpha2.BoundAPIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(boundapiresourceschemasResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeBoundAPIResourceSchemas(fake *FakeKubeBindV1alpha2, namespace string) kubebindv1alpha2.BoundAPIResourceSchemaInterface { + return &fakeBoundAPIResourceSchemas{ + gentype.NewFakeClientWithList[*v1alpha2.BoundAPIResourceSchema, *v1alpha2.BoundAPIResourceSchemaList]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("boundapiresourceschemas"), + v1alpha2.SchemeGroupVersion.WithKind("BoundAPIResourceSchema"), + func() *v1alpha2.BoundAPIResourceSchema { return &v1alpha2.BoundAPIResourceSchema{} }, + func() *v1alpha2.BoundAPIResourceSchemaList { return &v1alpha2.BoundAPIResourceSchemaList{} }, + func(dst, src *v1alpha2.BoundAPIResourceSchemaList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.BoundAPIResourceSchemaList) []*v1alpha2.BoundAPIResourceSchema { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.BoundAPIResourceSchemaList, items []*v1alpha2.BoundAPIResourceSchema) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.BoundAPIResourceSchema), err } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_clusterbinding.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_clusterbinding.go index 2afc19b47..03642d0b8 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_clusterbinding.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_clusterbinding.go @@ -19,130 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeClusterBindings implements ClusterBindingInterface -type FakeClusterBindings struct { +// fakeClusterBindings implements ClusterBindingInterface +type fakeClusterBindings struct { + *gentype.FakeClientWithList[*v1alpha2.ClusterBinding, *v1alpha2.ClusterBindingList] Fake *FakeKubeBindV1alpha2 - ns string -} - -var clusterbindingsResource = v1alpha2.SchemeGroupVersion.WithResource("clusterbindings") - -var clusterbindingsKind = v1alpha2.SchemeGroupVersion.WithKind("ClusterBinding") - -// Get takes name of the clusterBinding, and returns the corresponding clusterBinding object, and an error if there is any. -func (c *FakeClusterBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ClusterBinding, err error) { - emptyResult := &v1alpha2.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(clusterbindingsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ClusterBinding), err -} - -// List takes label and field selectors, and returns the list of ClusterBindings that match those selectors. -func (c *FakeClusterBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ClusterBindingList, err error) { - emptyResult := &v1alpha2.ClusterBindingList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(clusterbindingsResource, clusterbindingsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.ClusterBindingList{ListMeta: obj.(*v1alpha2.ClusterBindingList).ListMeta} - for _, item := range obj.(*v1alpha2.ClusterBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterBindings. -func (c *FakeClusterBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(clusterbindingsResource, c.ns, opts)) - -} - -// Create takes the representation of a clusterBinding and creates it. Returns the server's representation of the clusterBinding, and an error, if there is any. -func (c *FakeClusterBindings) Create(ctx context.Context, clusterBinding *v1alpha2.ClusterBinding, opts v1.CreateOptions) (result *v1alpha2.ClusterBinding, err error) { - emptyResult := &v1alpha2.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(clusterbindingsResource, c.ns, clusterBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ClusterBinding), err -} - -// Update takes the representation of a clusterBinding and updates it. Returns the server's representation of the clusterBinding, and an error, if there is any. -func (c *FakeClusterBindings) Update(ctx context.Context, clusterBinding *v1alpha2.ClusterBinding, opts v1.UpdateOptions) (result *v1alpha2.ClusterBinding, err error) { - emptyResult := &v1alpha2.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(clusterbindingsResource, c.ns, clusterBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ClusterBinding), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusterBindings) UpdateStatus(ctx context.Context, clusterBinding *v1alpha2.ClusterBinding, opts v1.UpdateOptions) (result *v1alpha2.ClusterBinding, err error) { - emptyResult := &v1alpha2.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(clusterbindingsResource, "status", c.ns, clusterBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ClusterBinding), err -} - -// Delete takes name of the clusterBinding and deletes it. Returns an error if one occurs. -func (c *FakeClusterBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(clusterbindingsResource, c.ns, name, opts), &v1alpha2.ClusterBinding{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(clusterbindingsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.ClusterBindingList{}) - return err -} - -// Patch applies the patch and returns the patched clusterBinding. -func (c *FakeClusterBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ClusterBinding, err error) { - emptyResult := &v1alpha2.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(clusterbindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeClusterBindings(fake *FakeKubeBindV1alpha2, namespace string) kubebindv1alpha2.ClusterBindingInterface { + return &fakeClusterBindings{ + gentype.NewFakeClientWithList[*v1alpha2.ClusterBinding, *v1alpha2.ClusterBindingList]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("clusterbindings"), + v1alpha2.SchemeGroupVersion.WithKind("ClusterBinding"), + func() *v1alpha2.ClusterBinding { return &v1alpha2.ClusterBinding{} }, + func() *v1alpha2.ClusterBindingList { return &v1alpha2.ClusterBindingList{} }, + func(dst, src *v1alpha2.ClusterBindingList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.ClusterBindingList) []*v1alpha2.ClusterBinding { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.ClusterBindingList, items []*v1alpha2.ClusterBinding) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.ClusterBinding), err } diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_kubebind_client.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_kubebind_client.go index b9e504d65..17853649a 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_kubebind_client.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_kubebind_client.go @@ -30,31 +30,31 @@ type FakeKubeBindV1alpha2 struct { } func (c *FakeKubeBindV1alpha2) APIResourceSchemas() v1alpha2.APIResourceSchemaInterface { - return &FakeAPIResourceSchemas{c} + return newFakeAPIResourceSchemas(c) } func (c *FakeKubeBindV1alpha2) APIServiceBindings() v1alpha2.APIServiceBindingInterface { - return &FakeAPIServiceBindings{c} + return newFakeAPIServiceBindings(c) } func (c *FakeKubeBindV1alpha2) APIServiceExports(namespace string) v1alpha2.APIServiceExportInterface { - return &FakeAPIServiceExports{c, namespace} + return newFakeAPIServiceExports(c, namespace) } func (c *FakeKubeBindV1alpha2) APIServiceExportRequests(namespace string) v1alpha2.APIServiceExportRequestInterface { - return &FakeAPIServiceExportRequests{c, namespace} + return newFakeAPIServiceExportRequests(c, namespace) } func (c *FakeKubeBindV1alpha2) APIServiceNamespaces(namespace string) v1alpha2.APIServiceNamespaceInterface { - return &FakeAPIServiceNamespaces{c, namespace} + return newFakeAPIServiceNamespaces(c, namespace) } func (c *FakeKubeBindV1alpha2) BoundAPIResourceSchemas(namespace string) v1alpha2.BoundAPIResourceSchemaInterface { - return &FakeBoundAPIResourceSchemas{c, namespace} + return newFakeBoundAPIResourceSchemas(c, namespace) } func (c *FakeKubeBindV1alpha2) ClusterBindings(namespace string) v1alpha2.ClusterBindingInterface { - return &FakeClusterBindings{c, namespace} + return newFakeClusterBindings(c, namespace) } // RESTClient returns a RESTClient that is used to communicate diff --git a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/kubebind_client.go b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/kubebind_client.go index e47702f72..cd547ba10 100644 --- a/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/kubebind_client.go +++ b/sdk/client/clientset/versioned/typed/kubebind/v1alpha2/kubebind_client.go @@ -19,12 +19,12 @@ limitations under the License. package v1alpha2 import ( - "net/http" + http "net/http" rest "k8s.io/client-go/rest" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" - "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + scheme "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned/scheme" ) type KubeBindV1alpha2Interface interface { @@ -116,10 +116,10 @@ func New(c rest.Interface) *KubeBindV1alpha2Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha2.SchemeGroupVersion + gv := kubebindv1alpha2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() diff --git a/sdk/client/informers/externalversions/generic.go b/sdk/client/informers/externalversions/generic.go index ba505b1cc..ec0f17da2 100644 --- a/sdk/client/informers/externalversions/generic.go +++ b/sdk/client/informers/externalversions/generic.go @@ -19,7 +19,7 @@ limitations under the License. package externalversions import ( - "fmt" + fmt "fmt" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" diff --git a/sdk/client/informers/externalversions/kubebind/v1alpha1/apiservicebinding.go b/sdk/client/informers/externalversions/kubebind/v1alpha1/apiservicebinding.go index 24a898b4e..a3e42a405 100644 --- a/sdk/client/informers/externalversions/kubebind/v1alpha1/apiservicebinding.go +++ b/sdk/client/informers/externalversions/kubebind/v1alpha1/apiservicebinding.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,17 +27,17 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + apiskubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" versioned "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" internalinterfaces "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha1" ) // APIServiceBindingInformer provides access to a shared informer and lister for // APIServiceBindings. type APIServiceBindingInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.APIServiceBindingLister + Lister() kubebindv1alpha1.APIServiceBindingLister } type aPIServiceBindingInformer struct { @@ -71,7 +71,7 @@ func NewFilteredAPIServiceBindingInformer(client versioned.Interface, resyncPeri return client.KubeBindV1alpha1().APIServiceBindings().Watch(context.TODO(), options) }, }, - &kubebindv1alpha1.APIServiceBinding{}, + &apiskubebindv1alpha1.APIServiceBinding{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *aPIServiceBindingInformer) defaultInformer(client versioned.Interface, } func (f *aPIServiceBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubebindv1alpha1.APIServiceBinding{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubebindv1alpha1.APIServiceBinding{}, f.defaultInformer) } -func (f *aPIServiceBindingInformer) Lister() v1alpha1.APIServiceBindingLister { - return v1alpha1.NewAPIServiceBindingLister(f.Informer().GetIndexer()) +func (f *aPIServiceBindingInformer) Lister() kubebindv1alpha1.APIServiceBindingLister { + return kubebindv1alpha1.NewAPIServiceBindingLister(f.Informer().GetIndexer()) } diff --git a/sdk/client/informers/externalversions/kubebind/v1alpha1/apiserviceexport.go b/sdk/client/informers/externalversions/kubebind/v1alpha1/apiserviceexport.go index fe4e5e2fa..fe77fb185 100644 --- a/sdk/client/informers/externalversions/kubebind/v1alpha1/apiserviceexport.go +++ b/sdk/client/informers/externalversions/kubebind/v1alpha1/apiserviceexport.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,17 +27,17 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + apiskubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" versioned "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" internalinterfaces "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha1" ) // APIServiceExportInformer provides access to a shared informer and lister for // APIServiceExports. type APIServiceExportInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.APIServiceExportLister + Lister() kubebindv1alpha1.APIServiceExportLister } type aPIServiceExportInformer struct { @@ -72,7 +72,7 @@ func NewFilteredAPIServiceExportInformer(client versioned.Interface, namespace s return client.KubeBindV1alpha1().APIServiceExports(namespace).Watch(context.TODO(), options) }, }, - &kubebindv1alpha1.APIServiceExport{}, + &apiskubebindv1alpha1.APIServiceExport{}, resyncPeriod, indexers, ) @@ -83,9 +83,9 @@ func (f *aPIServiceExportInformer) defaultInformer(client versioned.Interface, r } func (f *aPIServiceExportInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubebindv1alpha1.APIServiceExport{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubebindv1alpha1.APIServiceExport{}, f.defaultInformer) } -func (f *aPIServiceExportInformer) Lister() v1alpha1.APIServiceExportLister { - return v1alpha1.NewAPIServiceExportLister(f.Informer().GetIndexer()) +func (f *aPIServiceExportInformer) Lister() kubebindv1alpha1.APIServiceExportLister { + return kubebindv1alpha1.NewAPIServiceExportLister(f.Informer().GetIndexer()) } diff --git a/sdk/client/informers/externalversions/kubebind/v1alpha1/apiserviceexportrequest.go b/sdk/client/informers/externalversions/kubebind/v1alpha1/apiserviceexportrequest.go index 5757690b0..29218946f 100644 --- a/sdk/client/informers/externalversions/kubebind/v1alpha1/apiserviceexportrequest.go +++ b/sdk/client/informers/externalversions/kubebind/v1alpha1/apiserviceexportrequest.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,17 +27,17 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + apiskubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" versioned "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" internalinterfaces "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha1" ) // APIServiceExportRequestInformer provides access to a shared informer and lister for // APIServiceExportRequests. type APIServiceExportRequestInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.APIServiceExportRequestLister + Lister() kubebindv1alpha1.APIServiceExportRequestLister } type aPIServiceExportRequestInformer struct { @@ -72,7 +72,7 @@ func NewFilteredAPIServiceExportRequestInformer(client versioned.Interface, name return client.KubeBindV1alpha1().APIServiceExportRequests(namespace).Watch(context.TODO(), options) }, }, - &kubebindv1alpha1.APIServiceExportRequest{}, + &apiskubebindv1alpha1.APIServiceExportRequest{}, resyncPeriod, indexers, ) @@ -83,9 +83,9 @@ func (f *aPIServiceExportRequestInformer) defaultInformer(client versioned.Inter } func (f *aPIServiceExportRequestInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubebindv1alpha1.APIServiceExportRequest{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubebindv1alpha1.APIServiceExportRequest{}, f.defaultInformer) } -func (f *aPIServiceExportRequestInformer) Lister() v1alpha1.APIServiceExportRequestLister { - return v1alpha1.NewAPIServiceExportRequestLister(f.Informer().GetIndexer()) +func (f *aPIServiceExportRequestInformer) Lister() kubebindv1alpha1.APIServiceExportRequestLister { + return kubebindv1alpha1.NewAPIServiceExportRequestLister(f.Informer().GetIndexer()) } diff --git a/sdk/client/informers/externalversions/kubebind/v1alpha1/apiservicenamespace.go b/sdk/client/informers/externalversions/kubebind/v1alpha1/apiservicenamespace.go index b02cd75b5..b4a2dbd6e 100644 --- a/sdk/client/informers/externalversions/kubebind/v1alpha1/apiservicenamespace.go +++ b/sdk/client/informers/externalversions/kubebind/v1alpha1/apiservicenamespace.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,17 +27,17 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + apiskubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" versioned "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" internalinterfaces "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha1" ) // APIServiceNamespaceInformer provides access to a shared informer and lister for // APIServiceNamespaces. type APIServiceNamespaceInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.APIServiceNamespaceLister + Lister() kubebindv1alpha1.APIServiceNamespaceLister } type aPIServiceNamespaceInformer struct { @@ -72,7 +72,7 @@ func NewFilteredAPIServiceNamespaceInformer(client versioned.Interface, namespac return client.KubeBindV1alpha1().APIServiceNamespaces(namespace).Watch(context.TODO(), options) }, }, - &kubebindv1alpha1.APIServiceNamespace{}, + &apiskubebindv1alpha1.APIServiceNamespace{}, resyncPeriod, indexers, ) @@ -83,9 +83,9 @@ func (f *aPIServiceNamespaceInformer) defaultInformer(client versioned.Interface } func (f *aPIServiceNamespaceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubebindv1alpha1.APIServiceNamespace{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubebindv1alpha1.APIServiceNamespace{}, f.defaultInformer) } -func (f *aPIServiceNamespaceInformer) Lister() v1alpha1.APIServiceNamespaceLister { - return v1alpha1.NewAPIServiceNamespaceLister(f.Informer().GetIndexer()) +func (f *aPIServiceNamespaceInformer) Lister() kubebindv1alpha1.APIServiceNamespaceLister { + return kubebindv1alpha1.NewAPIServiceNamespaceLister(f.Informer().GetIndexer()) } diff --git a/sdk/client/informers/externalversions/kubebind/v1alpha1/clusterbinding.go b/sdk/client/informers/externalversions/kubebind/v1alpha1/clusterbinding.go index fa8cca98c..d289cc9da 100644 --- a/sdk/client/informers/externalversions/kubebind/v1alpha1/clusterbinding.go +++ b/sdk/client/informers/externalversions/kubebind/v1alpha1/clusterbinding.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,17 +27,17 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + apiskubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" versioned "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" internalinterfaces "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha1" ) // ClusterBindingInformer provides access to a shared informer and lister for // ClusterBindings. type ClusterBindingInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.ClusterBindingLister + Lister() kubebindv1alpha1.ClusterBindingLister } type clusterBindingInformer struct { @@ -72,7 +72,7 @@ func NewFilteredClusterBindingInformer(client versioned.Interface, namespace str return client.KubeBindV1alpha1().ClusterBindings(namespace).Watch(context.TODO(), options) }, }, - &kubebindv1alpha1.ClusterBinding{}, + &apiskubebindv1alpha1.ClusterBinding{}, resyncPeriod, indexers, ) @@ -83,9 +83,9 @@ func (f *clusterBindingInformer) defaultInformer(client versioned.Interface, res } func (f *clusterBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubebindv1alpha1.ClusterBinding{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubebindv1alpha1.ClusterBinding{}, f.defaultInformer) } -func (f *clusterBindingInformer) Lister() v1alpha1.ClusterBindingLister { - return v1alpha1.NewClusterBindingLister(f.Informer().GetIndexer()) +func (f *clusterBindingInformer) Lister() kubebindv1alpha1.ClusterBindingLister { + return kubebindv1alpha1.NewClusterBindingLister(f.Informer().GetIndexer()) } diff --git a/sdk/client/informers/externalversions/kubebind/v1alpha2/apiresourceschema.go b/sdk/client/informers/externalversions/kubebind/v1alpha2/apiresourceschema.go index 48a248c3d..733fc2855 100644 --- a/sdk/client/informers/externalversions/kubebind/v1alpha2/apiresourceschema.go +++ b/sdk/client/informers/externalversions/kubebind/v1alpha2/apiresourceschema.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,17 +27,17 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + apiskubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" versioned "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" internalinterfaces "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" ) // APIResourceSchemaInformer provides access to a shared informer and lister for // APIResourceSchemas. type APIResourceSchemaInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.APIResourceSchemaLister + Lister() kubebindv1alpha2.APIResourceSchemaLister } type aPIResourceSchemaInformer struct { @@ -71,7 +71,7 @@ func NewFilteredAPIResourceSchemaInformer(client versioned.Interface, resyncPeri return client.KubeBindV1alpha2().APIResourceSchemas().Watch(context.TODO(), options) }, }, - &kubebindv1alpha2.APIResourceSchema{}, + &apiskubebindv1alpha2.APIResourceSchema{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *aPIResourceSchemaInformer) defaultInformer(client versioned.Interface, } func (f *aPIResourceSchemaInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubebindv1alpha2.APIResourceSchema{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubebindv1alpha2.APIResourceSchema{}, f.defaultInformer) } -func (f *aPIResourceSchemaInformer) Lister() v1alpha2.APIResourceSchemaLister { - return v1alpha2.NewAPIResourceSchemaLister(f.Informer().GetIndexer()) +func (f *aPIResourceSchemaInformer) Lister() kubebindv1alpha2.APIResourceSchemaLister { + return kubebindv1alpha2.NewAPIResourceSchemaLister(f.Informer().GetIndexer()) } diff --git a/sdk/client/informers/externalversions/kubebind/v1alpha2/apiservicebinding.go b/sdk/client/informers/externalversions/kubebind/v1alpha2/apiservicebinding.go index 3fcffbae8..e4b03f488 100644 --- a/sdk/client/informers/externalversions/kubebind/v1alpha2/apiservicebinding.go +++ b/sdk/client/informers/externalversions/kubebind/v1alpha2/apiservicebinding.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,17 +27,17 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + apiskubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" versioned "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" internalinterfaces "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" ) // APIServiceBindingInformer provides access to a shared informer and lister for // APIServiceBindings. type APIServiceBindingInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.APIServiceBindingLister + Lister() kubebindv1alpha2.APIServiceBindingLister } type aPIServiceBindingInformer struct { @@ -71,7 +71,7 @@ func NewFilteredAPIServiceBindingInformer(client versioned.Interface, resyncPeri return client.KubeBindV1alpha2().APIServiceBindings().Watch(context.TODO(), options) }, }, - &kubebindv1alpha2.APIServiceBinding{}, + &apiskubebindv1alpha2.APIServiceBinding{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *aPIServiceBindingInformer) defaultInformer(client versioned.Interface, } func (f *aPIServiceBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubebindv1alpha2.APIServiceBinding{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubebindv1alpha2.APIServiceBinding{}, f.defaultInformer) } -func (f *aPIServiceBindingInformer) Lister() v1alpha2.APIServiceBindingLister { - return v1alpha2.NewAPIServiceBindingLister(f.Informer().GetIndexer()) +func (f *aPIServiceBindingInformer) Lister() kubebindv1alpha2.APIServiceBindingLister { + return kubebindv1alpha2.NewAPIServiceBindingLister(f.Informer().GetIndexer()) } diff --git a/sdk/client/informers/externalversions/kubebind/v1alpha2/apiserviceexport.go b/sdk/client/informers/externalversions/kubebind/v1alpha2/apiserviceexport.go index e1075d5b4..a66cde403 100644 --- a/sdk/client/informers/externalversions/kubebind/v1alpha2/apiserviceexport.go +++ b/sdk/client/informers/externalversions/kubebind/v1alpha2/apiserviceexport.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,17 +27,17 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + apiskubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" versioned "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" internalinterfaces "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" ) // APIServiceExportInformer provides access to a shared informer and lister for // APIServiceExports. type APIServiceExportInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.APIServiceExportLister + Lister() kubebindv1alpha2.APIServiceExportLister } type aPIServiceExportInformer struct { @@ -72,7 +72,7 @@ func NewFilteredAPIServiceExportInformer(client versioned.Interface, namespace s return client.KubeBindV1alpha2().APIServiceExports(namespace).Watch(context.TODO(), options) }, }, - &kubebindv1alpha2.APIServiceExport{}, + &apiskubebindv1alpha2.APIServiceExport{}, resyncPeriod, indexers, ) @@ -83,9 +83,9 @@ func (f *aPIServiceExportInformer) defaultInformer(client versioned.Interface, r } func (f *aPIServiceExportInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubebindv1alpha2.APIServiceExport{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubebindv1alpha2.APIServiceExport{}, f.defaultInformer) } -func (f *aPIServiceExportInformer) Lister() v1alpha2.APIServiceExportLister { - return v1alpha2.NewAPIServiceExportLister(f.Informer().GetIndexer()) +func (f *aPIServiceExportInformer) Lister() kubebindv1alpha2.APIServiceExportLister { + return kubebindv1alpha2.NewAPIServiceExportLister(f.Informer().GetIndexer()) } diff --git a/sdk/client/informers/externalversions/kubebind/v1alpha2/apiserviceexportrequest.go b/sdk/client/informers/externalversions/kubebind/v1alpha2/apiserviceexportrequest.go index e8bc50c1f..8306d7d3e 100644 --- a/sdk/client/informers/externalversions/kubebind/v1alpha2/apiserviceexportrequest.go +++ b/sdk/client/informers/externalversions/kubebind/v1alpha2/apiserviceexportrequest.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,17 +27,17 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + apiskubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" versioned "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" internalinterfaces "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" ) // APIServiceExportRequestInformer provides access to a shared informer and lister for // APIServiceExportRequests. type APIServiceExportRequestInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.APIServiceExportRequestLister + Lister() kubebindv1alpha2.APIServiceExportRequestLister } type aPIServiceExportRequestInformer struct { @@ -72,7 +72,7 @@ func NewFilteredAPIServiceExportRequestInformer(client versioned.Interface, name return client.KubeBindV1alpha2().APIServiceExportRequests(namespace).Watch(context.TODO(), options) }, }, - &kubebindv1alpha2.APIServiceExportRequest{}, + &apiskubebindv1alpha2.APIServiceExportRequest{}, resyncPeriod, indexers, ) @@ -83,9 +83,9 @@ func (f *aPIServiceExportRequestInformer) defaultInformer(client versioned.Inter } func (f *aPIServiceExportRequestInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubebindv1alpha2.APIServiceExportRequest{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubebindv1alpha2.APIServiceExportRequest{}, f.defaultInformer) } -func (f *aPIServiceExportRequestInformer) Lister() v1alpha2.APIServiceExportRequestLister { - return v1alpha2.NewAPIServiceExportRequestLister(f.Informer().GetIndexer()) +func (f *aPIServiceExportRequestInformer) Lister() kubebindv1alpha2.APIServiceExportRequestLister { + return kubebindv1alpha2.NewAPIServiceExportRequestLister(f.Informer().GetIndexer()) } diff --git a/sdk/client/informers/externalversions/kubebind/v1alpha2/apiservicenamespace.go b/sdk/client/informers/externalversions/kubebind/v1alpha2/apiservicenamespace.go index d293dfc05..60da890db 100644 --- a/sdk/client/informers/externalversions/kubebind/v1alpha2/apiservicenamespace.go +++ b/sdk/client/informers/externalversions/kubebind/v1alpha2/apiservicenamespace.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,17 +27,17 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + apiskubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" versioned "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" internalinterfaces "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" ) // APIServiceNamespaceInformer provides access to a shared informer and lister for // APIServiceNamespaces. type APIServiceNamespaceInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.APIServiceNamespaceLister + Lister() kubebindv1alpha2.APIServiceNamespaceLister } type aPIServiceNamespaceInformer struct { @@ -72,7 +72,7 @@ func NewFilteredAPIServiceNamespaceInformer(client versioned.Interface, namespac return client.KubeBindV1alpha2().APIServiceNamespaces(namespace).Watch(context.TODO(), options) }, }, - &kubebindv1alpha2.APIServiceNamespace{}, + &apiskubebindv1alpha2.APIServiceNamespace{}, resyncPeriod, indexers, ) @@ -83,9 +83,9 @@ func (f *aPIServiceNamespaceInformer) defaultInformer(client versioned.Interface } func (f *aPIServiceNamespaceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubebindv1alpha2.APIServiceNamespace{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubebindv1alpha2.APIServiceNamespace{}, f.defaultInformer) } -func (f *aPIServiceNamespaceInformer) Lister() v1alpha2.APIServiceNamespaceLister { - return v1alpha2.NewAPIServiceNamespaceLister(f.Informer().GetIndexer()) +func (f *aPIServiceNamespaceInformer) Lister() kubebindv1alpha2.APIServiceNamespaceLister { + return kubebindv1alpha2.NewAPIServiceNamespaceLister(f.Informer().GetIndexer()) } diff --git a/sdk/client/informers/externalversions/kubebind/v1alpha2/boundapiresourceschema.go b/sdk/client/informers/externalversions/kubebind/v1alpha2/boundapiresourceschema.go index 939fb9519..a8ce3b5a2 100644 --- a/sdk/client/informers/externalversions/kubebind/v1alpha2/boundapiresourceschema.go +++ b/sdk/client/informers/externalversions/kubebind/v1alpha2/boundapiresourceschema.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,17 +27,17 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + apiskubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" versioned "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" internalinterfaces "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" ) // BoundAPIResourceSchemaInformer provides access to a shared informer and lister for // BoundAPIResourceSchemas. type BoundAPIResourceSchemaInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.BoundAPIResourceSchemaLister + Lister() kubebindv1alpha2.BoundAPIResourceSchemaLister } type boundAPIResourceSchemaInformer struct { @@ -72,7 +72,7 @@ func NewFilteredBoundAPIResourceSchemaInformer(client versioned.Interface, names return client.KubeBindV1alpha2().BoundAPIResourceSchemas(namespace).Watch(context.TODO(), options) }, }, - &kubebindv1alpha2.BoundAPIResourceSchema{}, + &apiskubebindv1alpha2.BoundAPIResourceSchema{}, resyncPeriod, indexers, ) @@ -83,9 +83,9 @@ func (f *boundAPIResourceSchemaInformer) defaultInformer(client versioned.Interf } func (f *boundAPIResourceSchemaInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubebindv1alpha2.BoundAPIResourceSchema{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubebindv1alpha2.BoundAPIResourceSchema{}, f.defaultInformer) } -func (f *boundAPIResourceSchemaInformer) Lister() v1alpha2.BoundAPIResourceSchemaLister { - return v1alpha2.NewBoundAPIResourceSchemaLister(f.Informer().GetIndexer()) +func (f *boundAPIResourceSchemaInformer) Lister() kubebindv1alpha2.BoundAPIResourceSchemaLister { + return kubebindv1alpha2.NewBoundAPIResourceSchemaLister(f.Informer().GetIndexer()) } diff --git a/sdk/client/informers/externalversions/kubebind/v1alpha2/clusterbinding.go b/sdk/client/informers/externalversions/kubebind/v1alpha2/clusterbinding.go index a204f4cf6..30f5326bd 100644 --- a/sdk/client/informers/externalversions/kubebind/v1alpha2/clusterbinding.go +++ b/sdk/client/informers/externalversions/kubebind/v1alpha2/clusterbinding.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,17 +27,17 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + apiskubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" versioned "github.com/kube-bind/kube-bind/sdk/client/clientset/versioned" internalinterfaces "github.com/kube-bind/kube-bind/sdk/client/informers/externalversions/internalinterfaces" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/client/listers/kubebind/v1alpha2" ) // ClusterBindingInformer provides access to a shared informer and lister for // ClusterBindings. type ClusterBindingInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.ClusterBindingLister + Lister() kubebindv1alpha2.ClusterBindingLister } type clusterBindingInformer struct { @@ -72,7 +72,7 @@ func NewFilteredClusterBindingInformer(client versioned.Interface, namespace str return client.KubeBindV1alpha2().ClusterBindings(namespace).Watch(context.TODO(), options) }, }, - &kubebindv1alpha2.ClusterBinding{}, + &apiskubebindv1alpha2.ClusterBinding{}, resyncPeriod, indexers, ) @@ -83,9 +83,9 @@ func (f *clusterBindingInformer) defaultInformer(client versioned.Interface, res } func (f *clusterBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&kubebindv1alpha2.ClusterBinding{}, f.defaultInformer) + return f.factory.InformerFor(&apiskubebindv1alpha2.ClusterBinding{}, f.defaultInformer) } -func (f *clusterBindingInformer) Lister() v1alpha2.ClusterBindingLister { - return v1alpha2.NewClusterBindingLister(f.Informer().GetIndexer()) +func (f *clusterBindingInformer) Lister() kubebindv1alpha2.ClusterBindingLister { + return kubebindv1alpha2.NewClusterBindingLister(f.Informer().GetIndexer()) } diff --git a/sdk/client/listers/kubebind/v1alpha1/apiservicebinding.go b/sdk/client/listers/kubebind/v1alpha1/apiservicebinding.go index 8b2c404b5..b32605cfe 100644 --- a/sdk/client/listers/kubebind/v1alpha1/apiservicebinding.go +++ b/sdk/client/listers/kubebind/v1alpha1/apiservicebinding.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha1 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" ) // APIServiceBindingLister helps list APIServiceBindings. @@ -31,19 +31,19 @@ import ( type APIServiceBindingLister interface { // List lists all APIServiceBindings in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.APIServiceBinding, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha1.APIServiceBinding, err error) // Get retrieves the APIServiceBinding from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.APIServiceBinding, error) + Get(name string) (*kubebindv1alpha1.APIServiceBinding, error) APIServiceBindingListerExpansion } // aPIServiceBindingLister implements the APIServiceBindingLister interface. type aPIServiceBindingLister struct { - listers.ResourceIndexer[*v1alpha1.APIServiceBinding] + listers.ResourceIndexer[*kubebindv1alpha1.APIServiceBinding] } // NewAPIServiceBindingLister returns a new APIServiceBindingLister. func NewAPIServiceBindingLister(indexer cache.Indexer) APIServiceBindingLister { - return &aPIServiceBindingLister{listers.New[*v1alpha1.APIServiceBinding](indexer, v1alpha1.Resource("apiservicebinding"))} + return &aPIServiceBindingLister{listers.New[*kubebindv1alpha1.APIServiceBinding](indexer, kubebindv1alpha1.Resource("apiservicebinding"))} } diff --git a/sdk/client/listers/kubebind/v1alpha1/apiserviceexport.go b/sdk/client/listers/kubebind/v1alpha1/apiserviceexport.go index 6ee79ac2f..799c0f201 100644 --- a/sdk/client/listers/kubebind/v1alpha1/apiserviceexport.go +++ b/sdk/client/listers/kubebind/v1alpha1/apiserviceexport.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha1 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" ) // APIServiceExportLister helps list APIServiceExports. @@ -31,7 +31,7 @@ import ( type APIServiceExportLister interface { // List lists all APIServiceExports in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.APIServiceExport, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha1.APIServiceExport, err error) // APIServiceExports returns an object that can list and get APIServiceExports. APIServiceExports(namespace string) APIServiceExportNamespaceLister APIServiceExportListerExpansion @@ -39,17 +39,17 @@ type APIServiceExportLister interface { // aPIServiceExportLister implements the APIServiceExportLister interface. type aPIServiceExportLister struct { - listers.ResourceIndexer[*v1alpha1.APIServiceExport] + listers.ResourceIndexer[*kubebindv1alpha1.APIServiceExport] } // NewAPIServiceExportLister returns a new APIServiceExportLister. func NewAPIServiceExportLister(indexer cache.Indexer) APIServiceExportLister { - return &aPIServiceExportLister{listers.New[*v1alpha1.APIServiceExport](indexer, v1alpha1.Resource("apiserviceexport"))} + return &aPIServiceExportLister{listers.New[*kubebindv1alpha1.APIServiceExport](indexer, kubebindv1alpha1.Resource("apiserviceexport"))} } // APIServiceExports returns an object that can list and get APIServiceExports. func (s *aPIServiceExportLister) APIServiceExports(namespace string) APIServiceExportNamespaceLister { - return aPIServiceExportNamespaceLister{listers.NewNamespaced[*v1alpha1.APIServiceExport](s.ResourceIndexer, namespace)} + return aPIServiceExportNamespaceLister{listers.NewNamespaced[*kubebindv1alpha1.APIServiceExport](s.ResourceIndexer, namespace)} } // APIServiceExportNamespaceLister helps list and get APIServiceExports. @@ -57,15 +57,15 @@ func (s *aPIServiceExportLister) APIServiceExports(namespace string) APIServiceE type APIServiceExportNamespaceLister interface { // List lists all APIServiceExports in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.APIServiceExport, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha1.APIServiceExport, err error) // Get retrieves the APIServiceExport from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.APIServiceExport, error) + Get(name string) (*kubebindv1alpha1.APIServiceExport, error) APIServiceExportNamespaceListerExpansion } // aPIServiceExportNamespaceLister implements the APIServiceExportNamespaceLister // interface. type aPIServiceExportNamespaceLister struct { - listers.ResourceIndexer[*v1alpha1.APIServiceExport] + listers.ResourceIndexer[*kubebindv1alpha1.APIServiceExport] } diff --git a/sdk/client/listers/kubebind/v1alpha1/apiserviceexportrequest.go b/sdk/client/listers/kubebind/v1alpha1/apiserviceexportrequest.go index a703d1d67..4f791eb11 100644 --- a/sdk/client/listers/kubebind/v1alpha1/apiserviceexportrequest.go +++ b/sdk/client/listers/kubebind/v1alpha1/apiserviceexportrequest.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha1 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" ) // APIServiceExportRequestLister helps list APIServiceExportRequests. @@ -31,7 +31,7 @@ import ( type APIServiceExportRequestLister interface { // List lists all APIServiceExportRequests in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.APIServiceExportRequest, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha1.APIServiceExportRequest, err error) // APIServiceExportRequests returns an object that can list and get APIServiceExportRequests. APIServiceExportRequests(namespace string) APIServiceExportRequestNamespaceLister APIServiceExportRequestListerExpansion @@ -39,17 +39,17 @@ type APIServiceExportRequestLister interface { // aPIServiceExportRequestLister implements the APIServiceExportRequestLister interface. type aPIServiceExportRequestLister struct { - listers.ResourceIndexer[*v1alpha1.APIServiceExportRequest] + listers.ResourceIndexer[*kubebindv1alpha1.APIServiceExportRequest] } // NewAPIServiceExportRequestLister returns a new APIServiceExportRequestLister. func NewAPIServiceExportRequestLister(indexer cache.Indexer) APIServiceExportRequestLister { - return &aPIServiceExportRequestLister{listers.New[*v1alpha1.APIServiceExportRequest](indexer, v1alpha1.Resource("apiserviceexportrequest"))} + return &aPIServiceExportRequestLister{listers.New[*kubebindv1alpha1.APIServiceExportRequest](indexer, kubebindv1alpha1.Resource("apiserviceexportrequest"))} } // APIServiceExportRequests returns an object that can list and get APIServiceExportRequests. func (s *aPIServiceExportRequestLister) APIServiceExportRequests(namespace string) APIServiceExportRequestNamespaceLister { - return aPIServiceExportRequestNamespaceLister{listers.NewNamespaced[*v1alpha1.APIServiceExportRequest](s.ResourceIndexer, namespace)} + return aPIServiceExportRequestNamespaceLister{listers.NewNamespaced[*kubebindv1alpha1.APIServiceExportRequest](s.ResourceIndexer, namespace)} } // APIServiceExportRequestNamespaceLister helps list and get APIServiceExportRequests. @@ -57,15 +57,15 @@ func (s *aPIServiceExportRequestLister) APIServiceExportRequests(namespace strin type APIServiceExportRequestNamespaceLister interface { // List lists all APIServiceExportRequests in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.APIServiceExportRequest, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha1.APIServiceExportRequest, err error) // Get retrieves the APIServiceExportRequest from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.APIServiceExportRequest, error) + Get(name string) (*kubebindv1alpha1.APIServiceExportRequest, error) APIServiceExportRequestNamespaceListerExpansion } // aPIServiceExportRequestNamespaceLister implements the APIServiceExportRequestNamespaceLister // interface. type aPIServiceExportRequestNamespaceLister struct { - listers.ResourceIndexer[*v1alpha1.APIServiceExportRequest] + listers.ResourceIndexer[*kubebindv1alpha1.APIServiceExportRequest] } diff --git a/sdk/client/listers/kubebind/v1alpha1/apiservicenamespace.go b/sdk/client/listers/kubebind/v1alpha1/apiservicenamespace.go index 8ab5f0883..63cd5e564 100644 --- a/sdk/client/listers/kubebind/v1alpha1/apiservicenamespace.go +++ b/sdk/client/listers/kubebind/v1alpha1/apiservicenamespace.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha1 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" ) // APIServiceNamespaceLister helps list APIServiceNamespaces. @@ -31,7 +31,7 @@ import ( type APIServiceNamespaceLister interface { // List lists all APIServiceNamespaces in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.APIServiceNamespace, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha1.APIServiceNamespace, err error) // APIServiceNamespaces returns an object that can list and get APIServiceNamespaces. APIServiceNamespaces(namespace string) APIServiceNamespaceNamespaceLister APIServiceNamespaceListerExpansion @@ -39,17 +39,17 @@ type APIServiceNamespaceLister interface { // aPIServiceNamespaceLister implements the APIServiceNamespaceLister interface. type aPIServiceNamespaceLister struct { - listers.ResourceIndexer[*v1alpha1.APIServiceNamespace] + listers.ResourceIndexer[*kubebindv1alpha1.APIServiceNamespace] } // NewAPIServiceNamespaceLister returns a new APIServiceNamespaceLister. func NewAPIServiceNamespaceLister(indexer cache.Indexer) APIServiceNamespaceLister { - return &aPIServiceNamespaceLister{listers.New[*v1alpha1.APIServiceNamespace](indexer, v1alpha1.Resource("apiservicenamespace"))} + return &aPIServiceNamespaceLister{listers.New[*kubebindv1alpha1.APIServiceNamespace](indexer, kubebindv1alpha1.Resource("apiservicenamespace"))} } // APIServiceNamespaces returns an object that can list and get APIServiceNamespaces. func (s *aPIServiceNamespaceLister) APIServiceNamespaces(namespace string) APIServiceNamespaceNamespaceLister { - return aPIServiceNamespaceNamespaceLister{listers.NewNamespaced[*v1alpha1.APIServiceNamespace](s.ResourceIndexer, namespace)} + return aPIServiceNamespaceNamespaceLister{listers.NewNamespaced[*kubebindv1alpha1.APIServiceNamespace](s.ResourceIndexer, namespace)} } // APIServiceNamespaceNamespaceLister helps list and get APIServiceNamespaces. @@ -57,15 +57,15 @@ func (s *aPIServiceNamespaceLister) APIServiceNamespaces(namespace string) APISe type APIServiceNamespaceNamespaceLister interface { // List lists all APIServiceNamespaces in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.APIServiceNamespace, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha1.APIServiceNamespace, err error) // Get retrieves the APIServiceNamespace from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.APIServiceNamespace, error) + Get(name string) (*kubebindv1alpha1.APIServiceNamespace, error) APIServiceNamespaceNamespaceListerExpansion } // aPIServiceNamespaceNamespaceLister implements the APIServiceNamespaceNamespaceLister // interface. type aPIServiceNamespaceNamespaceLister struct { - listers.ResourceIndexer[*v1alpha1.APIServiceNamespace] + listers.ResourceIndexer[*kubebindv1alpha1.APIServiceNamespace] } diff --git a/sdk/client/listers/kubebind/v1alpha1/clusterbinding.go b/sdk/client/listers/kubebind/v1alpha1/clusterbinding.go index e311b567f..705f05f19 100644 --- a/sdk/client/listers/kubebind/v1alpha1/clusterbinding.go +++ b/sdk/client/listers/kubebind/v1alpha1/clusterbinding.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha1 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" ) // ClusterBindingLister helps list ClusterBindings. @@ -31,7 +31,7 @@ import ( type ClusterBindingLister interface { // List lists all ClusterBindings in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.ClusterBinding, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha1.ClusterBinding, err error) // ClusterBindings returns an object that can list and get ClusterBindings. ClusterBindings(namespace string) ClusterBindingNamespaceLister ClusterBindingListerExpansion @@ -39,17 +39,17 @@ type ClusterBindingLister interface { // clusterBindingLister implements the ClusterBindingLister interface. type clusterBindingLister struct { - listers.ResourceIndexer[*v1alpha1.ClusterBinding] + listers.ResourceIndexer[*kubebindv1alpha1.ClusterBinding] } // NewClusterBindingLister returns a new ClusterBindingLister. func NewClusterBindingLister(indexer cache.Indexer) ClusterBindingLister { - return &clusterBindingLister{listers.New[*v1alpha1.ClusterBinding](indexer, v1alpha1.Resource("clusterbinding"))} + return &clusterBindingLister{listers.New[*kubebindv1alpha1.ClusterBinding](indexer, kubebindv1alpha1.Resource("clusterbinding"))} } // ClusterBindings returns an object that can list and get ClusterBindings. func (s *clusterBindingLister) ClusterBindings(namespace string) ClusterBindingNamespaceLister { - return clusterBindingNamespaceLister{listers.NewNamespaced[*v1alpha1.ClusterBinding](s.ResourceIndexer, namespace)} + return clusterBindingNamespaceLister{listers.NewNamespaced[*kubebindv1alpha1.ClusterBinding](s.ResourceIndexer, namespace)} } // ClusterBindingNamespaceLister helps list and get ClusterBindings. @@ -57,15 +57,15 @@ func (s *clusterBindingLister) ClusterBindings(namespace string) ClusterBindingN type ClusterBindingNamespaceLister interface { // List lists all ClusterBindings in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.ClusterBinding, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha1.ClusterBinding, err error) // Get retrieves the ClusterBinding from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.ClusterBinding, error) + Get(name string) (*kubebindv1alpha1.ClusterBinding, error) ClusterBindingNamespaceListerExpansion } // clusterBindingNamespaceLister implements the ClusterBindingNamespaceLister // interface. type clusterBindingNamespaceLister struct { - listers.ResourceIndexer[*v1alpha1.ClusterBinding] + listers.ResourceIndexer[*kubebindv1alpha1.ClusterBinding] } diff --git a/sdk/client/listers/kubebind/v1alpha2/apiresourceschema.go b/sdk/client/listers/kubebind/v1alpha2/apiresourceschema.go index f85a54dd9..06d40f0d4 100644 --- a/sdk/client/listers/kubebind/v1alpha2/apiresourceschema.go +++ b/sdk/client/listers/kubebind/v1alpha2/apiresourceschema.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" ) // APIResourceSchemaLister helps list APIResourceSchemas. @@ -31,19 +31,19 @@ import ( type APIResourceSchemaLister interface { // List lists all APIResourceSchemas in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.APIResourceSchema, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha2.APIResourceSchema, err error) // Get retrieves the APIResourceSchema from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.APIResourceSchema, error) + Get(name string) (*kubebindv1alpha2.APIResourceSchema, error) APIResourceSchemaListerExpansion } // aPIResourceSchemaLister implements the APIResourceSchemaLister interface. type aPIResourceSchemaLister struct { - listers.ResourceIndexer[*v1alpha2.APIResourceSchema] + listers.ResourceIndexer[*kubebindv1alpha2.APIResourceSchema] } // NewAPIResourceSchemaLister returns a new APIResourceSchemaLister. func NewAPIResourceSchemaLister(indexer cache.Indexer) APIResourceSchemaLister { - return &aPIResourceSchemaLister{listers.New[*v1alpha2.APIResourceSchema](indexer, v1alpha2.Resource("apiresourceschema"))} + return &aPIResourceSchemaLister{listers.New[*kubebindv1alpha2.APIResourceSchema](indexer, kubebindv1alpha2.Resource("apiresourceschema"))} } diff --git a/sdk/client/listers/kubebind/v1alpha2/apiservicebinding.go b/sdk/client/listers/kubebind/v1alpha2/apiservicebinding.go index 04daf494b..bcd96b4c1 100644 --- a/sdk/client/listers/kubebind/v1alpha2/apiservicebinding.go +++ b/sdk/client/listers/kubebind/v1alpha2/apiservicebinding.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" ) // APIServiceBindingLister helps list APIServiceBindings. @@ -31,19 +31,19 @@ import ( type APIServiceBindingLister interface { // List lists all APIServiceBindings in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.APIServiceBinding, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha2.APIServiceBinding, err error) // Get retrieves the APIServiceBinding from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.APIServiceBinding, error) + Get(name string) (*kubebindv1alpha2.APIServiceBinding, error) APIServiceBindingListerExpansion } // aPIServiceBindingLister implements the APIServiceBindingLister interface. type aPIServiceBindingLister struct { - listers.ResourceIndexer[*v1alpha2.APIServiceBinding] + listers.ResourceIndexer[*kubebindv1alpha2.APIServiceBinding] } // NewAPIServiceBindingLister returns a new APIServiceBindingLister. func NewAPIServiceBindingLister(indexer cache.Indexer) APIServiceBindingLister { - return &aPIServiceBindingLister{listers.New[*v1alpha2.APIServiceBinding](indexer, v1alpha2.Resource("apiservicebinding"))} + return &aPIServiceBindingLister{listers.New[*kubebindv1alpha2.APIServiceBinding](indexer, kubebindv1alpha2.Resource("apiservicebinding"))} } diff --git a/sdk/client/listers/kubebind/v1alpha2/apiserviceexport.go b/sdk/client/listers/kubebind/v1alpha2/apiserviceexport.go index 9496a5eff..ae6c53dc9 100644 --- a/sdk/client/listers/kubebind/v1alpha2/apiserviceexport.go +++ b/sdk/client/listers/kubebind/v1alpha2/apiserviceexport.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" ) // APIServiceExportLister helps list APIServiceExports. @@ -31,7 +31,7 @@ import ( type APIServiceExportLister interface { // List lists all APIServiceExports in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.APIServiceExport, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha2.APIServiceExport, err error) // APIServiceExports returns an object that can list and get APIServiceExports. APIServiceExports(namespace string) APIServiceExportNamespaceLister APIServiceExportListerExpansion @@ -39,17 +39,17 @@ type APIServiceExportLister interface { // aPIServiceExportLister implements the APIServiceExportLister interface. type aPIServiceExportLister struct { - listers.ResourceIndexer[*v1alpha2.APIServiceExport] + listers.ResourceIndexer[*kubebindv1alpha2.APIServiceExport] } // NewAPIServiceExportLister returns a new APIServiceExportLister. func NewAPIServiceExportLister(indexer cache.Indexer) APIServiceExportLister { - return &aPIServiceExportLister{listers.New[*v1alpha2.APIServiceExport](indexer, v1alpha2.Resource("apiserviceexport"))} + return &aPIServiceExportLister{listers.New[*kubebindv1alpha2.APIServiceExport](indexer, kubebindv1alpha2.Resource("apiserviceexport"))} } // APIServiceExports returns an object that can list and get APIServiceExports. func (s *aPIServiceExportLister) APIServiceExports(namespace string) APIServiceExportNamespaceLister { - return aPIServiceExportNamespaceLister{listers.NewNamespaced[*v1alpha2.APIServiceExport](s.ResourceIndexer, namespace)} + return aPIServiceExportNamespaceLister{listers.NewNamespaced[*kubebindv1alpha2.APIServiceExport](s.ResourceIndexer, namespace)} } // APIServiceExportNamespaceLister helps list and get APIServiceExports. @@ -57,15 +57,15 @@ func (s *aPIServiceExportLister) APIServiceExports(namespace string) APIServiceE type APIServiceExportNamespaceLister interface { // List lists all APIServiceExports in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.APIServiceExport, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha2.APIServiceExport, err error) // Get retrieves the APIServiceExport from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.APIServiceExport, error) + Get(name string) (*kubebindv1alpha2.APIServiceExport, error) APIServiceExportNamespaceListerExpansion } // aPIServiceExportNamespaceLister implements the APIServiceExportNamespaceLister // interface. type aPIServiceExportNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.APIServiceExport] + listers.ResourceIndexer[*kubebindv1alpha2.APIServiceExport] } diff --git a/sdk/client/listers/kubebind/v1alpha2/apiserviceexportrequest.go b/sdk/client/listers/kubebind/v1alpha2/apiserviceexportrequest.go index 10c93b545..c9b6f907e 100644 --- a/sdk/client/listers/kubebind/v1alpha2/apiserviceexportrequest.go +++ b/sdk/client/listers/kubebind/v1alpha2/apiserviceexportrequest.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" ) // APIServiceExportRequestLister helps list APIServiceExportRequests. @@ -31,7 +31,7 @@ import ( type APIServiceExportRequestLister interface { // List lists all APIServiceExportRequests in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.APIServiceExportRequest, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha2.APIServiceExportRequest, err error) // APIServiceExportRequests returns an object that can list and get APIServiceExportRequests. APIServiceExportRequests(namespace string) APIServiceExportRequestNamespaceLister APIServiceExportRequestListerExpansion @@ -39,17 +39,17 @@ type APIServiceExportRequestLister interface { // aPIServiceExportRequestLister implements the APIServiceExportRequestLister interface. type aPIServiceExportRequestLister struct { - listers.ResourceIndexer[*v1alpha2.APIServiceExportRequest] + listers.ResourceIndexer[*kubebindv1alpha2.APIServiceExportRequest] } // NewAPIServiceExportRequestLister returns a new APIServiceExportRequestLister. func NewAPIServiceExportRequestLister(indexer cache.Indexer) APIServiceExportRequestLister { - return &aPIServiceExportRequestLister{listers.New[*v1alpha2.APIServiceExportRequest](indexer, v1alpha2.Resource("apiserviceexportrequest"))} + return &aPIServiceExportRequestLister{listers.New[*kubebindv1alpha2.APIServiceExportRequest](indexer, kubebindv1alpha2.Resource("apiserviceexportrequest"))} } // APIServiceExportRequests returns an object that can list and get APIServiceExportRequests. func (s *aPIServiceExportRequestLister) APIServiceExportRequests(namespace string) APIServiceExportRequestNamespaceLister { - return aPIServiceExportRequestNamespaceLister{listers.NewNamespaced[*v1alpha2.APIServiceExportRequest](s.ResourceIndexer, namespace)} + return aPIServiceExportRequestNamespaceLister{listers.NewNamespaced[*kubebindv1alpha2.APIServiceExportRequest](s.ResourceIndexer, namespace)} } // APIServiceExportRequestNamespaceLister helps list and get APIServiceExportRequests. @@ -57,15 +57,15 @@ func (s *aPIServiceExportRequestLister) APIServiceExportRequests(namespace strin type APIServiceExportRequestNamespaceLister interface { // List lists all APIServiceExportRequests in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.APIServiceExportRequest, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha2.APIServiceExportRequest, err error) // Get retrieves the APIServiceExportRequest from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.APIServiceExportRequest, error) + Get(name string) (*kubebindv1alpha2.APIServiceExportRequest, error) APIServiceExportRequestNamespaceListerExpansion } // aPIServiceExportRequestNamespaceLister implements the APIServiceExportRequestNamespaceLister // interface. type aPIServiceExportRequestNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.APIServiceExportRequest] + listers.ResourceIndexer[*kubebindv1alpha2.APIServiceExportRequest] } diff --git a/sdk/client/listers/kubebind/v1alpha2/apiservicenamespace.go b/sdk/client/listers/kubebind/v1alpha2/apiservicenamespace.go index 4dfdaa3a7..50c485796 100644 --- a/sdk/client/listers/kubebind/v1alpha2/apiservicenamespace.go +++ b/sdk/client/listers/kubebind/v1alpha2/apiservicenamespace.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" ) // APIServiceNamespaceLister helps list APIServiceNamespaces. @@ -31,7 +31,7 @@ import ( type APIServiceNamespaceLister interface { // List lists all APIServiceNamespaces in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.APIServiceNamespace, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha2.APIServiceNamespace, err error) // APIServiceNamespaces returns an object that can list and get APIServiceNamespaces. APIServiceNamespaces(namespace string) APIServiceNamespaceNamespaceLister APIServiceNamespaceListerExpansion @@ -39,17 +39,17 @@ type APIServiceNamespaceLister interface { // aPIServiceNamespaceLister implements the APIServiceNamespaceLister interface. type aPIServiceNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.APIServiceNamespace] + listers.ResourceIndexer[*kubebindv1alpha2.APIServiceNamespace] } // NewAPIServiceNamespaceLister returns a new APIServiceNamespaceLister. func NewAPIServiceNamespaceLister(indexer cache.Indexer) APIServiceNamespaceLister { - return &aPIServiceNamespaceLister{listers.New[*v1alpha2.APIServiceNamespace](indexer, v1alpha2.Resource("apiservicenamespace"))} + return &aPIServiceNamespaceLister{listers.New[*kubebindv1alpha2.APIServiceNamespace](indexer, kubebindv1alpha2.Resource("apiservicenamespace"))} } // APIServiceNamespaces returns an object that can list and get APIServiceNamespaces. func (s *aPIServiceNamespaceLister) APIServiceNamespaces(namespace string) APIServiceNamespaceNamespaceLister { - return aPIServiceNamespaceNamespaceLister{listers.NewNamespaced[*v1alpha2.APIServiceNamespace](s.ResourceIndexer, namespace)} + return aPIServiceNamespaceNamespaceLister{listers.NewNamespaced[*kubebindv1alpha2.APIServiceNamespace](s.ResourceIndexer, namespace)} } // APIServiceNamespaceNamespaceLister helps list and get APIServiceNamespaces. @@ -57,15 +57,15 @@ func (s *aPIServiceNamespaceLister) APIServiceNamespaces(namespace string) APISe type APIServiceNamespaceNamespaceLister interface { // List lists all APIServiceNamespaces in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.APIServiceNamespace, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha2.APIServiceNamespace, err error) // Get retrieves the APIServiceNamespace from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.APIServiceNamespace, error) + Get(name string) (*kubebindv1alpha2.APIServiceNamespace, error) APIServiceNamespaceNamespaceListerExpansion } // aPIServiceNamespaceNamespaceLister implements the APIServiceNamespaceNamespaceLister // interface. type aPIServiceNamespaceNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.APIServiceNamespace] + listers.ResourceIndexer[*kubebindv1alpha2.APIServiceNamespace] } diff --git a/sdk/client/listers/kubebind/v1alpha2/boundapiresourceschema.go b/sdk/client/listers/kubebind/v1alpha2/boundapiresourceschema.go index b0d3a919a..595e1536f 100644 --- a/sdk/client/listers/kubebind/v1alpha2/boundapiresourceschema.go +++ b/sdk/client/listers/kubebind/v1alpha2/boundapiresourceschema.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" ) // BoundAPIResourceSchemaLister helps list BoundAPIResourceSchemas. @@ -31,7 +31,7 @@ import ( type BoundAPIResourceSchemaLister interface { // List lists all BoundAPIResourceSchemas in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.BoundAPIResourceSchema, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha2.BoundAPIResourceSchema, err error) // BoundAPIResourceSchemas returns an object that can list and get BoundAPIResourceSchemas. BoundAPIResourceSchemas(namespace string) BoundAPIResourceSchemaNamespaceLister BoundAPIResourceSchemaListerExpansion @@ -39,17 +39,17 @@ type BoundAPIResourceSchemaLister interface { // boundAPIResourceSchemaLister implements the BoundAPIResourceSchemaLister interface. type boundAPIResourceSchemaLister struct { - listers.ResourceIndexer[*v1alpha2.BoundAPIResourceSchema] + listers.ResourceIndexer[*kubebindv1alpha2.BoundAPIResourceSchema] } // NewBoundAPIResourceSchemaLister returns a new BoundAPIResourceSchemaLister. func NewBoundAPIResourceSchemaLister(indexer cache.Indexer) BoundAPIResourceSchemaLister { - return &boundAPIResourceSchemaLister{listers.New[*v1alpha2.BoundAPIResourceSchema](indexer, v1alpha2.Resource("boundapiresourceschema"))} + return &boundAPIResourceSchemaLister{listers.New[*kubebindv1alpha2.BoundAPIResourceSchema](indexer, kubebindv1alpha2.Resource("boundapiresourceschema"))} } // BoundAPIResourceSchemas returns an object that can list and get BoundAPIResourceSchemas. func (s *boundAPIResourceSchemaLister) BoundAPIResourceSchemas(namespace string) BoundAPIResourceSchemaNamespaceLister { - return boundAPIResourceSchemaNamespaceLister{listers.NewNamespaced[*v1alpha2.BoundAPIResourceSchema](s.ResourceIndexer, namespace)} + return boundAPIResourceSchemaNamespaceLister{listers.NewNamespaced[*kubebindv1alpha2.BoundAPIResourceSchema](s.ResourceIndexer, namespace)} } // BoundAPIResourceSchemaNamespaceLister helps list and get BoundAPIResourceSchemas. @@ -57,15 +57,15 @@ func (s *boundAPIResourceSchemaLister) BoundAPIResourceSchemas(namespace string) type BoundAPIResourceSchemaNamespaceLister interface { // List lists all BoundAPIResourceSchemas in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.BoundAPIResourceSchema, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha2.BoundAPIResourceSchema, err error) // Get retrieves the BoundAPIResourceSchema from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.BoundAPIResourceSchema, error) + Get(name string) (*kubebindv1alpha2.BoundAPIResourceSchema, error) BoundAPIResourceSchemaNamespaceListerExpansion } // boundAPIResourceSchemaNamespaceLister implements the BoundAPIResourceSchemaNamespaceLister // interface. type boundAPIResourceSchemaNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.BoundAPIResourceSchema] + listers.ResourceIndexer[*kubebindv1alpha2.BoundAPIResourceSchema] } diff --git a/sdk/client/listers/kubebind/v1alpha2/clusterbinding.go b/sdk/client/listers/kubebind/v1alpha2/clusterbinding.go index 211872ab4..6e83c3862 100644 --- a/sdk/client/listers/kubebind/v1alpha2/clusterbinding.go +++ b/sdk/client/listers/kubebind/v1alpha2/clusterbinding.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" ) // ClusterBindingLister helps list ClusterBindings. @@ -31,7 +31,7 @@ import ( type ClusterBindingLister interface { // List lists all ClusterBindings in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ClusterBinding, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha2.ClusterBinding, err error) // ClusterBindings returns an object that can list and get ClusterBindings. ClusterBindings(namespace string) ClusterBindingNamespaceLister ClusterBindingListerExpansion @@ -39,17 +39,17 @@ type ClusterBindingLister interface { // clusterBindingLister implements the ClusterBindingLister interface. type clusterBindingLister struct { - listers.ResourceIndexer[*v1alpha2.ClusterBinding] + listers.ResourceIndexer[*kubebindv1alpha2.ClusterBinding] } // NewClusterBindingLister returns a new ClusterBindingLister. func NewClusterBindingLister(indexer cache.Indexer) ClusterBindingLister { - return &clusterBindingLister{listers.New[*v1alpha2.ClusterBinding](indexer, v1alpha2.Resource("clusterbinding"))} + return &clusterBindingLister{listers.New[*kubebindv1alpha2.ClusterBinding](indexer, kubebindv1alpha2.Resource("clusterbinding"))} } // ClusterBindings returns an object that can list and get ClusterBindings. func (s *clusterBindingLister) ClusterBindings(namespace string) ClusterBindingNamespaceLister { - return clusterBindingNamespaceLister{listers.NewNamespaced[*v1alpha2.ClusterBinding](s.ResourceIndexer, namespace)} + return clusterBindingNamespaceLister{listers.NewNamespaced[*kubebindv1alpha2.ClusterBinding](s.ResourceIndexer, namespace)} } // ClusterBindingNamespaceLister helps list and get ClusterBindings. @@ -57,15 +57,15 @@ func (s *clusterBindingLister) ClusterBindings(namespace string) ClusterBindingN type ClusterBindingNamespaceLister interface { // List lists all ClusterBindings in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ClusterBinding, err error) + List(selector labels.Selector) (ret []*kubebindv1alpha2.ClusterBinding, err error) // Get retrieves the ClusterBinding from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ClusterBinding, error) + Get(name string) (*kubebindv1alpha2.ClusterBinding, error) ClusterBindingNamespaceListerExpansion } // clusterBindingNamespaceLister implements the ClusterBindingNamespaceLister // interface. type clusterBindingNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.ClusterBinding] + listers.ResourceIndexer[*kubebindv1alpha2.ClusterBinding] } diff --git a/sdk/kcp/applyconfiguration/conditions/v1alpha1/condition.go b/sdk/kcp/applyconfiguration/conditions/v1alpha1/condition.go index f45255ab2..068fa78b9 100644 --- a/sdk/kcp/applyconfiguration/conditions/v1alpha1/condition.go +++ b/sdk/kcp/applyconfiguration/conditions/v1alpha1/condition.go @@ -22,18 +22,18 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/third_party/conditions/apis/conditions/v1alpha1" + conditionsv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/third_party/conditions/apis/conditions/v1alpha1" ) // ConditionApplyConfiguration represents a declarative configuration of the Condition type for use // with apply. type ConditionApplyConfiguration struct { - Type *v1alpha1.ConditionType `json:"type,omitempty"` - Status *v1.ConditionStatus `json:"status,omitempty"` - Severity *v1alpha1.ConditionSeverity `json:"severity,omitempty"` - LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` - Reason *string `json:"reason,omitempty"` - Message *string `json:"message,omitempty"` + Type *conditionsv1alpha1.ConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + Severity *conditionsv1alpha1.ConditionSeverity `json:"severity,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` } // ConditionApplyConfiguration constructs a declarative configuration of the Condition type for use with @@ -45,7 +45,7 @@ func Condition() *ConditionApplyConfiguration { // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. -func (b *ConditionApplyConfiguration) WithType(value v1alpha1.ConditionType) *ConditionApplyConfiguration { +func (b *ConditionApplyConfiguration) WithType(value conditionsv1alpha1.ConditionType) *ConditionApplyConfiguration { b.Type = &value return b } @@ -61,7 +61,7 @@ func (b *ConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *Cond // WithSeverity sets the Severity field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Severity field is set to the value of the last call. -func (b *ConditionApplyConfiguration) WithSeverity(value v1alpha1.ConditionSeverity) *ConditionApplyConfiguration { +func (b *ConditionApplyConfiguration) WithSeverity(value conditionsv1alpha1.ConditionSeverity) *ConditionApplyConfiguration { b.Severity = &value return b } diff --git a/sdk/kcp/applyconfiguration/internal/internal.go b/sdk/kcp/applyconfiguration/internal/internal.go index 6ddb044e2..b36ddc7d9 100644 --- a/sdk/kcp/applyconfiguration/internal/internal.go +++ b/sdk/kcp/applyconfiguration/internal/internal.go @@ -19,8 +19,8 @@ limitations under the License. package internal import ( - "fmt" - "sync" + fmt "fmt" + sync "sync" typed "sigs.k8s.io/structured-merge-diff/v4/typed" ) diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiservicebinding.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiservicebinding.go index 5bbe9852b..57bb9321a 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiservicebinding.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiservicebinding.go @@ -48,7 +48,7 @@ func APIServiceBinding(name string) *APIServiceBindingApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithKind(value string) *APIServiceBindingApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -56,7 +56,7 @@ func (b *APIServiceBindingApplyConfiguration) WithKind(value string) *APIService // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithAPIVersion(value string) *APIServiceBindingApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -65,7 +65,7 @@ func (b *APIServiceBindingApplyConfiguration) WithAPIVersion(value string) *APIS // If called multiple times, the Name field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithName(value string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -74,7 +74,7 @@ func (b *APIServiceBindingApplyConfiguration) WithName(value string) *APIService // If called multiple times, the GenerateName field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithGenerateName(value string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -83,7 +83,7 @@ func (b *APIServiceBindingApplyConfiguration) WithGenerateName(value string) *AP // If called multiple times, the Namespace field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithNamespace(value string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -92,7 +92,7 @@ func (b *APIServiceBindingApplyConfiguration) WithNamespace(value string) *APISe // If called multiple times, the UID field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithUID(value types.UID) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -101,7 +101,7 @@ func (b *APIServiceBindingApplyConfiguration) WithUID(value types.UID) *APIServi // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithResourceVersion(value string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -110,7 +110,7 @@ func (b *APIServiceBindingApplyConfiguration) WithResourceVersion(value string) // If called multiple times, the Generation field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithGeneration(value int64) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -119,7 +119,7 @@ func (b *APIServiceBindingApplyConfiguration) WithGeneration(value int64) *APISe // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -128,7 +128,7 @@ func (b *APIServiceBindingApplyConfiguration) WithCreationTimestamp(value metav1 // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -137,7 +137,7 @@ func (b *APIServiceBindingApplyConfiguration) WithDeletionTimestamp(value metav1 // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -147,11 +147,11 @@ func (b *APIServiceBindingApplyConfiguration) WithDeletionGracePeriodSeconds(val // overwriting an existing map entries in Labels field with the same key. func (b *APIServiceBindingApplyConfiguration) WithLabels(entries map[string]string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -162,11 +162,11 @@ func (b *APIServiceBindingApplyConfiguration) WithLabels(entries map[string]stri // overwriting an existing map entries in Annotations field with the same key. func (b *APIServiceBindingApplyConfiguration) WithAnnotations(entries map[string]string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -180,7 +180,7 @@ func (b *APIServiceBindingApplyConfiguration) WithOwnerReferences(values ...*v1. if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -191,7 +191,7 @@ func (b *APIServiceBindingApplyConfiguration) WithOwnerReferences(values ...*v1. func (b *APIServiceBindingApplyConfiguration) WithFinalizers(values ...string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -221,5 +221,5 @@ func (b *APIServiceBindingApplyConfiguration) WithStatus(value *APIServiceBindin // GetName retrieves the value of the Name field in the declarative configuration. func (b *APIServiceBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiservicebindingstatus.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiservicebindingstatus.go index 40005f459..39c1b3545 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiservicebindingstatus.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiservicebindingstatus.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/third_party/conditions/apis/conditions/v1alpha1" + conditionsv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/third_party/conditions/apis/conditions/v1alpha1" ) // APIServiceBindingStatusApplyConfiguration represents a declarative configuration of the APIServiceBindingStatus type for use // with apply. type APIServiceBindingStatusApplyConfiguration struct { - ProviderPrettyName *string `json:"providerPrettyName,omitempty"` - Conditions *v1alpha1.Conditions `json:"conditions,omitempty"` + ProviderPrettyName *string `json:"providerPrettyName,omitempty"` + Conditions *conditionsv1alpha1.Conditions `json:"conditions,omitempty"` } // APIServiceBindingStatusApplyConfiguration constructs a declarative configuration of the APIServiceBindingStatus type for use with @@ -46,7 +46,7 @@ func (b *APIServiceBindingStatusApplyConfiguration) WithProviderPrettyName(value // WithConditions sets the Conditions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Conditions field is set to the value of the last call. -func (b *APIServiceBindingStatusApplyConfiguration) WithConditions(value v1alpha1.Conditions) *APIServiceBindingStatusApplyConfiguration { +func (b *APIServiceBindingStatusApplyConfiguration) WithConditions(value conditionsv1alpha1.Conditions) *APIServiceBindingStatusApplyConfiguration { b.Conditions = &value return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexport.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexport.go index 911880abc..390b0121f 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexport.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexport.go @@ -49,7 +49,7 @@ func APIServiceExport(name, namespace string) *APIServiceExportApplyConfiguratio // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithKind(value string) *APIServiceExportApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -57,7 +57,7 @@ func (b *APIServiceExportApplyConfiguration) WithKind(value string) *APIServiceE // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithAPIVersion(value string) *APIServiceExportApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -66,7 +66,7 @@ func (b *APIServiceExportApplyConfiguration) WithAPIVersion(value string) *APISe // If called multiple times, the Name field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithName(value string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -75,7 +75,7 @@ func (b *APIServiceExportApplyConfiguration) WithName(value string) *APIServiceE // If called multiple times, the GenerateName field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithGenerateName(value string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -84,7 +84,7 @@ func (b *APIServiceExportApplyConfiguration) WithGenerateName(value string) *API // If called multiple times, the Namespace field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithNamespace(value string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -93,7 +93,7 @@ func (b *APIServiceExportApplyConfiguration) WithNamespace(value string) *APISer // If called multiple times, the UID field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithUID(value types.UID) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -102,7 +102,7 @@ func (b *APIServiceExportApplyConfiguration) WithUID(value types.UID) *APIServic // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithResourceVersion(value string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -111,7 +111,7 @@ func (b *APIServiceExportApplyConfiguration) WithResourceVersion(value string) * // If called multiple times, the Generation field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithGeneration(value int64) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -120,7 +120,7 @@ func (b *APIServiceExportApplyConfiguration) WithGeneration(value int64) *APISer // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithCreationTimestamp(value metav1.Time) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -129,7 +129,7 @@ func (b *APIServiceExportApplyConfiguration) WithCreationTimestamp(value metav1. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -138,7 +138,7 @@ func (b *APIServiceExportApplyConfiguration) WithDeletionTimestamp(value metav1. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -148,11 +148,11 @@ func (b *APIServiceExportApplyConfiguration) WithDeletionGracePeriodSeconds(valu // overwriting an existing map entries in Labels field with the same key. func (b *APIServiceExportApplyConfiguration) WithLabels(entries map[string]string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -163,11 +163,11 @@ func (b *APIServiceExportApplyConfiguration) WithLabels(entries map[string]strin // overwriting an existing map entries in Annotations field with the same key. func (b *APIServiceExportApplyConfiguration) WithAnnotations(entries map[string]string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -181,7 +181,7 @@ func (b *APIServiceExportApplyConfiguration) WithOwnerReferences(values ...*v1.O if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -192,7 +192,7 @@ func (b *APIServiceExportApplyConfiguration) WithOwnerReferences(values ...*v1.O func (b *APIServiceExportApplyConfiguration) WithFinalizers(values ...string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -222,5 +222,5 @@ func (b *APIServiceExportApplyConfiguration) WithStatus(value *APIServiceExportS // GetName retrieves the value of the Name field in the declarative configuration. func (b *APIServiceExportApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportrequest.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportrequest.go index 4f8c861e3..a5777c587 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportrequest.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportrequest.go @@ -49,7 +49,7 @@ func APIServiceExportRequest(name, namespace string) *APIServiceExportRequestApp // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithKind(value string) *APIServiceExportRequestApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -57,7 +57,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithKind(value string) *APIS // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithAPIVersion(value string) *APIServiceExportRequestApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -66,7 +66,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithAPIVersion(value string) // If called multiple times, the Name field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithName(value string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -75,7 +75,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithName(value string) *APIS // If called multiple times, the GenerateName field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithGenerateName(value string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -84,7 +84,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithGenerateName(value strin // If called multiple times, the Namespace field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithNamespace(value string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -93,7 +93,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithNamespace(value string) // If called multiple times, the UID field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithUID(value types.UID) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -102,7 +102,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithUID(value types.UID) *AP // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithResourceVersion(value string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -111,7 +111,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithResourceVersion(value st // If called multiple times, the Generation field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithGeneration(value int64) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -120,7 +120,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithGeneration(value int64) // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithCreationTimestamp(value metav1.Time) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -129,7 +129,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithCreationTimestamp(value // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -138,7 +138,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithDeletionTimestamp(value // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -148,11 +148,11 @@ func (b *APIServiceExportRequestApplyConfiguration) WithDeletionGracePeriodSecon // overwriting an existing map entries in Labels field with the same key. func (b *APIServiceExportRequestApplyConfiguration) WithLabels(entries map[string]string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -163,11 +163,11 @@ func (b *APIServiceExportRequestApplyConfiguration) WithLabels(entries map[strin // overwriting an existing map entries in Annotations field with the same key. func (b *APIServiceExportRequestApplyConfiguration) WithAnnotations(entries map[string]string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -181,7 +181,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithOwnerReferences(values . if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -192,7 +192,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithOwnerReferences(values . func (b *APIServiceExportRequestApplyConfiguration) WithFinalizers(values ...string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -222,5 +222,5 @@ func (b *APIServiceExportRequestApplyConfiguration) WithStatus(value *APIService // GetName retrieves the value of the Name field in the declarative configuration. func (b *APIServiceExportRequestApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportrequestresource.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportrequestresource.go index 06ebcff2e..07d3fbdd8 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportrequestresource.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportrequestresource.go @@ -35,7 +35,7 @@ func APIServiceExportRequestResource() *APIServiceExportRequestResourceApplyConf // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *APIServiceExportRequestResourceApplyConfiguration) WithGroup(value string) *APIServiceExportRequestResourceApplyConfiguration { - b.Group = &value + b.GroupResourceApplyConfiguration.Group = &value return b } @@ -43,7 +43,7 @@ func (b *APIServiceExportRequestResourceApplyConfiguration) WithGroup(value stri // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *APIServiceExportRequestResourceApplyConfiguration) WithResource(value string) *APIServiceExportRequestResourceApplyConfiguration { - b.Resource = &value + b.GroupResourceApplyConfiguration.Resource = &value return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportrequeststatus.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportrequeststatus.go index 3d4936790..6bee9da58 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportrequeststatus.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportrequeststatus.go @@ -19,16 +19,16 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" conditionsv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/third_party/conditions/apis/conditions/v1alpha1" ) // APIServiceExportRequestStatusApplyConfiguration represents a declarative configuration of the APIServiceExportRequestStatus type for use // with apply. type APIServiceExportRequestStatusApplyConfiguration struct { - Phase *v1alpha1.APIServiceExportRequestPhase `json:"phase,omitempty"` - TerminalMessage *string `json:"terminalMessage,omitempty"` - Conditions *conditionsv1alpha1.Conditions `json:"conditions,omitempty"` + Phase *kubebindv1alpha1.APIServiceExportRequestPhase `json:"phase,omitempty"` + TerminalMessage *string `json:"terminalMessage,omitempty"` + Conditions *conditionsv1alpha1.Conditions `json:"conditions,omitempty"` } // APIServiceExportRequestStatusApplyConfiguration constructs a declarative configuration of the APIServiceExportRequestStatus type for use with @@ -40,7 +40,7 @@ func APIServiceExportRequestStatus() *APIServiceExportRequestStatusApplyConfigur // WithPhase sets the Phase field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Phase field is set to the value of the last call. -func (b *APIServiceExportRequestStatusApplyConfiguration) WithPhase(value v1alpha1.APIServiceExportRequestPhase) *APIServiceExportRequestStatusApplyConfiguration { +func (b *APIServiceExportRequestStatusApplyConfiguration) WithPhase(value kubebindv1alpha1.APIServiceExportRequestPhase) *APIServiceExportRequestStatusApplyConfiguration { b.Phase = &value return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportspec.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportspec.go index b351ca75b..a1bf933b6 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportspec.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportspec.go @@ -42,7 +42,7 @@ func APIServiceExportSpec() *APIServiceExportSpecApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *APIServiceExportSpecApplyConfiguration) WithGroup(value string) *APIServiceExportSpecApplyConfiguration { - b.Group = &value + b.APIServiceExportCRDSpecApplyConfiguration.Group = &value return b } @@ -50,7 +50,7 @@ func (b *APIServiceExportSpecApplyConfiguration) WithGroup(value string) *APISer // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Names field is set to the value of the last call. func (b *APIServiceExportSpecApplyConfiguration) WithNames(value v1.CustomResourceDefinitionNames) *APIServiceExportSpecApplyConfiguration { - b.Names = &value + b.APIServiceExportCRDSpecApplyConfiguration.Names = &value return b } @@ -58,7 +58,7 @@ func (b *APIServiceExportSpecApplyConfiguration) WithNames(value v1.CustomResour // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scope field is set to the value of the last call. func (b *APIServiceExportSpecApplyConfiguration) WithScope(value v1.ResourceScope) *APIServiceExportSpecApplyConfiguration { - b.Scope = &value + b.APIServiceExportCRDSpecApplyConfiguration.Scope = &value return b } @@ -70,7 +70,7 @@ func (b *APIServiceExportSpecApplyConfiguration) WithVersions(values ...*APIServ if values[i] == nil { panic("nil value passed to WithVersions") } - b.Versions = append(b.Versions, *values[i]) + b.APIServiceExportCRDSpecApplyConfiguration.Versions = append(b.APIServiceExportCRDSpecApplyConfiguration.Versions, *values[i]) } return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportstatus.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportstatus.go index 6a1b0fbef..1f37cfc6a 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportstatus.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiserviceexportstatus.go @@ -21,7 +21,7 @@ package v1alpha1 import ( v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/third_party/conditions/apis/conditions/v1alpha1" + conditionsv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/third_party/conditions/apis/conditions/v1alpha1" ) // APIServiceExportStatusApplyConfiguration represents a declarative configuration of the APIServiceExportStatus type for use @@ -29,7 +29,7 @@ import ( type APIServiceExportStatusApplyConfiguration struct { AcceptedNames *v1.CustomResourceDefinitionNames `json:"acceptedNames,omitempty"` StoredVersions []string `json:"storedVersions,omitempty"` - Conditions *v1alpha1.Conditions `json:"conditions,omitempty"` + Conditions *conditionsv1alpha1.Conditions `json:"conditions,omitempty"` } // APIServiceExportStatusApplyConfiguration constructs a declarative configuration of the APIServiceExportStatus type for use with @@ -59,7 +59,7 @@ func (b *APIServiceExportStatusApplyConfiguration) WithStoredVersions(values ... // WithConditions sets the Conditions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Conditions field is set to the value of the last call. -func (b *APIServiceExportStatusApplyConfiguration) WithConditions(value v1alpha1.Conditions) *APIServiceExportStatusApplyConfiguration { +func (b *APIServiceExportStatusApplyConfiguration) WithConditions(value conditionsv1alpha1.Conditions) *APIServiceExportStatusApplyConfiguration { b.Conditions = &value return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiservicenamespace.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiservicenamespace.go index d17f4165c..485f16d9f 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiservicenamespace.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/apiservicenamespace.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" + kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" v1 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/meta/v1" ) @@ -31,7 +31,7 @@ import ( type APIServiceNamespaceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *v1alpha1.APIServiceNamespaceSpec `json:"spec,omitempty"` + Spec *kubebindv1alpha1.APIServiceNamespaceSpec `json:"spec,omitempty"` Status *APIServiceNamespaceStatusApplyConfiguration `json:"status,omitempty"` } @@ -50,7 +50,7 @@ func APIServiceNamespace(name, namespace string) *APIServiceNamespaceApplyConfig // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithKind(value string) *APIServiceNamespaceApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -58,7 +58,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithKind(value string) *APIServi // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithAPIVersion(value string) *APIServiceNamespaceApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -67,7 +67,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithAPIVersion(value string) *AP // If called multiple times, the Name field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithName(value string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -76,7 +76,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithName(value string) *APIServi // If called multiple times, the GenerateName field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithGenerateName(value string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -85,7 +85,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithGenerateName(value string) * // If called multiple times, the Namespace field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithNamespace(value string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -94,7 +94,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithNamespace(value string) *API // If called multiple times, the UID field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithUID(value types.UID) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -103,7 +103,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithUID(value types.UID) *APISer // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithResourceVersion(value string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -112,7 +112,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithResourceVersion(value string // If called multiple times, the Generation field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithGeneration(value int64) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -121,7 +121,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithGeneration(value int64) *API // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -130,7 +130,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithCreationTimestamp(value meta // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -139,7 +139,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithDeletionTimestamp(value meta // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -149,11 +149,11 @@ func (b *APIServiceNamespaceApplyConfiguration) WithDeletionGracePeriodSeconds(v // overwriting an existing map entries in Labels field with the same key. func (b *APIServiceNamespaceApplyConfiguration) WithLabels(entries map[string]string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -164,11 +164,11 @@ func (b *APIServiceNamespaceApplyConfiguration) WithLabels(entries map[string]st // overwriting an existing map entries in Annotations field with the same key. func (b *APIServiceNamespaceApplyConfiguration) WithAnnotations(entries map[string]string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -182,7 +182,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithOwnerReferences(values ...*v if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -193,7 +193,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithOwnerReferences(values ...*v func (b *APIServiceNamespaceApplyConfiguration) WithFinalizers(values ...string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -207,7 +207,7 @@ func (b *APIServiceNamespaceApplyConfiguration) ensureObjectMetaApplyConfigurati // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. -func (b *APIServiceNamespaceApplyConfiguration) WithSpec(value v1alpha1.APIServiceNamespaceSpec) *APIServiceNamespaceApplyConfiguration { +func (b *APIServiceNamespaceApplyConfiguration) WithSpec(value kubebindv1alpha1.APIServiceNamespaceSpec) *APIServiceNamespaceApplyConfiguration { b.Spec = &value return b } @@ -223,5 +223,5 @@ func (b *APIServiceNamespaceApplyConfiguration) WithStatus(value *APIServiceName // GetName retrieves the value of the Name field in the declarative configuration. func (b *APIServiceNamespaceApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/clusterbinding.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/clusterbinding.go index 058c5cd5c..d6687874c 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/clusterbinding.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/clusterbinding.go @@ -49,7 +49,7 @@ func ClusterBinding(name, namespace string) *ClusterBindingApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithKind(value string) *ClusterBindingApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -57,7 +57,7 @@ func (b *ClusterBindingApplyConfiguration) WithKind(value string) *ClusterBindin // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithAPIVersion(value string) *ClusterBindingApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -66,7 +66,7 @@ func (b *ClusterBindingApplyConfiguration) WithAPIVersion(value string) *Cluster // If called multiple times, the Name field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithName(value string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -75,7 +75,7 @@ func (b *ClusterBindingApplyConfiguration) WithName(value string) *ClusterBindin // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithGenerateName(value string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -84,7 +84,7 @@ func (b *ClusterBindingApplyConfiguration) WithGenerateName(value string) *Clust // If called multiple times, the Namespace field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithNamespace(value string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -93,7 +93,7 @@ func (b *ClusterBindingApplyConfiguration) WithNamespace(value string) *ClusterB // If called multiple times, the UID field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithUID(value types.UID) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -102,7 +102,7 @@ func (b *ClusterBindingApplyConfiguration) WithUID(value types.UID) *ClusterBind // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithResourceVersion(value string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -111,7 +111,7 @@ func (b *ClusterBindingApplyConfiguration) WithResourceVersion(value string) *Cl // If called multiple times, the Generation field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithGeneration(value int64) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -120,7 +120,7 @@ func (b *ClusterBindingApplyConfiguration) WithGeneration(value int64) *ClusterB // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -129,7 +129,7 @@ func (b *ClusterBindingApplyConfiguration) WithCreationTimestamp(value metav1.Ti // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -138,7 +138,7 @@ func (b *ClusterBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Ti // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -148,11 +148,11 @@ func (b *ClusterBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value // overwriting an existing map entries in Labels field with the same key. func (b *ClusterBindingApplyConfiguration) WithLabels(entries map[string]string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -163,11 +163,11 @@ func (b *ClusterBindingApplyConfiguration) WithLabels(entries map[string]string) // overwriting an existing map entries in Annotations field with the same key. func (b *ClusterBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -181,7 +181,7 @@ func (b *ClusterBindingApplyConfiguration) WithOwnerReferences(values ...*v1.Own if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -192,7 +192,7 @@ func (b *ClusterBindingApplyConfiguration) WithOwnerReferences(values ...*v1.Own func (b *ClusterBindingApplyConfiguration) WithFinalizers(values ...string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -222,5 +222,5 @@ func (b *ClusterBindingApplyConfiguration) WithStatus(value *ClusterBindingStatu // GetName retrieves the value of the Name field in the declarative configuration. func (b *ClusterBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/clusterbindingstatus.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/clusterbindingstatus.go index 3f0a2acbb..cae78d590 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/clusterbindingstatus.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/clusterbindingstatus.go @@ -21,16 +21,16 @@ package v1alpha1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/third_party/conditions/apis/conditions/v1alpha1" + conditionsv1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/third_party/conditions/apis/conditions/v1alpha1" ) // ClusterBindingStatusApplyConfiguration represents a declarative configuration of the ClusterBindingStatus type for use // with apply. type ClusterBindingStatusApplyConfiguration struct { - LastHeartbeatTime *v1.Time `json:"lastHeartbeatTime,omitempty"` - HeartbeatInterval *v1.Duration `json:"heartbeatInterval,omitempty"` - KonnectorVersion *string `json:"konnectorVersion,omitempty"` - Conditions *v1alpha1.Conditions `json:"conditions,omitempty"` + LastHeartbeatTime *v1.Time `json:"lastHeartbeatTime,omitempty"` + HeartbeatInterval *v1.Duration `json:"heartbeatInterval,omitempty"` + KonnectorVersion *string `json:"konnectorVersion,omitempty"` + Conditions *conditionsv1alpha1.Conditions `json:"conditions,omitempty"` } // ClusterBindingStatusApplyConfiguration constructs a declarative configuration of the ClusterBindingStatus type for use with @@ -66,7 +66,7 @@ func (b *ClusterBindingStatusApplyConfiguration) WithKonnectorVersion(value stri // WithConditions sets the Conditions field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Conditions field is set to the value of the last call. -func (b *ClusterBindingStatusApplyConfiguration) WithConditions(value v1alpha1.Conditions) *ClusterBindingStatusApplyConfiguration { +func (b *ClusterBindingStatusApplyConfiguration) WithConditions(value conditionsv1alpha1.Conditions) *ClusterBindingStatusApplyConfiguration { b.Conditions = &value return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/clustersecretkeyref.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/clustersecretkeyref.go index 675b461e7..864c3f0ec 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha1/clustersecretkeyref.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha1/clustersecretkeyref.go @@ -35,7 +35,7 @@ func ClusterSecretKeyRef() *ClusterSecretKeyRefApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ClusterSecretKeyRefApplyConfiguration) WithName(value string) *ClusterSecretKeyRefApplyConfiguration { - b.Name = &value + b.LocalSecretKeyRefApplyConfiguration.Name = &value return b } @@ -43,7 +43,7 @@ func (b *ClusterSecretKeyRefApplyConfiguration) WithName(value string) *ClusterS // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *ClusterSecretKeyRefApplyConfiguration) WithKey(value string) *ClusterSecretKeyRefApplyConfiguration { - b.Key = &value + b.LocalSecretKeyRefApplyConfiguration.Key = &value return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiresourceschema.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiresourceschema.go index 66af52d62..1db7740c8 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiresourceschema.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiresourceschema.go @@ -47,7 +47,7 @@ func APIResourceSchema(name string) *APIResourceSchemaApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *APIResourceSchemaApplyConfiguration) WithKind(value string) *APIResourceSchemaApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -55,7 +55,7 @@ func (b *APIResourceSchemaApplyConfiguration) WithKind(value string) *APIResourc // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *APIResourceSchemaApplyConfiguration) WithAPIVersion(value string) *APIResourceSchemaApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -64,7 +64,7 @@ func (b *APIResourceSchemaApplyConfiguration) WithAPIVersion(value string) *APIR // If called multiple times, the Name field is set to the value of the last call. func (b *APIResourceSchemaApplyConfiguration) WithName(value string) *APIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -73,7 +73,7 @@ func (b *APIResourceSchemaApplyConfiguration) WithName(value string) *APIResourc // If called multiple times, the GenerateName field is set to the value of the last call. func (b *APIResourceSchemaApplyConfiguration) WithGenerateName(value string) *APIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -82,7 +82,7 @@ func (b *APIResourceSchemaApplyConfiguration) WithGenerateName(value string) *AP // If called multiple times, the Namespace field is set to the value of the last call. func (b *APIResourceSchemaApplyConfiguration) WithNamespace(value string) *APIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -91,7 +91,7 @@ func (b *APIResourceSchemaApplyConfiguration) WithNamespace(value string) *APIRe // If called multiple times, the UID field is set to the value of the last call. func (b *APIResourceSchemaApplyConfiguration) WithUID(value types.UID) *APIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -100,7 +100,7 @@ func (b *APIResourceSchemaApplyConfiguration) WithUID(value types.UID) *APIResou // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *APIResourceSchemaApplyConfiguration) WithResourceVersion(value string) *APIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -109,7 +109,7 @@ func (b *APIResourceSchemaApplyConfiguration) WithResourceVersion(value string) // If called multiple times, the Generation field is set to the value of the last call. func (b *APIResourceSchemaApplyConfiguration) WithGeneration(value int64) *APIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -118,7 +118,7 @@ func (b *APIResourceSchemaApplyConfiguration) WithGeneration(value int64) *APIRe // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *APIResourceSchemaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *APIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -127,7 +127,7 @@ func (b *APIResourceSchemaApplyConfiguration) WithCreationTimestamp(value metav1 // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *APIResourceSchemaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *APIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -136,7 +136,7 @@ func (b *APIResourceSchemaApplyConfiguration) WithDeletionTimestamp(value metav1 // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *APIResourceSchemaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *APIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -146,11 +146,11 @@ func (b *APIResourceSchemaApplyConfiguration) WithDeletionGracePeriodSeconds(val // overwriting an existing map entries in Labels field with the same key. func (b *APIResourceSchemaApplyConfiguration) WithLabels(entries map[string]string) *APIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -161,11 +161,11 @@ func (b *APIResourceSchemaApplyConfiguration) WithLabels(entries map[string]stri // overwriting an existing map entries in Annotations field with the same key. func (b *APIResourceSchemaApplyConfiguration) WithAnnotations(entries map[string]string) *APIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -179,7 +179,7 @@ func (b *APIResourceSchemaApplyConfiguration) WithOwnerReferences(values ...*v1. if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -190,7 +190,7 @@ func (b *APIResourceSchemaApplyConfiguration) WithOwnerReferences(values ...*v1. func (b *APIResourceSchemaApplyConfiguration) WithFinalizers(values ...string) *APIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -212,5 +212,5 @@ func (b *APIResourceSchemaApplyConfiguration) WithSpec(value *APIResourceSchemaS // GetName retrieves the value of the Name field in the declarative configuration. func (b *APIResourceSchemaApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiresourceschemaspec.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiresourceschemaspec.go index aea70bbea..10a172fe8 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiresourceschemaspec.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiresourceschemaspec.go @@ -21,13 +21,13 @@ package v1alpha2 import ( v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" ) // APIResourceSchemaSpecApplyConfiguration represents a declarative configuration of the APIResourceSchemaSpec type for use // with apply. type APIResourceSchemaSpecApplyConfiguration struct { - InformerScope *v1alpha2.InformerScope `json:"informerScope,omitempty"` + InformerScope *kubebindv1alpha2.InformerScope `json:"informerScope,omitempty"` APIResourceSchemaCRDSpecApplyConfiguration `json:",inline"` } @@ -40,7 +40,7 @@ func APIResourceSchemaSpec() *APIResourceSchemaSpecApplyConfiguration { // WithInformerScope sets the InformerScope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the InformerScope field is set to the value of the last call. -func (b *APIResourceSchemaSpecApplyConfiguration) WithInformerScope(value v1alpha2.InformerScope) *APIResourceSchemaSpecApplyConfiguration { +func (b *APIResourceSchemaSpecApplyConfiguration) WithInformerScope(value kubebindv1alpha2.InformerScope) *APIResourceSchemaSpecApplyConfiguration { b.InformerScope = &value return b } @@ -49,7 +49,7 @@ func (b *APIResourceSchemaSpecApplyConfiguration) WithInformerScope(value v1alph // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *APIResourceSchemaSpecApplyConfiguration) WithGroup(value string) *APIResourceSchemaSpecApplyConfiguration { - b.Group = &value + b.APIResourceSchemaCRDSpecApplyConfiguration.Group = &value return b } @@ -57,7 +57,7 @@ func (b *APIResourceSchemaSpecApplyConfiguration) WithGroup(value string) *APIRe // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Names field is set to the value of the last call. func (b *APIResourceSchemaSpecApplyConfiguration) WithNames(value v1.CustomResourceDefinitionNames) *APIResourceSchemaSpecApplyConfiguration { - b.Names = &value + b.APIResourceSchemaCRDSpecApplyConfiguration.Names = &value return b } @@ -65,7 +65,7 @@ func (b *APIResourceSchemaSpecApplyConfiguration) WithNames(value v1.CustomResou // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scope field is set to the value of the last call. func (b *APIResourceSchemaSpecApplyConfiguration) WithScope(value v1.ResourceScope) *APIResourceSchemaSpecApplyConfiguration { - b.Scope = &value + b.APIResourceSchemaCRDSpecApplyConfiguration.Scope = &value return b } @@ -77,7 +77,7 @@ func (b *APIResourceSchemaSpecApplyConfiguration) WithVersions(values ...*APIRes if values[i] == nil { panic("nil value passed to WithVersions") } - b.Versions = append(b.Versions, *values[i]) + b.APIResourceSchemaCRDSpecApplyConfiguration.Versions = append(b.APIResourceSchemaCRDSpecApplyConfiguration.Versions, *values[i]) } return b } @@ -86,6 +86,6 @@ func (b *APIResourceSchemaSpecApplyConfiguration) WithVersions(values ...*APIRes // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Conversion field is set to the value of the last call. func (b *APIResourceSchemaSpecApplyConfiguration) WithConversion(value *CustomResourceConversionApplyConfiguration) *APIResourceSchemaSpecApplyConfiguration { - b.Conversion = value + b.APIResourceSchemaCRDSpecApplyConfiguration.Conversion = value return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiservicebinding.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiservicebinding.go index de3c3b7ad..191159c50 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiservicebinding.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiservicebinding.go @@ -48,7 +48,7 @@ func APIServiceBinding(name string) *APIServiceBindingApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithKind(value string) *APIServiceBindingApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -56,7 +56,7 @@ func (b *APIServiceBindingApplyConfiguration) WithKind(value string) *APIService // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithAPIVersion(value string) *APIServiceBindingApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -65,7 +65,7 @@ func (b *APIServiceBindingApplyConfiguration) WithAPIVersion(value string) *APIS // If called multiple times, the Name field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithName(value string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -74,7 +74,7 @@ func (b *APIServiceBindingApplyConfiguration) WithName(value string) *APIService // If called multiple times, the GenerateName field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithGenerateName(value string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -83,7 +83,7 @@ func (b *APIServiceBindingApplyConfiguration) WithGenerateName(value string) *AP // If called multiple times, the Namespace field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithNamespace(value string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -92,7 +92,7 @@ func (b *APIServiceBindingApplyConfiguration) WithNamespace(value string) *APISe // If called multiple times, the UID field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithUID(value types.UID) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -101,7 +101,7 @@ func (b *APIServiceBindingApplyConfiguration) WithUID(value types.UID) *APIServi // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithResourceVersion(value string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -110,7 +110,7 @@ func (b *APIServiceBindingApplyConfiguration) WithResourceVersion(value string) // If called multiple times, the Generation field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithGeneration(value int64) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -119,7 +119,7 @@ func (b *APIServiceBindingApplyConfiguration) WithGeneration(value int64) *APISe // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -128,7 +128,7 @@ func (b *APIServiceBindingApplyConfiguration) WithCreationTimestamp(value metav1 // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -137,7 +137,7 @@ func (b *APIServiceBindingApplyConfiguration) WithDeletionTimestamp(value metav1 // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *APIServiceBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -147,11 +147,11 @@ func (b *APIServiceBindingApplyConfiguration) WithDeletionGracePeriodSeconds(val // overwriting an existing map entries in Labels field with the same key. func (b *APIServiceBindingApplyConfiguration) WithLabels(entries map[string]string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -162,11 +162,11 @@ func (b *APIServiceBindingApplyConfiguration) WithLabels(entries map[string]stri // overwriting an existing map entries in Annotations field with the same key. func (b *APIServiceBindingApplyConfiguration) WithAnnotations(entries map[string]string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -180,7 +180,7 @@ func (b *APIServiceBindingApplyConfiguration) WithOwnerReferences(values ...*v1. if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -191,7 +191,7 @@ func (b *APIServiceBindingApplyConfiguration) WithOwnerReferences(values ...*v1. func (b *APIServiceBindingApplyConfiguration) WithFinalizers(values ...string) *APIServiceBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -221,5 +221,5 @@ func (b *APIServiceBindingApplyConfiguration) WithStatus(value *APIServiceBindin // GetName retrieves the value of the Name field in the declarative configuration. func (b *APIServiceBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexport.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexport.go index 48831608b..b07a96a6f 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexport.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexport.go @@ -49,7 +49,7 @@ func APIServiceExport(name, namespace string) *APIServiceExportApplyConfiguratio // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithKind(value string) *APIServiceExportApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -57,7 +57,7 @@ func (b *APIServiceExportApplyConfiguration) WithKind(value string) *APIServiceE // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithAPIVersion(value string) *APIServiceExportApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -66,7 +66,7 @@ func (b *APIServiceExportApplyConfiguration) WithAPIVersion(value string) *APISe // If called multiple times, the Name field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithName(value string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -75,7 +75,7 @@ func (b *APIServiceExportApplyConfiguration) WithName(value string) *APIServiceE // If called multiple times, the GenerateName field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithGenerateName(value string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -84,7 +84,7 @@ func (b *APIServiceExportApplyConfiguration) WithGenerateName(value string) *API // If called multiple times, the Namespace field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithNamespace(value string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -93,7 +93,7 @@ func (b *APIServiceExportApplyConfiguration) WithNamespace(value string) *APISer // If called multiple times, the UID field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithUID(value types.UID) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -102,7 +102,7 @@ func (b *APIServiceExportApplyConfiguration) WithUID(value types.UID) *APIServic // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithResourceVersion(value string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -111,7 +111,7 @@ func (b *APIServiceExportApplyConfiguration) WithResourceVersion(value string) * // If called multiple times, the Generation field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithGeneration(value int64) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -120,7 +120,7 @@ func (b *APIServiceExportApplyConfiguration) WithGeneration(value int64) *APISer // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithCreationTimestamp(value metav1.Time) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -129,7 +129,7 @@ func (b *APIServiceExportApplyConfiguration) WithCreationTimestamp(value metav1. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -138,7 +138,7 @@ func (b *APIServiceExportApplyConfiguration) WithDeletionTimestamp(value metav1. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *APIServiceExportApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -148,11 +148,11 @@ func (b *APIServiceExportApplyConfiguration) WithDeletionGracePeriodSeconds(valu // overwriting an existing map entries in Labels field with the same key. func (b *APIServiceExportApplyConfiguration) WithLabels(entries map[string]string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -163,11 +163,11 @@ func (b *APIServiceExportApplyConfiguration) WithLabels(entries map[string]strin // overwriting an existing map entries in Annotations field with the same key. func (b *APIServiceExportApplyConfiguration) WithAnnotations(entries map[string]string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -181,7 +181,7 @@ func (b *APIServiceExportApplyConfiguration) WithOwnerReferences(values ...*v1.O if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -192,7 +192,7 @@ func (b *APIServiceExportApplyConfiguration) WithOwnerReferences(values ...*v1.O func (b *APIServiceExportApplyConfiguration) WithFinalizers(values ...string) *APIServiceExportApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -222,5 +222,5 @@ func (b *APIServiceExportApplyConfiguration) WithStatus(value *APIServiceExportS // GetName retrieves the value of the Name field in the declarative configuration. func (b *APIServiceExportApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexportrequest.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexportrequest.go index 34594a134..554cc686e 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexportrequest.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexportrequest.go @@ -49,7 +49,7 @@ func APIServiceExportRequest(name, namespace string) *APIServiceExportRequestApp // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithKind(value string) *APIServiceExportRequestApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -57,7 +57,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithKind(value string) *APIS // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithAPIVersion(value string) *APIServiceExportRequestApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -66,7 +66,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithAPIVersion(value string) // If called multiple times, the Name field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithName(value string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -75,7 +75,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithName(value string) *APIS // If called multiple times, the GenerateName field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithGenerateName(value string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -84,7 +84,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithGenerateName(value strin // If called multiple times, the Namespace field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithNamespace(value string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -93,7 +93,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithNamespace(value string) // If called multiple times, the UID field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithUID(value types.UID) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -102,7 +102,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithUID(value types.UID) *AP // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithResourceVersion(value string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -111,7 +111,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithResourceVersion(value st // If called multiple times, the Generation field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithGeneration(value int64) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -120,7 +120,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithGeneration(value int64) // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithCreationTimestamp(value metav1.Time) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -129,7 +129,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithCreationTimestamp(value // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -138,7 +138,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithDeletionTimestamp(value // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *APIServiceExportRequestApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -148,11 +148,11 @@ func (b *APIServiceExportRequestApplyConfiguration) WithDeletionGracePeriodSecon // overwriting an existing map entries in Labels field with the same key. func (b *APIServiceExportRequestApplyConfiguration) WithLabels(entries map[string]string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -163,11 +163,11 @@ func (b *APIServiceExportRequestApplyConfiguration) WithLabels(entries map[strin // overwriting an existing map entries in Annotations field with the same key. func (b *APIServiceExportRequestApplyConfiguration) WithAnnotations(entries map[string]string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -181,7 +181,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithOwnerReferences(values . if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -192,7 +192,7 @@ func (b *APIServiceExportRequestApplyConfiguration) WithOwnerReferences(values . func (b *APIServiceExportRequestApplyConfiguration) WithFinalizers(values ...string) *APIServiceExportRequestApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -222,5 +222,5 @@ func (b *APIServiceExportRequestApplyConfiguration) WithStatus(value *APIService // GetName retrieves the value of the Name field in the declarative configuration. func (b *APIServiceExportRequestApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexportrequestresource.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexportrequestresource.go index 69ff9e345..49aac6301 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexportrequestresource.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexportrequestresource.go @@ -35,7 +35,7 @@ func APIServiceExportRequestResource() *APIServiceExportRequestResourceApplyConf // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *APIServiceExportRequestResourceApplyConfiguration) WithGroup(value string) *APIServiceExportRequestResourceApplyConfiguration { - b.Group = &value + b.GroupResourceApplyConfiguration.Group = &value return b } @@ -43,7 +43,7 @@ func (b *APIServiceExportRequestResourceApplyConfiguration) WithGroup(value stri // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *APIServiceExportRequestResourceApplyConfiguration) WithResource(value string) *APIServiceExportRequestResourceApplyConfiguration { - b.Resource = &value + b.GroupResourceApplyConfiguration.Resource = &value return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexportrequeststatus.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexportrequeststatus.go index c3ea1e0fd..889f5782b 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexportrequeststatus.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiserviceexportrequeststatus.go @@ -19,16 +19,16 @@ limitations under the License. package v1alpha2 import ( - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/third_party/conditions/apis/conditions/v1alpha1" ) // APIServiceExportRequestStatusApplyConfiguration represents a declarative configuration of the APIServiceExportRequestStatus type for use // with apply. type APIServiceExportRequestStatusApplyConfiguration struct { - Phase *v1alpha2.APIServiceExportRequestPhase `json:"phase,omitempty"` - TerminalMessage *string `json:"terminalMessage,omitempty"` - Conditions *v1alpha1.Conditions `json:"conditions,omitempty"` + Phase *kubebindv1alpha2.APIServiceExportRequestPhase `json:"phase,omitempty"` + TerminalMessage *string `json:"terminalMessage,omitempty"` + Conditions *v1alpha1.Conditions `json:"conditions,omitempty"` } // APIServiceExportRequestStatusApplyConfiguration constructs a declarative configuration of the APIServiceExportRequestStatus type for use with @@ -40,7 +40,7 @@ func APIServiceExportRequestStatus() *APIServiceExportRequestStatusApplyConfigur // WithPhase sets the Phase field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Phase field is set to the value of the last call. -func (b *APIServiceExportRequestStatusApplyConfiguration) WithPhase(value v1alpha2.APIServiceExportRequestPhase) *APIServiceExportRequestStatusApplyConfiguration { +func (b *APIServiceExportRequestStatusApplyConfiguration) WithPhase(value kubebindv1alpha2.APIServiceExportRequestPhase) *APIServiceExportRequestStatusApplyConfiguration { b.Phase = &value return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiservicenamespace.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiservicenamespace.go index 89dce104c..f692f5d8d 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiservicenamespace.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/apiservicenamespace.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" v1 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/meta/v1" ) @@ -31,7 +31,7 @@ import ( type APIServiceNamespaceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *v1alpha2.APIServiceNamespaceSpec `json:"spec,omitempty"` + Spec *kubebindv1alpha2.APIServiceNamespaceSpec `json:"spec,omitempty"` Status *APIServiceNamespaceStatusApplyConfiguration `json:"status,omitempty"` } @@ -50,7 +50,7 @@ func APIServiceNamespace(name, namespace string) *APIServiceNamespaceApplyConfig // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithKind(value string) *APIServiceNamespaceApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -58,7 +58,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithKind(value string) *APIServi // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithAPIVersion(value string) *APIServiceNamespaceApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -67,7 +67,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithAPIVersion(value string) *AP // If called multiple times, the Name field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithName(value string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -76,7 +76,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithName(value string) *APIServi // If called multiple times, the GenerateName field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithGenerateName(value string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -85,7 +85,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithGenerateName(value string) * // If called multiple times, the Namespace field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithNamespace(value string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -94,7 +94,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithNamespace(value string) *API // If called multiple times, the UID field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithUID(value types.UID) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -103,7 +103,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithUID(value types.UID) *APISer // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithResourceVersion(value string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -112,7 +112,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithResourceVersion(value string // If called multiple times, the Generation field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithGeneration(value int64) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -121,7 +121,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithGeneration(value int64) *API // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -130,7 +130,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithCreationTimestamp(value meta // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -139,7 +139,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithDeletionTimestamp(value meta // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *APIServiceNamespaceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -149,11 +149,11 @@ func (b *APIServiceNamespaceApplyConfiguration) WithDeletionGracePeriodSeconds(v // overwriting an existing map entries in Labels field with the same key. func (b *APIServiceNamespaceApplyConfiguration) WithLabels(entries map[string]string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -164,11 +164,11 @@ func (b *APIServiceNamespaceApplyConfiguration) WithLabels(entries map[string]st // overwriting an existing map entries in Annotations field with the same key. func (b *APIServiceNamespaceApplyConfiguration) WithAnnotations(entries map[string]string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -182,7 +182,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithOwnerReferences(values ...*v if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -193,7 +193,7 @@ func (b *APIServiceNamespaceApplyConfiguration) WithOwnerReferences(values ...*v func (b *APIServiceNamespaceApplyConfiguration) WithFinalizers(values ...string) *APIServiceNamespaceApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -207,7 +207,7 @@ func (b *APIServiceNamespaceApplyConfiguration) ensureObjectMetaApplyConfigurati // WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Spec field is set to the value of the last call. -func (b *APIServiceNamespaceApplyConfiguration) WithSpec(value v1alpha2.APIServiceNamespaceSpec) *APIServiceNamespaceApplyConfiguration { +func (b *APIServiceNamespaceApplyConfiguration) WithSpec(value kubebindv1alpha2.APIServiceNamespaceSpec) *APIServiceNamespaceApplyConfiguration { b.Spec = &value return b } @@ -223,5 +223,5 @@ func (b *APIServiceNamespaceApplyConfiguration) WithStatus(value *APIServiceName // GetName retrieves the value of the Name field in the declarative configuration. func (b *APIServiceNamespaceApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/boundapiresourceschema.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/boundapiresourceschema.go index 6e070c386..22714dc48 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/boundapiresourceschema.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/boundapiresourceschema.go @@ -49,7 +49,7 @@ func BoundAPIResourceSchema(name, namespace string) *BoundAPIResourceSchemaApply // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *BoundAPIResourceSchemaApplyConfiguration) WithKind(value string) *BoundAPIResourceSchemaApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -57,7 +57,7 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithKind(value string) *Bound // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *BoundAPIResourceSchemaApplyConfiguration) WithAPIVersion(value string) *BoundAPIResourceSchemaApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -66,7 +66,7 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithAPIVersion(value string) // If called multiple times, the Name field is set to the value of the last call. func (b *BoundAPIResourceSchemaApplyConfiguration) WithName(value string) *BoundAPIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -75,7 +75,7 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithName(value string) *Bound // If called multiple times, the GenerateName field is set to the value of the last call. func (b *BoundAPIResourceSchemaApplyConfiguration) WithGenerateName(value string) *BoundAPIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -84,7 +84,7 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithGenerateName(value string // If called multiple times, the Namespace field is set to the value of the last call. func (b *BoundAPIResourceSchemaApplyConfiguration) WithNamespace(value string) *BoundAPIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -93,7 +93,7 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithNamespace(value string) * // If called multiple times, the UID field is set to the value of the last call. func (b *BoundAPIResourceSchemaApplyConfiguration) WithUID(value types.UID) *BoundAPIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -102,7 +102,7 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithUID(value types.UID) *Bou // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *BoundAPIResourceSchemaApplyConfiguration) WithResourceVersion(value string) *BoundAPIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -111,7 +111,7 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithResourceVersion(value str // If called multiple times, the Generation field is set to the value of the last call. func (b *BoundAPIResourceSchemaApplyConfiguration) WithGeneration(value int64) *BoundAPIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -120,7 +120,7 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithGeneration(value int64) * // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *BoundAPIResourceSchemaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BoundAPIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -129,7 +129,7 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithCreationTimestamp(value m // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *BoundAPIResourceSchemaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BoundAPIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -138,7 +138,7 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithDeletionTimestamp(value m // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *BoundAPIResourceSchemaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BoundAPIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -148,11 +148,11 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithDeletionGracePeriodSecond // overwriting an existing map entries in Labels field with the same key. func (b *BoundAPIResourceSchemaApplyConfiguration) WithLabels(entries map[string]string) *BoundAPIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -163,11 +163,11 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithLabels(entries map[string // overwriting an existing map entries in Annotations field with the same key. func (b *BoundAPIResourceSchemaApplyConfiguration) WithAnnotations(entries map[string]string) *BoundAPIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -181,7 +181,7 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithOwnerReferences(values .. if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -192,7 +192,7 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithOwnerReferences(values .. func (b *BoundAPIResourceSchemaApplyConfiguration) WithFinalizers(values ...string) *BoundAPIResourceSchemaApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -222,5 +222,5 @@ func (b *BoundAPIResourceSchemaApplyConfiguration) WithStatus(value *BoundAPIRes // GetName retrieves the value of the Name field in the declarative configuration. func (b *BoundAPIResourceSchemaApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/boundapiresourceschemaspec.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/boundapiresourceschemaspec.go index c849bf2ff..6e0cfcc74 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/boundapiresourceschemaspec.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/boundapiresourceschemaspec.go @@ -21,13 +21,13 @@ package v1alpha2 import ( v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" ) // BoundAPIResourceSchemaSpecApplyConfiguration represents a declarative configuration of the BoundAPIResourceSchemaSpec type for use // with apply. type BoundAPIResourceSchemaSpecApplyConfiguration struct { - InformerScope *v1alpha2.InformerScope `json:"informerScope,omitempty"` + InformerScope *kubebindv1alpha2.InformerScope `json:"informerScope,omitempty"` APIResourceSchemaCRDSpecApplyConfiguration `json:",inline"` } @@ -40,7 +40,7 @@ func BoundAPIResourceSchemaSpec() *BoundAPIResourceSchemaSpecApplyConfiguration // WithInformerScope sets the InformerScope field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the InformerScope field is set to the value of the last call. -func (b *BoundAPIResourceSchemaSpecApplyConfiguration) WithInformerScope(value v1alpha2.InformerScope) *BoundAPIResourceSchemaSpecApplyConfiguration { +func (b *BoundAPIResourceSchemaSpecApplyConfiguration) WithInformerScope(value kubebindv1alpha2.InformerScope) *BoundAPIResourceSchemaSpecApplyConfiguration { b.InformerScope = &value return b } @@ -49,7 +49,7 @@ func (b *BoundAPIResourceSchemaSpecApplyConfiguration) WithInformerScope(value v // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *BoundAPIResourceSchemaSpecApplyConfiguration) WithGroup(value string) *BoundAPIResourceSchemaSpecApplyConfiguration { - b.Group = &value + b.APIResourceSchemaCRDSpecApplyConfiguration.Group = &value return b } @@ -57,7 +57,7 @@ func (b *BoundAPIResourceSchemaSpecApplyConfiguration) WithGroup(value string) * // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Names field is set to the value of the last call. func (b *BoundAPIResourceSchemaSpecApplyConfiguration) WithNames(value v1.CustomResourceDefinitionNames) *BoundAPIResourceSchemaSpecApplyConfiguration { - b.Names = &value + b.APIResourceSchemaCRDSpecApplyConfiguration.Names = &value return b } @@ -65,7 +65,7 @@ func (b *BoundAPIResourceSchemaSpecApplyConfiguration) WithNames(value v1.Custom // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Scope field is set to the value of the last call. func (b *BoundAPIResourceSchemaSpecApplyConfiguration) WithScope(value v1.ResourceScope) *BoundAPIResourceSchemaSpecApplyConfiguration { - b.Scope = &value + b.APIResourceSchemaCRDSpecApplyConfiguration.Scope = &value return b } @@ -77,7 +77,7 @@ func (b *BoundAPIResourceSchemaSpecApplyConfiguration) WithVersions(values ...*A if values[i] == nil { panic("nil value passed to WithVersions") } - b.Versions = append(b.Versions, *values[i]) + b.APIResourceSchemaCRDSpecApplyConfiguration.Versions = append(b.APIResourceSchemaCRDSpecApplyConfiguration.Versions, *values[i]) } return b } @@ -86,6 +86,6 @@ func (b *BoundAPIResourceSchemaSpecApplyConfiguration) WithVersions(values ...*A // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Conversion field is set to the value of the last call. func (b *BoundAPIResourceSchemaSpecApplyConfiguration) WithConversion(value *CustomResourceConversionApplyConfiguration) *BoundAPIResourceSchemaSpecApplyConfiguration { - b.Conversion = value + b.APIResourceSchemaCRDSpecApplyConfiguration.Conversion = value return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/boundschemareference.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/boundschemareference.go index 0deae06c1..95a97aa63 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/boundschemareference.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/boundschemareference.go @@ -34,7 +34,7 @@ func BoundSchemaReference() *BoundSchemaReferenceApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Group field is set to the value of the last call. func (b *BoundSchemaReferenceApplyConfiguration) WithGroup(value string) *BoundSchemaReferenceApplyConfiguration { - b.Group = &value + b.GroupResourceApplyConfiguration.Group = &value return b } @@ -42,6 +42,6 @@ func (b *BoundSchemaReferenceApplyConfiguration) WithGroup(value string) *BoundS // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Resource field is set to the value of the last call. func (b *BoundSchemaReferenceApplyConfiguration) WithResource(value string) *BoundSchemaReferenceApplyConfiguration { - b.Resource = &value + b.GroupResourceApplyConfiguration.Resource = &value return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/clusterbinding.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/clusterbinding.go index 020a60613..35fc4e0a7 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/clusterbinding.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/clusterbinding.go @@ -49,7 +49,7 @@ func ClusterBinding(name, namespace string) *ClusterBindingApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithKind(value string) *ClusterBindingApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -57,7 +57,7 @@ func (b *ClusterBindingApplyConfiguration) WithKind(value string) *ClusterBindin // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithAPIVersion(value string) *ClusterBindingApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } @@ -66,7 +66,7 @@ func (b *ClusterBindingApplyConfiguration) WithAPIVersion(value string) *Cluster // If called multiple times, the Name field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithName(value string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value + b.ObjectMetaApplyConfiguration.Name = &value return b } @@ -75,7 +75,7 @@ func (b *ClusterBindingApplyConfiguration) WithName(value string) *ClusterBindin // If called multiple times, the GenerateName field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithGenerateName(value string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value + b.ObjectMetaApplyConfiguration.GenerateName = &value return b } @@ -84,7 +84,7 @@ func (b *ClusterBindingApplyConfiguration) WithGenerateName(value string) *Clust // If called multiple times, the Namespace field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithNamespace(value string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value + b.ObjectMetaApplyConfiguration.Namespace = &value return b } @@ -93,7 +93,7 @@ func (b *ClusterBindingApplyConfiguration) WithNamespace(value string) *ClusterB // If called multiple times, the UID field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithUID(value types.UID) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value + b.ObjectMetaApplyConfiguration.UID = &value return b } @@ -102,7 +102,7 @@ func (b *ClusterBindingApplyConfiguration) WithUID(value types.UID) *ClusterBind // If called multiple times, the ResourceVersion field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithResourceVersion(value string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value + b.ObjectMetaApplyConfiguration.ResourceVersion = &value return b } @@ -111,7 +111,7 @@ func (b *ClusterBindingApplyConfiguration) WithResourceVersion(value string) *Cl // If called multiple times, the Generation field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithGeneration(value int64) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value + b.ObjectMetaApplyConfiguration.Generation = &value return b } @@ -120,7 +120,7 @@ func (b *ClusterBindingApplyConfiguration) WithGeneration(value int64) *ClusterB // If called multiple times, the CreationTimestamp field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value return b } @@ -129,7 +129,7 @@ func (b *ClusterBindingApplyConfiguration) WithCreationTimestamp(value metav1.Ti // If called multiple times, the DeletionTimestamp field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value return b } @@ -138,7 +138,7 @@ func (b *ClusterBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Ti // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. func (b *ClusterBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value return b } @@ -148,11 +148,11 @@ func (b *ClusterBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value // overwriting an existing map entries in Labels field with the same key. func (b *ClusterBindingApplyConfiguration) WithLabels(entries map[string]string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) } for k, v := range entries { - b.Labels[k] = v + b.ObjectMetaApplyConfiguration.Labels[k] = v } return b } @@ -163,11 +163,11 @@ func (b *ClusterBindingApplyConfiguration) WithLabels(entries map[string]string) // overwriting an existing map entries in Annotations field with the same key. func (b *ClusterBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) } for k, v := range entries { - b.Annotations[k] = v + b.ObjectMetaApplyConfiguration.Annotations[k] = v } return b } @@ -181,7 +181,7 @@ func (b *ClusterBindingApplyConfiguration) WithOwnerReferences(values ...*v1.Own if values[i] == nil { panic("nil value passed to WithOwnerReferences") } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) } return b } @@ -192,7 +192,7 @@ func (b *ClusterBindingApplyConfiguration) WithOwnerReferences(values ...*v1.Own func (b *ClusterBindingApplyConfiguration) WithFinalizers(values ...string) *ClusterBindingApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) } return b } @@ -222,5 +222,5 @@ func (b *ClusterBindingApplyConfiguration) WithStatus(value *ClusterBindingStatu // GetName retrieves the value of the Name field in the declarative configuration. func (b *ClusterBindingApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() - return b.Name + return b.ObjectMetaApplyConfiguration.Name } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/clustersecretkeyref.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/clustersecretkeyref.go index 284092e99..ae4ec3e83 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/clustersecretkeyref.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/clustersecretkeyref.go @@ -35,7 +35,7 @@ func ClusterSecretKeyRef() *ClusterSecretKeyRefApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. func (b *ClusterSecretKeyRefApplyConfiguration) WithName(value string) *ClusterSecretKeyRefApplyConfiguration { - b.Name = &value + b.LocalSecretKeyRefApplyConfiguration.Name = &value return b } @@ -43,7 +43,7 @@ func (b *ClusterSecretKeyRefApplyConfiguration) WithName(value string) *ClusterS // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Key field is set to the value of the last call. func (b *ClusterSecretKeyRefApplyConfiguration) WithKey(value string) *ClusterSecretKeyRefApplyConfiguration { - b.Key = &value + b.LocalSecretKeyRefApplyConfiguration.Key = &value return b } diff --git a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/customresourceconversion.go b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/customresourceconversion.go index 49a94f6fc..1d025e1be 100644 --- a/sdk/kcp/applyconfiguration/kubebind/v1alpha2/customresourceconversion.go +++ b/sdk/kcp/applyconfiguration/kubebind/v1alpha2/customresourceconversion.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha2 import ( - v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" + kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" ) // CustomResourceConversionApplyConfiguration represents a declarative configuration of the CustomResourceConversion type for use // with apply. type CustomResourceConversionApplyConfiguration struct { - Strategy *v1alpha2.ConversionStrategyType `json:"strategy,omitempty"` - Webhook *WebhookConversionApplyConfiguration `json:"webhook,omitempty"` + Strategy *kubebindv1alpha2.ConversionStrategyType `json:"strategy,omitempty"` + Webhook *WebhookConversionApplyConfiguration `json:"webhook,omitempty"` } // CustomResourceConversionApplyConfiguration constructs a declarative configuration of the CustomResourceConversion type for use with @@ -38,7 +38,7 @@ func CustomResourceConversion() *CustomResourceConversionApplyConfiguration { // WithStrategy sets the Strategy field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Strategy field is set to the value of the last call. -func (b *CustomResourceConversionApplyConfiguration) WithStrategy(value v1alpha2.ConversionStrategyType) *CustomResourceConversionApplyConfiguration { +func (b *CustomResourceConversionApplyConfiguration) WithStrategy(value kubebindv1alpha2.ConversionStrategyType) *CustomResourceConversionApplyConfiguration { b.Strategy = &value return b } diff --git a/sdk/kcp/applyconfiguration/meta/v1/condition.go b/sdk/kcp/applyconfiguration/meta/v1/condition.go index 4a012815a..b0fca3627 100644 --- a/sdk/kcp/applyconfiguration/meta/v1/condition.go +++ b/sdk/kcp/applyconfiguration/meta/v1/condition.go @@ -19,18 +19,18 @@ limitations under the License. package v1 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ConditionApplyConfiguration represents a declarative configuration of the Condition type for use // with apply. type ConditionApplyConfiguration struct { - Type *string `json:"type,omitempty"` - Status *v1.ConditionStatus `json:"status,omitempty"` - ObservedGeneration *int64 `json:"observedGeneration,omitempty"` - LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` - Reason *string `json:"reason,omitempty"` - Message *string `json:"message,omitempty"` + Type *string `json:"type,omitempty"` + Status *metav1.ConditionStatus `json:"status,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` } // ConditionApplyConfiguration constructs a declarative configuration of the Condition type for use with @@ -50,7 +50,7 @@ func (b *ConditionApplyConfiguration) WithType(value string) *ConditionApplyConf // WithStatus sets the Status field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Status field is set to the value of the last call. -func (b *ConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ConditionApplyConfiguration { +func (b *ConditionApplyConfiguration) WithStatus(value metav1.ConditionStatus) *ConditionApplyConfiguration { b.Status = &value return b } @@ -66,7 +66,7 @@ func (b *ConditionApplyConfiguration) WithObservedGeneration(value int64) *Condi // WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the LastTransitionTime field is set to the value of the last call. -func (b *ConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *ConditionApplyConfiguration { +func (b *ConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *ConditionApplyConfiguration { b.LastTransitionTime = &value return b } diff --git a/sdk/kcp/applyconfiguration/meta/v1/deleteoptions.go b/sdk/kcp/applyconfiguration/meta/v1/deleteoptions.go index 16f0adc61..828833245 100644 --- a/sdk/kcp/applyconfiguration/meta/v1/deleteoptions.go +++ b/sdk/kcp/applyconfiguration/meta/v1/deleteoptions.go @@ -47,7 +47,7 @@ func DeleteOptions() *DeleteOptionsApplyConfiguration { // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. func (b *DeleteOptionsApplyConfiguration) WithKind(value string) *DeleteOptionsApplyConfiguration { - b.Kind = &value + b.TypeMetaApplyConfiguration.Kind = &value return b } @@ -55,7 +55,7 @@ func (b *DeleteOptionsApplyConfiguration) WithKind(value string) *DeleteOptionsA // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. func (b *DeleteOptionsApplyConfiguration) WithAPIVersion(value string) *DeleteOptionsApplyConfiguration { - b.APIVersion = &value + b.TypeMetaApplyConfiguration.APIVersion = &value return b } diff --git a/sdk/kcp/applyconfiguration/meta/v1/labelselector.go b/sdk/kcp/applyconfiguration/meta/v1/labelselector.go index 44842d6ec..74ded1b0a 100644 --- a/sdk/kcp/applyconfiguration/meta/v1/labelselector.go +++ b/sdk/kcp/applyconfiguration/meta/v1/labelselector.go @@ -19,14 +19,14 @@ limitations under the License. package v1 import ( - v1 "k8s.io/client-go/applyconfigurations/meta/v1" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) // LabelSelectorApplyConfiguration represents a declarative configuration of the LabelSelector type for use // with apply. type LabelSelectorApplyConfiguration struct { - MatchLabels map[string]string `json:"matchLabels,omitempty"` - MatchExpressions []v1.LabelSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` + MatchLabels map[string]string `json:"matchLabels,omitempty"` + MatchExpressions []metav1.LabelSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` } // LabelSelectorApplyConfiguration constructs a declarative configuration of the LabelSelector type for use with @@ -52,7 +52,7 @@ func (b *LabelSelectorApplyConfiguration) WithMatchLabels(entries map[string]str // WithMatchExpressions adds the given value to the MatchExpressions field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the MatchExpressions field. -func (b *LabelSelectorApplyConfiguration) WithMatchExpressions(values ...*v1.LabelSelectorRequirementApplyConfiguration) *LabelSelectorApplyConfiguration { +func (b *LabelSelectorApplyConfiguration) WithMatchExpressions(values ...*metav1.LabelSelectorRequirementApplyConfiguration) *LabelSelectorApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithMatchExpressions") diff --git a/sdk/kcp/applyconfiguration/meta/v1/labelselectorrequirement.go b/sdk/kcp/applyconfiguration/meta/v1/labelselectorrequirement.go index 308c35f8a..34212638d 100644 --- a/sdk/kcp/applyconfiguration/meta/v1/labelselectorrequirement.go +++ b/sdk/kcp/applyconfiguration/meta/v1/labelselectorrequirement.go @@ -19,15 +19,15 @@ limitations under the License. package v1 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // LabelSelectorRequirementApplyConfiguration represents a declarative configuration of the LabelSelectorRequirement type for use // with apply. type LabelSelectorRequirementApplyConfiguration struct { - Key *string `json:"key,omitempty"` - Operator *v1.LabelSelectorOperator `json:"operator,omitempty"` - Values []string `json:"values,omitempty"` + Key *string `json:"key,omitempty"` + Operator *metav1.LabelSelectorOperator `json:"operator,omitempty"` + Values []string `json:"values,omitempty"` } // LabelSelectorRequirementApplyConfiguration constructs a declarative configuration of the LabelSelectorRequirement type for use with @@ -47,7 +47,7 @@ func (b *LabelSelectorRequirementApplyConfiguration) WithKey(value string) *Labe // WithOperator sets the Operator field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Operator field is set to the value of the last call. -func (b *LabelSelectorRequirementApplyConfiguration) WithOperator(value v1.LabelSelectorOperator) *LabelSelectorRequirementApplyConfiguration { +func (b *LabelSelectorRequirementApplyConfiguration) WithOperator(value metav1.LabelSelectorOperator) *LabelSelectorRequirementApplyConfiguration { b.Operator = &value return b } diff --git a/sdk/kcp/applyconfiguration/meta/v1/managedfieldsentry.go b/sdk/kcp/applyconfiguration/meta/v1/managedfieldsentry.go index c9bb58624..2ec39be75 100644 --- a/sdk/kcp/applyconfiguration/meta/v1/managedfieldsentry.go +++ b/sdk/kcp/applyconfiguration/meta/v1/managedfieldsentry.go @@ -19,19 +19,19 @@ limitations under the License. package v1 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ManagedFieldsEntryApplyConfiguration represents a declarative configuration of the ManagedFieldsEntry type for use // with apply. type ManagedFieldsEntryApplyConfiguration struct { - Manager *string `json:"manager,omitempty"` - Operation *v1.ManagedFieldsOperationType `json:"operation,omitempty"` - APIVersion *string `json:"apiVersion,omitempty"` - Time *v1.Time `json:"time,omitempty"` - FieldsType *string `json:"fieldsType,omitempty"` - FieldsV1 *v1.FieldsV1 `json:"fieldsV1,omitempty"` - Subresource *string `json:"subresource,omitempty"` + Manager *string `json:"manager,omitempty"` + Operation *metav1.ManagedFieldsOperationType `json:"operation,omitempty"` + APIVersion *string `json:"apiVersion,omitempty"` + Time *metav1.Time `json:"time,omitempty"` + FieldsType *string `json:"fieldsType,omitempty"` + FieldsV1 *metav1.FieldsV1 `json:"fieldsV1,omitempty"` + Subresource *string `json:"subresource,omitempty"` } // ManagedFieldsEntryApplyConfiguration constructs a declarative configuration of the ManagedFieldsEntry type for use with @@ -51,7 +51,7 @@ func (b *ManagedFieldsEntryApplyConfiguration) WithManager(value string) *Manage // WithOperation sets the Operation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Operation field is set to the value of the last call. -func (b *ManagedFieldsEntryApplyConfiguration) WithOperation(value v1.ManagedFieldsOperationType) *ManagedFieldsEntryApplyConfiguration { +func (b *ManagedFieldsEntryApplyConfiguration) WithOperation(value metav1.ManagedFieldsOperationType) *ManagedFieldsEntryApplyConfiguration { b.Operation = &value return b } @@ -67,7 +67,7 @@ func (b *ManagedFieldsEntryApplyConfiguration) WithAPIVersion(value string) *Man // WithTime sets the Time field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Time field is set to the value of the last call. -func (b *ManagedFieldsEntryApplyConfiguration) WithTime(value v1.Time) *ManagedFieldsEntryApplyConfiguration { +func (b *ManagedFieldsEntryApplyConfiguration) WithTime(value metav1.Time) *ManagedFieldsEntryApplyConfiguration { b.Time = &value return b } @@ -83,7 +83,7 @@ func (b *ManagedFieldsEntryApplyConfiguration) WithFieldsType(value string) *Man // WithFieldsV1 sets the FieldsV1 field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FieldsV1 field is set to the value of the last call. -func (b *ManagedFieldsEntryApplyConfiguration) WithFieldsV1(value v1.FieldsV1) *ManagedFieldsEntryApplyConfiguration { +func (b *ManagedFieldsEntryApplyConfiguration) WithFieldsV1(value metav1.FieldsV1) *ManagedFieldsEntryApplyConfiguration { b.FieldsV1 = &value return b } diff --git a/sdk/kcp/applyconfiguration/meta/v1/objectmeta.go b/sdk/kcp/applyconfiguration/meta/v1/objectmeta.go index d8897f9e7..8066b2aa6 100644 --- a/sdk/kcp/applyconfiguration/meta/v1/objectmeta.go +++ b/sdk/kcp/applyconfiguration/meta/v1/objectmeta.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" ) @@ -32,8 +32,8 @@ type ObjectMetaApplyConfiguration struct { UID *types.UID `json:"uid,omitempty"` ResourceVersion *string `json:"resourceVersion,omitempty"` Generation *int64 `json:"generation,omitempty"` - CreationTimestamp *v1.Time `json:"creationTimestamp,omitempty"` - DeletionTimestamp *v1.Time `json:"deletionTimestamp,omitempty"` + CreationTimestamp *metav1.Time `json:"creationTimestamp,omitempty"` + DeletionTimestamp *metav1.Time `json:"deletionTimestamp,omitempty"` DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"` Labels map[string]string `json:"labels,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` @@ -98,7 +98,7 @@ func (b *ObjectMetaApplyConfiguration) WithGeneration(value int64) *ObjectMetaAp // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *ObjectMetaApplyConfiguration) WithCreationTimestamp(value v1.Time) *ObjectMetaApplyConfiguration { +func (b *ObjectMetaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ObjectMetaApplyConfiguration { b.CreationTimestamp = &value return b } @@ -106,7 +106,7 @@ func (b *ObjectMetaApplyConfiguration) WithCreationTimestamp(value v1.Time) *Obj // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *ObjectMetaApplyConfiguration) WithDeletionTimestamp(value v1.Time) *ObjectMetaApplyConfiguration { +func (b *ObjectMetaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ObjectMetaApplyConfiguration { b.DeletionTimestamp = &value return b } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicebinding.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicebinding.go index a26e254d2..95f3cd026 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicebinding.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicebinding.go @@ -19,169 +19,36 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/kubebind/v1alpha1" + typedkubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1" ) -// FakeAPIServiceBindings implements APIServiceBindingInterface -type FakeAPIServiceBindings struct { +// fakeAPIServiceBindings implements APIServiceBindingInterface +type fakeAPIServiceBindings struct { + *gentype.FakeClientWithListAndApply[*v1alpha1.APIServiceBinding, *v1alpha1.APIServiceBindingList, *kubebindv1alpha1.APIServiceBindingApplyConfiguration] Fake *FakeKubeBindV1alpha1 } -var apiservicebindingsResource = v1alpha1.SchemeGroupVersion.WithResource("apiservicebindings") - -var apiservicebindingsKind = v1alpha1.SchemeGroupVersion.WithKind("APIServiceBinding") - -// Get takes name of the aPIServiceBinding, and returns the corresponding aPIServiceBinding object, and an error if there is any. -func (c *FakeAPIServiceBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.APIServiceBinding, err error) { - emptyResult := &v1alpha1.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(apiservicebindingsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceBinding), err -} - -// List takes label and field selectors, and returns the list of APIServiceBindings that match those selectors. -func (c *FakeAPIServiceBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.APIServiceBindingList, err error) { - emptyResult := &v1alpha1.APIServiceBindingList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(apiservicebindingsResource, apiservicebindingsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.APIServiceBindingList{ListMeta: obj.(*v1alpha1.APIServiceBindingList).ListMeta} - for _, item := range obj.(*v1alpha1.APIServiceBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceBindings. -func (c *FakeAPIServiceBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(apiservicebindingsResource, opts)) -} - -// Create takes the representation of a aPIServiceBinding and creates it. Returns the server's representation of the aPIServiceBinding, and an error, if there is any. -func (c *FakeAPIServiceBindings) Create(ctx context.Context, aPIServiceBinding *v1alpha1.APIServiceBinding, opts v1.CreateOptions) (result *v1alpha1.APIServiceBinding, err error) { - emptyResult := &v1alpha1.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(apiservicebindingsResource, aPIServiceBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceBinding), err -} - -// Update takes the representation of a aPIServiceBinding and updates it. Returns the server's representation of the aPIServiceBinding, and an error, if there is any. -func (c *FakeAPIServiceBindings) Update(ctx context.Context, aPIServiceBinding *v1alpha1.APIServiceBinding, opts v1.UpdateOptions) (result *v1alpha1.APIServiceBinding, err error) { - emptyResult := &v1alpha1.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(apiservicebindingsResource, aPIServiceBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceBinding), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceBindings) UpdateStatus(ctx context.Context, aPIServiceBinding *v1alpha1.APIServiceBinding, opts v1.UpdateOptions) (result *v1alpha1.APIServiceBinding, err error) { - emptyResult := &v1alpha1.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(apiservicebindingsResource, "status", aPIServiceBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceBinding), err -} - -// Delete takes name of the aPIServiceBinding and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(apiservicebindingsResource, name, opts), &v1alpha1.APIServiceBinding{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(apiservicebindingsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.APIServiceBindingList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceBinding. -func (c *FakeAPIServiceBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.APIServiceBinding, err error) { - emptyResult := &v1alpha1.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiservicebindingsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied aPIServiceBinding. -func (c *FakeAPIServiceBindings) Apply(ctx context.Context, aPIServiceBinding *kubebindv1alpha1.APIServiceBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.APIServiceBinding, err error) { - if aPIServiceBinding == nil { - return nil, fmt.Errorf("aPIServiceBinding provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceBinding) - if err != nil { - return nil, err - } - name := aPIServiceBinding.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceBinding.Name must be provided to Apply") - } - emptyResult := &v1alpha1.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiservicebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceBinding), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeAPIServiceBindings) ApplyStatus(ctx context.Context, aPIServiceBinding *kubebindv1alpha1.APIServiceBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.APIServiceBinding, err error) { - if aPIServiceBinding == nil { - return nil, fmt.Errorf("aPIServiceBinding provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceBinding) - if err != nil { - return nil, err - } - name := aPIServiceBinding.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceBinding.Name must be provided to Apply") - } - emptyResult := &v1alpha1.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiservicebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeAPIServiceBindings(fake *FakeKubeBindV1alpha1) typedkubebindv1alpha1.APIServiceBindingInterface { + return &fakeAPIServiceBindings{ + gentype.NewFakeClientWithListAndApply[*v1alpha1.APIServiceBinding, *v1alpha1.APIServiceBindingList, *kubebindv1alpha1.APIServiceBindingApplyConfiguration]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("apiservicebindings"), + v1alpha1.SchemeGroupVersion.WithKind("APIServiceBinding"), + func() *v1alpha1.APIServiceBinding { return &v1alpha1.APIServiceBinding{} }, + func() *v1alpha1.APIServiceBindingList { return &v1alpha1.APIServiceBindingList{} }, + func(dst, src *v1alpha1.APIServiceBindingList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.APIServiceBindingList) []*v1alpha1.APIServiceBinding { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.APIServiceBindingList, items []*v1alpha1.APIServiceBinding) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.APIServiceBinding), err } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexport.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexport.go index 27d19026e..b0ee06271 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexport.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexport.go @@ -19,180 +19,36 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/kubebind/v1alpha1" + typedkubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1" ) -// FakeAPIServiceExports implements APIServiceExportInterface -type FakeAPIServiceExports struct { +// fakeAPIServiceExports implements APIServiceExportInterface +type fakeAPIServiceExports struct { + *gentype.FakeClientWithListAndApply[*v1alpha1.APIServiceExport, *v1alpha1.APIServiceExportList, *kubebindv1alpha1.APIServiceExportApplyConfiguration] Fake *FakeKubeBindV1alpha1 - ns string -} - -var apiserviceexportsResource = v1alpha1.SchemeGroupVersion.WithResource("apiserviceexports") - -var apiserviceexportsKind = v1alpha1.SchemeGroupVersion.WithKind("APIServiceExport") - -// Get takes name of the aPIServiceExport, and returns the corresponding aPIServiceExport object, and an error if there is any. -func (c *FakeAPIServiceExports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.APIServiceExport, err error) { - emptyResult := &v1alpha1.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(apiserviceexportsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExport), err -} - -// List takes label and field selectors, and returns the list of APIServiceExports that match those selectors. -func (c *FakeAPIServiceExports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.APIServiceExportList, err error) { - emptyResult := &v1alpha1.APIServiceExportList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(apiserviceexportsResource, apiserviceexportsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.APIServiceExportList{ListMeta: obj.(*v1alpha1.APIServiceExportList).ListMeta} - for _, item := range obj.(*v1alpha1.APIServiceExportList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceExports. -func (c *FakeAPIServiceExports) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(apiserviceexportsResource, c.ns, opts)) - -} - -// Create takes the representation of a aPIServiceExport and creates it. Returns the server's representation of the aPIServiceExport, and an error, if there is any. -func (c *FakeAPIServiceExports) Create(ctx context.Context, aPIServiceExport *v1alpha1.APIServiceExport, opts v1.CreateOptions) (result *v1alpha1.APIServiceExport, err error) { - emptyResult := &v1alpha1.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(apiserviceexportsResource, c.ns, aPIServiceExport, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExport), err -} - -// Update takes the representation of a aPIServiceExport and updates it. Returns the server's representation of the aPIServiceExport, and an error, if there is any. -func (c *FakeAPIServiceExports) Update(ctx context.Context, aPIServiceExport *v1alpha1.APIServiceExport, opts v1.UpdateOptions) (result *v1alpha1.APIServiceExport, err error) { - emptyResult := &v1alpha1.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(apiserviceexportsResource, c.ns, aPIServiceExport, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExport), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceExports) UpdateStatus(ctx context.Context, aPIServiceExport *v1alpha1.APIServiceExport, opts v1.UpdateOptions) (result *v1alpha1.APIServiceExport, err error) { - emptyResult := &v1alpha1.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(apiserviceexportsResource, "status", c.ns, aPIServiceExport, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExport), err -} - -// Delete takes name of the aPIServiceExport and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceExports) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(apiserviceexportsResource, c.ns, name, opts), &v1alpha1.APIServiceExport{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceExports) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(apiserviceexportsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.APIServiceExportList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceExport. -func (c *FakeAPIServiceExports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.APIServiceExport, err error) { - emptyResult := &v1alpha1.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExport), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied aPIServiceExport. -func (c *FakeAPIServiceExports) Apply(ctx context.Context, aPIServiceExport *kubebindv1alpha1.APIServiceExportApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.APIServiceExport, err error) { - if aPIServiceExport == nil { - return nil, fmt.Errorf("aPIServiceExport provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceExport) - if err != nil { - return nil, err - } - name := aPIServiceExport.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceExport.Name must be provided to Apply") - } - emptyResult := &v1alpha1.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExport), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeAPIServiceExports) ApplyStatus(ctx context.Context, aPIServiceExport *kubebindv1alpha1.APIServiceExportApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.APIServiceExport, err error) { - if aPIServiceExport == nil { - return nil, fmt.Errorf("aPIServiceExport provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceExport) - if err != nil { - return nil, err - } - name := aPIServiceExport.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceExport.Name must be provided to Apply") - } - emptyResult := &v1alpha1.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeAPIServiceExports(fake *FakeKubeBindV1alpha1, namespace string) typedkubebindv1alpha1.APIServiceExportInterface { + return &fakeAPIServiceExports{ + gentype.NewFakeClientWithListAndApply[*v1alpha1.APIServiceExport, *v1alpha1.APIServiceExportList, *kubebindv1alpha1.APIServiceExportApplyConfiguration]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("apiserviceexports"), + v1alpha1.SchemeGroupVersion.WithKind("APIServiceExport"), + func() *v1alpha1.APIServiceExport { return &v1alpha1.APIServiceExport{} }, + func() *v1alpha1.APIServiceExportList { return &v1alpha1.APIServiceExportList{} }, + func(dst, src *v1alpha1.APIServiceExportList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.APIServiceExportList) []*v1alpha1.APIServiceExport { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.APIServiceExportList, items []*v1alpha1.APIServiceExport) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.APIServiceExport), err } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexportrequest.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexportrequest.go index f26e27d62..e49e01476 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexportrequest.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiserviceexportrequest.go @@ -19,180 +19,36 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/kubebind/v1alpha1" + typedkubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1" ) -// FakeAPIServiceExportRequests implements APIServiceExportRequestInterface -type FakeAPIServiceExportRequests struct { +// fakeAPIServiceExportRequests implements APIServiceExportRequestInterface +type fakeAPIServiceExportRequests struct { + *gentype.FakeClientWithListAndApply[*v1alpha1.APIServiceExportRequest, *v1alpha1.APIServiceExportRequestList, *kubebindv1alpha1.APIServiceExportRequestApplyConfiguration] Fake *FakeKubeBindV1alpha1 - ns string -} - -var apiserviceexportrequestsResource = v1alpha1.SchemeGroupVersion.WithResource("apiserviceexportrequests") - -var apiserviceexportrequestsKind = v1alpha1.SchemeGroupVersion.WithKind("APIServiceExportRequest") - -// Get takes name of the aPIServiceExportRequest, and returns the corresponding aPIServiceExportRequest object, and an error if there is any. -func (c *FakeAPIServiceExportRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.APIServiceExportRequest, err error) { - emptyResult := &v1alpha1.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(apiserviceexportrequestsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExportRequest), err -} - -// List takes label and field selectors, and returns the list of APIServiceExportRequests that match those selectors. -func (c *FakeAPIServiceExportRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.APIServiceExportRequestList, err error) { - emptyResult := &v1alpha1.APIServiceExportRequestList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(apiserviceexportrequestsResource, apiserviceexportrequestsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.APIServiceExportRequestList{ListMeta: obj.(*v1alpha1.APIServiceExportRequestList).ListMeta} - for _, item := range obj.(*v1alpha1.APIServiceExportRequestList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceExportRequests. -func (c *FakeAPIServiceExportRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(apiserviceexportrequestsResource, c.ns, opts)) - -} - -// Create takes the representation of a aPIServiceExportRequest and creates it. Returns the server's representation of the aPIServiceExportRequest, and an error, if there is any. -func (c *FakeAPIServiceExportRequests) Create(ctx context.Context, aPIServiceExportRequest *v1alpha1.APIServiceExportRequest, opts v1.CreateOptions) (result *v1alpha1.APIServiceExportRequest, err error) { - emptyResult := &v1alpha1.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(apiserviceexportrequestsResource, c.ns, aPIServiceExportRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExportRequest), err -} - -// Update takes the representation of a aPIServiceExportRequest and updates it. Returns the server's representation of the aPIServiceExportRequest, and an error, if there is any. -func (c *FakeAPIServiceExportRequests) Update(ctx context.Context, aPIServiceExportRequest *v1alpha1.APIServiceExportRequest, opts v1.UpdateOptions) (result *v1alpha1.APIServiceExportRequest, err error) { - emptyResult := &v1alpha1.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(apiserviceexportrequestsResource, c.ns, aPIServiceExportRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExportRequest), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceExportRequests) UpdateStatus(ctx context.Context, aPIServiceExportRequest *v1alpha1.APIServiceExportRequest, opts v1.UpdateOptions) (result *v1alpha1.APIServiceExportRequest, err error) { - emptyResult := &v1alpha1.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(apiserviceexportrequestsResource, "status", c.ns, aPIServiceExportRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExportRequest), err -} - -// Delete takes name of the aPIServiceExportRequest and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceExportRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(apiserviceexportrequestsResource, c.ns, name, opts), &v1alpha1.APIServiceExportRequest{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceExportRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(apiserviceexportrequestsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.APIServiceExportRequestList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceExportRequest. -func (c *FakeAPIServiceExportRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.APIServiceExportRequest, err error) { - emptyResult := &v1alpha1.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportrequestsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExportRequest), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied aPIServiceExportRequest. -func (c *FakeAPIServiceExportRequests) Apply(ctx context.Context, aPIServiceExportRequest *kubebindv1alpha1.APIServiceExportRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.APIServiceExportRequest, err error) { - if aPIServiceExportRequest == nil { - return nil, fmt.Errorf("aPIServiceExportRequest provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceExportRequest) - if err != nil { - return nil, err - } - name := aPIServiceExportRequest.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceExportRequest.Name must be provided to Apply") - } - emptyResult := &v1alpha1.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportrequestsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceExportRequest), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeAPIServiceExportRequests) ApplyStatus(ctx context.Context, aPIServiceExportRequest *kubebindv1alpha1.APIServiceExportRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.APIServiceExportRequest, err error) { - if aPIServiceExportRequest == nil { - return nil, fmt.Errorf("aPIServiceExportRequest provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceExportRequest) - if err != nil { - return nil, err - } - name := aPIServiceExportRequest.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceExportRequest.Name must be provided to Apply") - } - emptyResult := &v1alpha1.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportrequestsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeAPIServiceExportRequests(fake *FakeKubeBindV1alpha1, namespace string) typedkubebindv1alpha1.APIServiceExportRequestInterface { + return &fakeAPIServiceExportRequests{ + gentype.NewFakeClientWithListAndApply[*v1alpha1.APIServiceExportRequest, *v1alpha1.APIServiceExportRequestList, *kubebindv1alpha1.APIServiceExportRequestApplyConfiguration]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("apiserviceexportrequests"), + v1alpha1.SchemeGroupVersion.WithKind("APIServiceExportRequest"), + func() *v1alpha1.APIServiceExportRequest { return &v1alpha1.APIServiceExportRequest{} }, + func() *v1alpha1.APIServiceExportRequestList { return &v1alpha1.APIServiceExportRequestList{} }, + func(dst, src *v1alpha1.APIServiceExportRequestList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.APIServiceExportRequestList) []*v1alpha1.APIServiceExportRequest { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.APIServiceExportRequestList, items []*v1alpha1.APIServiceExportRequest) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.APIServiceExportRequest), err } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicenamespace.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicenamespace.go index fccaa7b5b..577869303 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicenamespace.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_apiservicenamespace.go @@ -19,180 +19,36 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/kubebind/v1alpha1" + typedkubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1" ) -// FakeAPIServiceNamespaces implements APIServiceNamespaceInterface -type FakeAPIServiceNamespaces struct { +// fakeAPIServiceNamespaces implements APIServiceNamespaceInterface +type fakeAPIServiceNamespaces struct { + *gentype.FakeClientWithListAndApply[*v1alpha1.APIServiceNamespace, *v1alpha1.APIServiceNamespaceList, *kubebindv1alpha1.APIServiceNamespaceApplyConfiguration] Fake *FakeKubeBindV1alpha1 - ns string -} - -var apiservicenamespacesResource = v1alpha1.SchemeGroupVersion.WithResource("apiservicenamespaces") - -var apiservicenamespacesKind = v1alpha1.SchemeGroupVersion.WithKind("APIServiceNamespace") - -// Get takes name of the aPIServiceNamespace, and returns the corresponding aPIServiceNamespace object, and an error if there is any. -func (c *FakeAPIServiceNamespaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.APIServiceNamespace, err error) { - emptyResult := &v1alpha1.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(apiservicenamespacesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceNamespace), err -} - -// List takes label and field selectors, and returns the list of APIServiceNamespaces that match those selectors. -func (c *FakeAPIServiceNamespaces) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.APIServiceNamespaceList, err error) { - emptyResult := &v1alpha1.APIServiceNamespaceList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(apiservicenamespacesResource, apiservicenamespacesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.APIServiceNamespaceList{ListMeta: obj.(*v1alpha1.APIServiceNamespaceList).ListMeta} - for _, item := range obj.(*v1alpha1.APIServiceNamespaceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceNamespaces. -func (c *FakeAPIServiceNamespaces) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(apiservicenamespacesResource, c.ns, opts)) - -} - -// Create takes the representation of a aPIServiceNamespace and creates it. Returns the server's representation of the aPIServiceNamespace, and an error, if there is any. -func (c *FakeAPIServiceNamespaces) Create(ctx context.Context, aPIServiceNamespace *v1alpha1.APIServiceNamespace, opts v1.CreateOptions) (result *v1alpha1.APIServiceNamespace, err error) { - emptyResult := &v1alpha1.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(apiservicenamespacesResource, c.ns, aPIServiceNamespace, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceNamespace), err -} - -// Update takes the representation of a aPIServiceNamespace and updates it. Returns the server's representation of the aPIServiceNamespace, and an error, if there is any. -func (c *FakeAPIServiceNamespaces) Update(ctx context.Context, aPIServiceNamespace *v1alpha1.APIServiceNamespace, opts v1.UpdateOptions) (result *v1alpha1.APIServiceNamespace, err error) { - emptyResult := &v1alpha1.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(apiservicenamespacesResource, c.ns, aPIServiceNamespace, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceNamespace), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceNamespaces) UpdateStatus(ctx context.Context, aPIServiceNamespace *v1alpha1.APIServiceNamespace, opts v1.UpdateOptions) (result *v1alpha1.APIServiceNamespace, err error) { - emptyResult := &v1alpha1.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(apiservicenamespacesResource, "status", c.ns, aPIServiceNamespace, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceNamespace), err -} - -// Delete takes name of the aPIServiceNamespace and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceNamespaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(apiservicenamespacesResource, c.ns, name, opts), &v1alpha1.APIServiceNamespace{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceNamespaces) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(apiservicenamespacesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.APIServiceNamespaceList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceNamespace. -func (c *FakeAPIServiceNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.APIServiceNamespace, err error) { - emptyResult := &v1alpha1.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiservicenamespacesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceNamespace), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied aPIServiceNamespace. -func (c *FakeAPIServiceNamespaces) Apply(ctx context.Context, aPIServiceNamespace *kubebindv1alpha1.APIServiceNamespaceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.APIServiceNamespace, err error) { - if aPIServiceNamespace == nil { - return nil, fmt.Errorf("aPIServiceNamespace provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceNamespace) - if err != nil { - return nil, err - } - name := aPIServiceNamespace.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceNamespace.Name must be provided to Apply") - } - emptyResult := &v1alpha1.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiservicenamespacesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.APIServiceNamespace), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeAPIServiceNamespaces) ApplyStatus(ctx context.Context, aPIServiceNamespace *kubebindv1alpha1.APIServiceNamespaceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.APIServiceNamespace, err error) { - if aPIServiceNamespace == nil { - return nil, fmt.Errorf("aPIServiceNamespace provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceNamespace) - if err != nil { - return nil, err - } - name := aPIServiceNamespace.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceNamespace.Name must be provided to Apply") - } - emptyResult := &v1alpha1.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiservicenamespacesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeAPIServiceNamespaces(fake *FakeKubeBindV1alpha1, namespace string) typedkubebindv1alpha1.APIServiceNamespaceInterface { + return &fakeAPIServiceNamespaces{ + gentype.NewFakeClientWithListAndApply[*v1alpha1.APIServiceNamespace, *v1alpha1.APIServiceNamespaceList, *kubebindv1alpha1.APIServiceNamespaceApplyConfiguration]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("apiservicenamespaces"), + v1alpha1.SchemeGroupVersion.WithKind("APIServiceNamespace"), + func() *v1alpha1.APIServiceNamespace { return &v1alpha1.APIServiceNamespace{} }, + func() *v1alpha1.APIServiceNamespaceList { return &v1alpha1.APIServiceNamespaceList{} }, + func(dst, src *v1alpha1.APIServiceNamespaceList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.APIServiceNamespaceList) []*v1alpha1.APIServiceNamespace { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.APIServiceNamespaceList, items []*v1alpha1.APIServiceNamespace) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.APIServiceNamespace), err } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_clusterbinding.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_clusterbinding.go index 496012475..3e5673bb3 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_clusterbinding.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_clusterbinding.go @@ -19,180 +19,36 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha1 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha1" kubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/kubebind/v1alpha1" + typedkubebindv1alpha1 "github.com/kube-bind/kube-bind/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1" ) -// FakeClusterBindings implements ClusterBindingInterface -type FakeClusterBindings struct { +// fakeClusterBindings implements ClusterBindingInterface +type fakeClusterBindings struct { + *gentype.FakeClientWithListAndApply[*v1alpha1.ClusterBinding, *v1alpha1.ClusterBindingList, *kubebindv1alpha1.ClusterBindingApplyConfiguration] Fake *FakeKubeBindV1alpha1 - ns string -} - -var clusterbindingsResource = v1alpha1.SchemeGroupVersion.WithResource("clusterbindings") - -var clusterbindingsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterBinding") - -// Get takes name of the clusterBinding, and returns the corresponding clusterBinding object, and an error if there is any. -func (c *FakeClusterBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterBinding, err error) { - emptyResult := &v1alpha1.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(clusterbindingsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterBinding), err -} - -// List takes label and field selectors, and returns the list of ClusterBindings that match those selectors. -func (c *FakeClusterBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterBindingList, err error) { - emptyResult := &v1alpha1.ClusterBindingList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(clusterbindingsResource, clusterbindingsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ClusterBindingList{ListMeta: obj.(*v1alpha1.ClusterBindingList).ListMeta} - for _, item := range obj.(*v1alpha1.ClusterBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterBindings. -func (c *FakeClusterBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(clusterbindingsResource, c.ns, opts)) - -} - -// Create takes the representation of a clusterBinding and creates it. Returns the server's representation of the clusterBinding, and an error, if there is any. -func (c *FakeClusterBindings) Create(ctx context.Context, clusterBinding *v1alpha1.ClusterBinding, opts v1.CreateOptions) (result *v1alpha1.ClusterBinding, err error) { - emptyResult := &v1alpha1.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(clusterbindingsResource, c.ns, clusterBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterBinding), err -} - -// Update takes the representation of a clusterBinding and updates it. Returns the server's representation of the clusterBinding, and an error, if there is any. -func (c *FakeClusterBindings) Update(ctx context.Context, clusterBinding *v1alpha1.ClusterBinding, opts v1.UpdateOptions) (result *v1alpha1.ClusterBinding, err error) { - emptyResult := &v1alpha1.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(clusterbindingsResource, c.ns, clusterBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterBinding), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusterBindings) UpdateStatus(ctx context.Context, clusterBinding *v1alpha1.ClusterBinding, opts v1.UpdateOptions) (result *v1alpha1.ClusterBinding, err error) { - emptyResult := &v1alpha1.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(clusterbindingsResource, "status", c.ns, clusterBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterBinding), err -} - -// Delete takes name of the clusterBinding and deletes it. Returns an error if one occurs. -func (c *FakeClusterBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(clusterbindingsResource, c.ns, name, opts), &v1alpha1.ClusterBinding{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(clusterbindingsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ClusterBindingList{}) - return err -} - -// Patch applies the patch and returns the patched clusterBinding. -func (c *FakeClusterBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterBinding, err error) { - emptyResult := &v1alpha1.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(clusterbindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied clusterBinding. -func (c *FakeClusterBindings) Apply(ctx context.Context, clusterBinding *kubebindv1alpha1.ClusterBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterBinding, err error) { - if clusterBinding == nil { - return nil, fmt.Errorf("clusterBinding provided to Apply must not be nil") - } - data, err := json.Marshal(clusterBinding) - if err != nil { - return nil, err - } - name := clusterBinding.Name - if name == nil { - return nil, fmt.Errorf("clusterBinding.Name must be provided to Apply") - } - emptyResult := &v1alpha1.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(clusterbindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.ClusterBinding), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeClusterBindings) ApplyStatus(ctx context.Context, clusterBinding *kubebindv1alpha1.ClusterBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterBinding, err error) { - if clusterBinding == nil { - return nil, fmt.Errorf("clusterBinding provided to Apply must not be nil") - } - data, err := json.Marshal(clusterBinding) - if err != nil { - return nil, err - } - name := clusterBinding.Name - if name == nil { - return nil, fmt.Errorf("clusterBinding.Name must be provided to Apply") - } - emptyResult := &v1alpha1.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(clusterbindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeClusterBindings(fake *FakeKubeBindV1alpha1, namespace string) typedkubebindv1alpha1.ClusterBindingInterface { + return &fakeClusterBindings{ + gentype.NewFakeClientWithListAndApply[*v1alpha1.ClusterBinding, *v1alpha1.ClusterBindingList, *kubebindv1alpha1.ClusterBindingApplyConfiguration]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("clusterbindings"), + v1alpha1.SchemeGroupVersion.WithKind("ClusterBinding"), + func() *v1alpha1.ClusterBinding { return &v1alpha1.ClusterBinding{} }, + func() *v1alpha1.ClusterBindingList { return &v1alpha1.ClusterBindingList{} }, + func(dst, src *v1alpha1.ClusterBindingList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ClusterBindingList) []*v1alpha1.ClusterBinding { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ClusterBindingList, items []*v1alpha1.ClusterBinding) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.ClusterBinding), err } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_kubebind_client.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_kubebind_client.go index d51145bcd..d537a6a84 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_kubebind_client.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha1/fake/fake_kubebind_client.go @@ -30,23 +30,23 @@ type FakeKubeBindV1alpha1 struct { } func (c *FakeKubeBindV1alpha1) APIServiceBindings() v1alpha1.APIServiceBindingInterface { - return &FakeAPIServiceBindings{c} + return newFakeAPIServiceBindings(c) } func (c *FakeKubeBindV1alpha1) APIServiceExports(namespace string) v1alpha1.APIServiceExportInterface { - return &FakeAPIServiceExports{c, namespace} + return newFakeAPIServiceExports(c, namespace) } func (c *FakeKubeBindV1alpha1) APIServiceExportRequests(namespace string) v1alpha1.APIServiceExportRequestInterface { - return &FakeAPIServiceExportRequests{c, namespace} + return newFakeAPIServiceExportRequests(c, namespace) } func (c *FakeKubeBindV1alpha1) APIServiceNamespaces(namespace string) v1alpha1.APIServiceNamespaceInterface { - return &FakeAPIServiceNamespaces{c, namespace} + return newFakeAPIServiceNamespaces(c, namespace) } func (c *FakeKubeBindV1alpha1) ClusterBindings(namespace string) v1alpha1.ClusterBindingInterface { - return &FakeClusterBindings{c, namespace} + return newFakeClusterBindings(c, namespace) } // RESTClient returns a RESTClient that is used to communicate diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiresourceschema.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiresourceschema.go index 8e2cd0659..69f866331 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiresourceschema.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiresourceschema.go @@ -19,134 +19,36 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/kubebind/v1alpha2" + typedkubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeAPIResourceSchemas implements APIResourceSchemaInterface -type FakeAPIResourceSchemas struct { +// fakeAPIResourceSchemas implements APIResourceSchemaInterface +type fakeAPIResourceSchemas struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.APIResourceSchema, *v1alpha2.APIResourceSchemaList, *kubebindv1alpha2.APIResourceSchemaApplyConfiguration] Fake *FakeKubeBindV1alpha2 } -var apiresourceschemasResource = v1alpha2.SchemeGroupVersion.WithResource("apiresourceschemas") - -var apiresourceschemasKind = v1alpha2.SchemeGroupVersion.WithKind("APIResourceSchema") - -// Get takes name of the aPIResourceSchema, and returns the corresponding aPIResourceSchema object, and an error if there is any. -func (c *FakeAPIResourceSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.APIResourceSchema, err error) { - emptyResult := &v1alpha2.APIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(apiresourceschemasResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIResourceSchema), err -} - -// List takes label and field selectors, and returns the list of APIResourceSchemas that match those selectors. -func (c *FakeAPIResourceSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.APIResourceSchemaList, err error) { - emptyResult := &v1alpha2.APIResourceSchemaList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(apiresourceschemasResource, apiresourceschemasKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.APIResourceSchemaList{ListMeta: obj.(*v1alpha2.APIResourceSchemaList).ListMeta} - for _, item := range obj.(*v1alpha2.APIResourceSchemaList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIResourceSchemas. -func (c *FakeAPIResourceSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(apiresourceschemasResource, opts)) -} - -// Create takes the representation of a aPIResourceSchema and creates it. Returns the server's representation of the aPIResourceSchema, and an error, if there is any. -func (c *FakeAPIResourceSchemas) Create(ctx context.Context, aPIResourceSchema *v1alpha2.APIResourceSchema, opts v1.CreateOptions) (result *v1alpha2.APIResourceSchema, err error) { - emptyResult := &v1alpha2.APIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(apiresourceschemasResource, aPIResourceSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIResourceSchema), err -} - -// Update takes the representation of a aPIResourceSchema and updates it. Returns the server's representation of the aPIResourceSchema, and an error, if there is any. -func (c *FakeAPIResourceSchemas) Update(ctx context.Context, aPIResourceSchema *v1alpha2.APIResourceSchema, opts v1.UpdateOptions) (result *v1alpha2.APIResourceSchema, err error) { - emptyResult := &v1alpha2.APIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(apiresourceschemasResource, aPIResourceSchema, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIResourceSchema), err -} - -// Delete takes name of the aPIResourceSchema and deletes it. Returns an error if one occurs. -func (c *FakeAPIResourceSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(apiresourceschemasResource, name, opts), &v1alpha2.APIResourceSchema{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIResourceSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(apiresourceschemasResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.APIResourceSchemaList{}) - return err -} - -// Patch applies the patch and returns the patched aPIResourceSchema. -func (c *FakeAPIResourceSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIResourceSchema, err error) { - emptyResult := &v1alpha2.APIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiresourceschemasResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIResourceSchema), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied aPIResourceSchema. -func (c *FakeAPIResourceSchemas) Apply(ctx context.Context, aPIResourceSchema *kubebindv1alpha2.APIResourceSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.APIResourceSchema, err error) { - if aPIResourceSchema == nil { - return nil, fmt.Errorf("aPIResourceSchema provided to Apply must not be nil") - } - data, err := json.Marshal(aPIResourceSchema) - if err != nil { - return nil, err - } - name := aPIResourceSchema.Name - if name == nil { - return nil, fmt.Errorf("aPIResourceSchema.Name must be provided to Apply") - } - emptyResult := &v1alpha2.APIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiresourceschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeAPIResourceSchemas(fake *FakeKubeBindV1alpha2) typedkubebindv1alpha2.APIResourceSchemaInterface { + return &fakeAPIResourceSchemas{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.APIResourceSchema, *v1alpha2.APIResourceSchemaList, *kubebindv1alpha2.APIResourceSchemaApplyConfiguration]( + fake.Fake, + "", + v1alpha2.SchemeGroupVersion.WithResource("apiresourceschemas"), + v1alpha2.SchemeGroupVersion.WithKind("APIResourceSchema"), + func() *v1alpha2.APIResourceSchema { return &v1alpha2.APIResourceSchema{} }, + func() *v1alpha2.APIResourceSchemaList { return &v1alpha2.APIResourceSchemaList{} }, + func(dst, src *v1alpha2.APIResourceSchemaList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.APIResourceSchemaList) []*v1alpha2.APIResourceSchema { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.APIResourceSchemaList, items []*v1alpha2.APIResourceSchema) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.APIResourceSchema), err } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicebinding.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicebinding.go index 5d6c88bc2..c15b43ce2 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicebinding.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicebinding.go @@ -19,169 +19,36 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/kubebind/v1alpha2" + typedkubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeAPIServiceBindings implements APIServiceBindingInterface -type FakeAPIServiceBindings struct { +// fakeAPIServiceBindings implements APIServiceBindingInterface +type fakeAPIServiceBindings struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.APIServiceBinding, *v1alpha2.APIServiceBindingList, *kubebindv1alpha2.APIServiceBindingApplyConfiguration] Fake *FakeKubeBindV1alpha2 } -var apiservicebindingsResource = v1alpha2.SchemeGroupVersion.WithResource("apiservicebindings") - -var apiservicebindingsKind = v1alpha2.SchemeGroupVersion.WithKind("APIServiceBinding") - -// Get takes name of the aPIServiceBinding, and returns the corresponding aPIServiceBinding object, and an error if there is any. -func (c *FakeAPIServiceBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.APIServiceBinding, err error) { - emptyResult := &v1alpha2.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(apiservicebindingsResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceBinding), err -} - -// List takes label and field selectors, and returns the list of APIServiceBindings that match those selectors. -func (c *FakeAPIServiceBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.APIServiceBindingList, err error) { - emptyResult := &v1alpha2.APIServiceBindingList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(apiservicebindingsResource, apiservicebindingsKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.APIServiceBindingList{ListMeta: obj.(*v1alpha2.APIServiceBindingList).ListMeta} - for _, item := range obj.(*v1alpha2.APIServiceBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceBindings. -func (c *FakeAPIServiceBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(apiservicebindingsResource, opts)) -} - -// Create takes the representation of a aPIServiceBinding and creates it. Returns the server's representation of the aPIServiceBinding, and an error, if there is any. -func (c *FakeAPIServiceBindings) Create(ctx context.Context, aPIServiceBinding *v1alpha2.APIServiceBinding, opts v1.CreateOptions) (result *v1alpha2.APIServiceBinding, err error) { - emptyResult := &v1alpha2.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(apiservicebindingsResource, aPIServiceBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceBinding), err -} - -// Update takes the representation of a aPIServiceBinding and updates it. Returns the server's representation of the aPIServiceBinding, and an error, if there is any. -func (c *FakeAPIServiceBindings) Update(ctx context.Context, aPIServiceBinding *v1alpha2.APIServiceBinding, opts v1.UpdateOptions) (result *v1alpha2.APIServiceBinding, err error) { - emptyResult := &v1alpha2.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(apiservicebindingsResource, aPIServiceBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceBinding), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceBindings) UpdateStatus(ctx context.Context, aPIServiceBinding *v1alpha2.APIServiceBinding, opts v1.UpdateOptions) (result *v1alpha2.APIServiceBinding, err error) { - emptyResult := &v1alpha2.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(apiservicebindingsResource, "status", aPIServiceBinding, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceBinding), err -} - -// Delete takes name of the aPIServiceBinding and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(apiservicebindingsResource, name, opts), &v1alpha2.APIServiceBinding{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(apiservicebindingsResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.APIServiceBindingList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceBinding. -func (c *FakeAPIServiceBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIServiceBinding, err error) { - emptyResult := &v1alpha2.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiservicebindingsResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied aPIServiceBinding. -func (c *FakeAPIServiceBindings) Apply(ctx context.Context, aPIServiceBinding *kubebindv1alpha2.APIServiceBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.APIServiceBinding, err error) { - if aPIServiceBinding == nil { - return nil, fmt.Errorf("aPIServiceBinding provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceBinding) - if err != nil { - return nil, err - } - name := aPIServiceBinding.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceBinding.Name must be provided to Apply") - } - emptyResult := &v1alpha2.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiservicebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceBinding), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeAPIServiceBindings) ApplyStatus(ctx context.Context, aPIServiceBinding *kubebindv1alpha2.APIServiceBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.APIServiceBinding, err error) { - if aPIServiceBinding == nil { - return nil, fmt.Errorf("aPIServiceBinding provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceBinding) - if err != nil { - return nil, err - } - name := aPIServiceBinding.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceBinding.Name must be provided to Apply") - } - emptyResult := &v1alpha2.APIServiceBinding{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(apiservicebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeAPIServiceBindings(fake *FakeKubeBindV1alpha2) typedkubebindv1alpha2.APIServiceBindingInterface { + return &fakeAPIServiceBindings{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.APIServiceBinding, *v1alpha2.APIServiceBindingList, *kubebindv1alpha2.APIServiceBindingApplyConfiguration]( + fake.Fake, + "", + v1alpha2.SchemeGroupVersion.WithResource("apiservicebindings"), + v1alpha2.SchemeGroupVersion.WithKind("APIServiceBinding"), + func() *v1alpha2.APIServiceBinding { return &v1alpha2.APIServiceBinding{} }, + func() *v1alpha2.APIServiceBindingList { return &v1alpha2.APIServiceBindingList{} }, + func(dst, src *v1alpha2.APIServiceBindingList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.APIServiceBindingList) []*v1alpha2.APIServiceBinding { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.APIServiceBindingList, items []*v1alpha2.APIServiceBinding) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.APIServiceBinding), err } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexport.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexport.go index 9b7bd8be2..d99e7662a 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexport.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexport.go @@ -19,180 +19,36 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/kubebind/v1alpha2" + typedkubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeAPIServiceExports implements APIServiceExportInterface -type FakeAPIServiceExports struct { +// fakeAPIServiceExports implements APIServiceExportInterface +type fakeAPIServiceExports struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.APIServiceExport, *v1alpha2.APIServiceExportList, *kubebindv1alpha2.APIServiceExportApplyConfiguration] Fake *FakeKubeBindV1alpha2 - ns string -} - -var apiserviceexportsResource = v1alpha2.SchemeGroupVersion.WithResource("apiserviceexports") - -var apiserviceexportsKind = v1alpha2.SchemeGroupVersion.WithKind("APIServiceExport") - -// Get takes name of the aPIServiceExport, and returns the corresponding aPIServiceExport object, and an error if there is any. -func (c *FakeAPIServiceExports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.APIServiceExport, err error) { - emptyResult := &v1alpha2.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(apiserviceexportsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExport), err -} - -// List takes label and field selectors, and returns the list of APIServiceExports that match those selectors. -func (c *FakeAPIServiceExports) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.APIServiceExportList, err error) { - emptyResult := &v1alpha2.APIServiceExportList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(apiserviceexportsResource, apiserviceexportsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.APIServiceExportList{ListMeta: obj.(*v1alpha2.APIServiceExportList).ListMeta} - for _, item := range obj.(*v1alpha2.APIServiceExportList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceExports. -func (c *FakeAPIServiceExports) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(apiserviceexportsResource, c.ns, opts)) - -} - -// Create takes the representation of a aPIServiceExport and creates it. Returns the server's representation of the aPIServiceExport, and an error, if there is any. -func (c *FakeAPIServiceExports) Create(ctx context.Context, aPIServiceExport *v1alpha2.APIServiceExport, opts v1.CreateOptions) (result *v1alpha2.APIServiceExport, err error) { - emptyResult := &v1alpha2.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(apiserviceexportsResource, c.ns, aPIServiceExport, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExport), err -} - -// Update takes the representation of a aPIServiceExport and updates it. Returns the server's representation of the aPIServiceExport, and an error, if there is any. -func (c *FakeAPIServiceExports) Update(ctx context.Context, aPIServiceExport *v1alpha2.APIServiceExport, opts v1.UpdateOptions) (result *v1alpha2.APIServiceExport, err error) { - emptyResult := &v1alpha2.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(apiserviceexportsResource, c.ns, aPIServiceExport, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExport), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceExports) UpdateStatus(ctx context.Context, aPIServiceExport *v1alpha2.APIServiceExport, opts v1.UpdateOptions) (result *v1alpha2.APIServiceExport, err error) { - emptyResult := &v1alpha2.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(apiserviceexportsResource, "status", c.ns, aPIServiceExport, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExport), err -} - -// Delete takes name of the aPIServiceExport and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceExports) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(apiserviceexportsResource, c.ns, name, opts), &v1alpha2.APIServiceExport{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceExports) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(apiserviceexportsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.APIServiceExportList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceExport. -func (c *FakeAPIServiceExports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIServiceExport, err error) { - emptyResult := &v1alpha2.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExport), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied aPIServiceExport. -func (c *FakeAPIServiceExports) Apply(ctx context.Context, aPIServiceExport *kubebindv1alpha2.APIServiceExportApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.APIServiceExport, err error) { - if aPIServiceExport == nil { - return nil, fmt.Errorf("aPIServiceExport provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceExport) - if err != nil { - return nil, err - } - name := aPIServiceExport.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceExport.Name must be provided to Apply") - } - emptyResult := &v1alpha2.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExport), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeAPIServiceExports) ApplyStatus(ctx context.Context, aPIServiceExport *kubebindv1alpha2.APIServiceExportApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.APIServiceExport, err error) { - if aPIServiceExport == nil { - return nil, fmt.Errorf("aPIServiceExport provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceExport) - if err != nil { - return nil, err - } - name := aPIServiceExport.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceExport.Name must be provided to Apply") - } - emptyResult := &v1alpha2.APIServiceExport{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeAPIServiceExports(fake *FakeKubeBindV1alpha2, namespace string) typedkubebindv1alpha2.APIServiceExportInterface { + return &fakeAPIServiceExports{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.APIServiceExport, *v1alpha2.APIServiceExportList, *kubebindv1alpha2.APIServiceExportApplyConfiguration]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("apiserviceexports"), + v1alpha2.SchemeGroupVersion.WithKind("APIServiceExport"), + func() *v1alpha2.APIServiceExport { return &v1alpha2.APIServiceExport{} }, + func() *v1alpha2.APIServiceExportList { return &v1alpha2.APIServiceExportList{} }, + func(dst, src *v1alpha2.APIServiceExportList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.APIServiceExportList) []*v1alpha2.APIServiceExport { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.APIServiceExportList, items []*v1alpha2.APIServiceExport) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.APIServiceExport), err } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexportrequest.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexportrequest.go index f5bb00327..5fafe4714 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexportrequest.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiserviceexportrequest.go @@ -19,180 +19,36 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/kubebind/v1alpha2" + typedkubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeAPIServiceExportRequests implements APIServiceExportRequestInterface -type FakeAPIServiceExportRequests struct { +// fakeAPIServiceExportRequests implements APIServiceExportRequestInterface +type fakeAPIServiceExportRequests struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.APIServiceExportRequest, *v1alpha2.APIServiceExportRequestList, *kubebindv1alpha2.APIServiceExportRequestApplyConfiguration] Fake *FakeKubeBindV1alpha2 - ns string -} - -var apiserviceexportrequestsResource = v1alpha2.SchemeGroupVersion.WithResource("apiserviceexportrequests") - -var apiserviceexportrequestsKind = v1alpha2.SchemeGroupVersion.WithKind("APIServiceExportRequest") - -// Get takes name of the aPIServiceExportRequest, and returns the corresponding aPIServiceExportRequest object, and an error if there is any. -func (c *FakeAPIServiceExportRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.APIServiceExportRequest, err error) { - emptyResult := &v1alpha2.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(apiserviceexportrequestsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExportRequest), err -} - -// List takes label and field selectors, and returns the list of APIServiceExportRequests that match those selectors. -func (c *FakeAPIServiceExportRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.APIServiceExportRequestList, err error) { - emptyResult := &v1alpha2.APIServiceExportRequestList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(apiserviceexportrequestsResource, apiserviceexportrequestsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.APIServiceExportRequestList{ListMeta: obj.(*v1alpha2.APIServiceExportRequestList).ListMeta} - for _, item := range obj.(*v1alpha2.APIServiceExportRequestList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceExportRequests. -func (c *FakeAPIServiceExportRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(apiserviceexportrequestsResource, c.ns, opts)) - -} - -// Create takes the representation of a aPIServiceExportRequest and creates it. Returns the server's representation of the aPIServiceExportRequest, and an error, if there is any. -func (c *FakeAPIServiceExportRequests) Create(ctx context.Context, aPIServiceExportRequest *v1alpha2.APIServiceExportRequest, opts v1.CreateOptions) (result *v1alpha2.APIServiceExportRequest, err error) { - emptyResult := &v1alpha2.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(apiserviceexportrequestsResource, c.ns, aPIServiceExportRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExportRequest), err -} - -// Update takes the representation of a aPIServiceExportRequest and updates it. Returns the server's representation of the aPIServiceExportRequest, and an error, if there is any. -func (c *FakeAPIServiceExportRequests) Update(ctx context.Context, aPIServiceExportRequest *v1alpha2.APIServiceExportRequest, opts v1.UpdateOptions) (result *v1alpha2.APIServiceExportRequest, err error) { - emptyResult := &v1alpha2.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(apiserviceexportrequestsResource, c.ns, aPIServiceExportRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExportRequest), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceExportRequests) UpdateStatus(ctx context.Context, aPIServiceExportRequest *v1alpha2.APIServiceExportRequest, opts v1.UpdateOptions) (result *v1alpha2.APIServiceExportRequest, err error) { - emptyResult := &v1alpha2.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(apiserviceexportrequestsResource, "status", c.ns, aPIServiceExportRequest, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExportRequest), err -} - -// Delete takes name of the aPIServiceExportRequest and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceExportRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(apiserviceexportrequestsResource, c.ns, name, opts), &v1alpha2.APIServiceExportRequest{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceExportRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(apiserviceexportrequestsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.APIServiceExportRequestList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceExportRequest. -func (c *FakeAPIServiceExportRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIServiceExportRequest, err error) { - emptyResult := &v1alpha2.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportrequestsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExportRequest), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied aPIServiceExportRequest. -func (c *FakeAPIServiceExportRequests) Apply(ctx context.Context, aPIServiceExportRequest *kubebindv1alpha2.APIServiceExportRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.APIServiceExportRequest, err error) { - if aPIServiceExportRequest == nil { - return nil, fmt.Errorf("aPIServiceExportRequest provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceExportRequest) - if err != nil { - return nil, err - } - name := aPIServiceExportRequest.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceExportRequest.Name must be provided to Apply") - } - emptyResult := &v1alpha2.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportrequestsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceExportRequest), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeAPIServiceExportRequests) ApplyStatus(ctx context.Context, aPIServiceExportRequest *kubebindv1alpha2.APIServiceExportRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.APIServiceExportRequest, err error) { - if aPIServiceExportRequest == nil { - return nil, fmt.Errorf("aPIServiceExportRequest provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceExportRequest) - if err != nil { - return nil, err - } - name := aPIServiceExportRequest.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceExportRequest.Name must be provided to Apply") - } - emptyResult := &v1alpha2.APIServiceExportRequest{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiserviceexportrequestsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeAPIServiceExportRequests(fake *FakeKubeBindV1alpha2, namespace string) typedkubebindv1alpha2.APIServiceExportRequestInterface { + return &fakeAPIServiceExportRequests{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.APIServiceExportRequest, *v1alpha2.APIServiceExportRequestList, *kubebindv1alpha2.APIServiceExportRequestApplyConfiguration]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("apiserviceexportrequests"), + v1alpha2.SchemeGroupVersion.WithKind("APIServiceExportRequest"), + func() *v1alpha2.APIServiceExportRequest { return &v1alpha2.APIServiceExportRequest{} }, + func() *v1alpha2.APIServiceExportRequestList { return &v1alpha2.APIServiceExportRequestList{} }, + func(dst, src *v1alpha2.APIServiceExportRequestList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.APIServiceExportRequestList) []*v1alpha2.APIServiceExportRequest { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.APIServiceExportRequestList, items []*v1alpha2.APIServiceExportRequest) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.APIServiceExportRequest), err } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicenamespace.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicenamespace.go index fa67c78e2..7236cb901 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicenamespace.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_apiservicenamespace.go @@ -19,180 +19,36 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/kubebind/v1alpha2" + typedkubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeAPIServiceNamespaces implements APIServiceNamespaceInterface -type FakeAPIServiceNamespaces struct { +// fakeAPIServiceNamespaces implements APIServiceNamespaceInterface +type fakeAPIServiceNamespaces struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.APIServiceNamespace, *v1alpha2.APIServiceNamespaceList, *kubebindv1alpha2.APIServiceNamespaceApplyConfiguration] Fake *FakeKubeBindV1alpha2 - ns string -} - -var apiservicenamespacesResource = v1alpha2.SchemeGroupVersion.WithResource("apiservicenamespaces") - -var apiservicenamespacesKind = v1alpha2.SchemeGroupVersion.WithKind("APIServiceNamespace") - -// Get takes name of the aPIServiceNamespace, and returns the corresponding aPIServiceNamespace object, and an error if there is any. -func (c *FakeAPIServiceNamespaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.APIServiceNamespace, err error) { - emptyResult := &v1alpha2.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(apiservicenamespacesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceNamespace), err -} - -// List takes label and field selectors, and returns the list of APIServiceNamespaces that match those selectors. -func (c *FakeAPIServiceNamespaces) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.APIServiceNamespaceList, err error) { - emptyResult := &v1alpha2.APIServiceNamespaceList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(apiservicenamespacesResource, apiservicenamespacesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.APIServiceNamespaceList{ListMeta: obj.(*v1alpha2.APIServiceNamespaceList).ListMeta} - for _, item := range obj.(*v1alpha2.APIServiceNamespaceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested aPIServiceNamespaces. -func (c *FakeAPIServiceNamespaces) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(apiservicenamespacesResource, c.ns, opts)) - -} - -// Create takes the representation of a aPIServiceNamespace and creates it. Returns the server's representation of the aPIServiceNamespace, and an error, if there is any. -func (c *FakeAPIServiceNamespaces) Create(ctx context.Context, aPIServiceNamespace *v1alpha2.APIServiceNamespace, opts v1.CreateOptions) (result *v1alpha2.APIServiceNamespace, err error) { - emptyResult := &v1alpha2.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(apiservicenamespacesResource, c.ns, aPIServiceNamespace, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceNamespace), err -} - -// Update takes the representation of a aPIServiceNamespace and updates it. Returns the server's representation of the aPIServiceNamespace, and an error, if there is any. -func (c *FakeAPIServiceNamespaces) Update(ctx context.Context, aPIServiceNamespace *v1alpha2.APIServiceNamespace, opts v1.UpdateOptions) (result *v1alpha2.APIServiceNamespace, err error) { - emptyResult := &v1alpha2.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(apiservicenamespacesResource, c.ns, aPIServiceNamespace, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceNamespace), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAPIServiceNamespaces) UpdateStatus(ctx context.Context, aPIServiceNamespace *v1alpha2.APIServiceNamespace, opts v1.UpdateOptions) (result *v1alpha2.APIServiceNamespace, err error) { - emptyResult := &v1alpha2.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(apiservicenamespacesResource, "status", c.ns, aPIServiceNamespace, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceNamespace), err -} - -// Delete takes name of the aPIServiceNamespace and deletes it. Returns an error if one occurs. -func (c *FakeAPIServiceNamespaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(apiservicenamespacesResource, c.ns, name, opts), &v1alpha2.APIServiceNamespace{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeAPIServiceNamespaces) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(apiservicenamespacesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.APIServiceNamespaceList{}) - return err -} - -// Patch applies the patch and returns the patched aPIServiceNamespace. -func (c *FakeAPIServiceNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.APIServiceNamespace, err error) { - emptyResult := &v1alpha2.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiservicenamespacesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceNamespace), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied aPIServiceNamespace. -func (c *FakeAPIServiceNamespaces) Apply(ctx context.Context, aPIServiceNamespace *kubebindv1alpha2.APIServiceNamespaceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.APIServiceNamespace, err error) { - if aPIServiceNamespace == nil { - return nil, fmt.Errorf("aPIServiceNamespace provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceNamespace) - if err != nil { - return nil, err - } - name := aPIServiceNamespace.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceNamespace.Name must be provided to Apply") - } - emptyResult := &v1alpha2.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiservicenamespacesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.APIServiceNamespace), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeAPIServiceNamespaces) ApplyStatus(ctx context.Context, aPIServiceNamespace *kubebindv1alpha2.APIServiceNamespaceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.APIServiceNamespace, err error) { - if aPIServiceNamespace == nil { - return nil, fmt.Errorf("aPIServiceNamespace provided to Apply must not be nil") - } - data, err := json.Marshal(aPIServiceNamespace) - if err != nil { - return nil, err - } - name := aPIServiceNamespace.Name - if name == nil { - return nil, fmt.Errorf("aPIServiceNamespace.Name must be provided to Apply") - } - emptyResult := &v1alpha2.APIServiceNamespace{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(apiservicenamespacesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeAPIServiceNamespaces(fake *FakeKubeBindV1alpha2, namespace string) typedkubebindv1alpha2.APIServiceNamespaceInterface { + return &fakeAPIServiceNamespaces{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.APIServiceNamespace, *v1alpha2.APIServiceNamespaceList, *kubebindv1alpha2.APIServiceNamespaceApplyConfiguration]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("apiservicenamespaces"), + v1alpha2.SchemeGroupVersion.WithKind("APIServiceNamespace"), + func() *v1alpha2.APIServiceNamespace { return &v1alpha2.APIServiceNamespace{} }, + func() *v1alpha2.APIServiceNamespaceList { return &v1alpha2.APIServiceNamespaceList{} }, + func(dst, src *v1alpha2.APIServiceNamespaceList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.APIServiceNamespaceList) []*v1alpha2.APIServiceNamespace { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.APIServiceNamespaceList, items []*v1alpha2.APIServiceNamespace) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.APIServiceNamespace), err } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_boundapiresourceschema.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_boundapiresourceschema.go index f8deee3b6..166cbd889 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_boundapiresourceschema.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_boundapiresourceschema.go @@ -19,180 +19,36 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/kubebind/v1alpha2" + typedkubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeBoundAPIResourceSchemas implements BoundAPIResourceSchemaInterface -type FakeBoundAPIResourceSchemas struct { +// fakeBoundAPIResourceSchemas implements BoundAPIResourceSchemaInterface +type fakeBoundAPIResourceSchemas struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.BoundAPIResourceSchema, *v1alpha2.BoundAPIResourceSchemaList, *kubebindv1alpha2.BoundAPIResourceSchemaApplyConfiguration] Fake *FakeKubeBindV1alpha2 - ns string -} - -var boundapiresourceschemasResource = v1alpha2.SchemeGroupVersion.WithResource("boundapiresourceschemas") - -var boundapiresourceschemasKind = v1alpha2.SchemeGroupVersion.WithKind("BoundAPIResourceSchema") - -// Get takes name of the boundAPIResourceSchema, and returns the corresponding boundAPIResourceSchema object, and an error if there is any. -func (c *FakeBoundAPIResourceSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BoundAPIResourceSchema, err error) { - emptyResult := &v1alpha2.BoundAPIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(boundapiresourceschemasResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BoundAPIResourceSchema), err -} - -// List takes label and field selectors, and returns the list of BoundAPIResourceSchemas that match those selectors. -func (c *FakeBoundAPIResourceSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BoundAPIResourceSchemaList, err error) { - emptyResult := &v1alpha2.BoundAPIResourceSchemaList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(boundapiresourceschemasResource, boundapiresourceschemasKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.BoundAPIResourceSchemaList{ListMeta: obj.(*v1alpha2.BoundAPIResourceSchemaList).ListMeta} - for _, item := range obj.(*v1alpha2.BoundAPIResourceSchemaList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested boundAPIResourceSchemas. -func (c *FakeBoundAPIResourceSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(boundapiresourceschemasResource, c.ns, opts)) - -} - -// Create takes the representation of a boundAPIResourceSchema and creates it. Returns the server's representation of the boundAPIResourceSchema, and an error, if there is any. -func (c *FakeBoundAPIResourceSchemas) Create(ctx context.Context, boundAPIResourceSchema *v1alpha2.BoundAPIResourceSchema, opts v1.CreateOptions) (result *v1alpha2.BoundAPIResourceSchema, err error) { - emptyResult := &v1alpha2.BoundAPIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(boundapiresourceschemasResource, c.ns, boundAPIResourceSchema, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BoundAPIResourceSchema), err -} - -// Update takes the representation of a boundAPIResourceSchema and updates it. Returns the server's representation of the boundAPIResourceSchema, and an error, if there is any. -func (c *FakeBoundAPIResourceSchemas) Update(ctx context.Context, boundAPIResourceSchema *v1alpha2.BoundAPIResourceSchema, opts v1.UpdateOptions) (result *v1alpha2.BoundAPIResourceSchema, err error) { - emptyResult := &v1alpha2.BoundAPIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(boundapiresourceschemasResource, c.ns, boundAPIResourceSchema, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BoundAPIResourceSchema), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeBoundAPIResourceSchemas) UpdateStatus(ctx context.Context, boundAPIResourceSchema *v1alpha2.BoundAPIResourceSchema, opts v1.UpdateOptions) (result *v1alpha2.BoundAPIResourceSchema, err error) { - emptyResult := &v1alpha2.BoundAPIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(boundapiresourceschemasResource, "status", c.ns, boundAPIResourceSchema, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BoundAPIResourceSchema), err -} - -// Delete takes name of the boundAPIResourceSchema and deletes it. Returns an error if one occurs. -func (c *FakeBoundAPIResourceSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(boundapiresourceschemasResource, c.ns, name, opts), &v1alpha2.BoundAPIResourceSchema{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeBoundAPIResourceSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(boundapiresourceschemasResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.BoundAPIResourceSchemaList{}) - return err -} - -// Patch applies the patch and returns the patched boundAPIResourceSchema. -func (c *FakeBoundAPIResourceSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BoundAPIResourceSchema, err error) { - emptyResult := &v1alpha2.BoundAPIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(boundapiresourceschemasResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BoundAPIResourceSchema), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied boundAPIResourceSchema. -func (c *FakeBoundAPIResourceSchemas) Apply(ctx context.Context, boundAPIResourceSchema *kubebindv1alpha2.BoundAPIResourceSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BoundAPIResourceSchema, err error) { - if boundAPIResourceSchema == nil { - return nil, fmt.Errorf("boundAPIResourceSchema provided to Apply must not be nil") - } - data, err := json.Marshal(boundAPIResourceSchema) - if err != nil { - return nil, err - } - name := boundAPIResourceSchema.Name - if name == nil { - return nil, fmt.Errorf("boundAPIResourceSchema.Name must be provided to Apply") - } - emptyResult := &v1alpha2.BoundAPIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(boundapiresourceschemasResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BoundAPIResourceSchema), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeBoundAPIResourceSchemas) ApplyStatus(ctx context.Context, boundAPIResourceSchema *kubebindv1alpha2.BoundAPIResourceSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BoundAPIResourceSchema, err error) { - if boundAPIResourceSchema == nil { - return nil, fmt.Errorf("boundAPIResourceSchema provided to Apply must not be nil") - } - data, err := json.Marshal(boundAPIResourceSchema) - if err != nil { - return nil, err - } - name := boundAPIResourceSchema.Name - if name == nil { - return nil, fmt.Errorf("boundAPIResourceSchema.Name must be provided to Apply") - } - emptyResult := &v1alpha2.BoundAPIResourceSchema{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(boundapiresourceschemasResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeBoundAPIResourceSchemas(fake *FakeKubeBindV1alpha2, namespace string) typedkubebindv1alpha2.BoundAPIResourceSchemaInterface { + return &fakeBoundAPIResourceSchemas{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.BoundAPIResourceSchema, *v1alpha2.BoundAPIResourceSchemaList, *kubebindv1alpha2.BoundAPIResourceSchemaApplyConfiguration]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("boundapiresourceschemas"), + v1alpha2.SchemeGroupVersion.WithKind("BoundAPIResourceSchema"), + func() *v1alpha2.BoundAPIResourceSchema { return &v1alpha2.BoundAPIResourceSchema{} }, + func() *v1alpha2.BoundAPIResourceSchemaList { return &v1alpha2.BoundAPIResourceSchemaList{} }, + func(dst, src *v1alpha2.BoundAPIResourceSchemaList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.BoundAPIResourceSchemaList) []*v1alpha2.BoundAPIResourceSchema { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.BoundAPIResourceSchemaList, items []*v1alpha2.BoundAPIResourceSchema) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.BoundAPIResourceSchema), err } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_clusterbinding.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_clusterbinding.go index a26c22036..718c8902b 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_clusterbinding.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_clusterbinding.go @@ -19,180 +19,36 @@ limitations under the License. package fake import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" v1alpha2 "github.com/kube-bind/kube-bind/sdk/apis/kubebind/v1alpha2" kubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/applyconfiguration/kubebind/v1alpha2" + typedkubebindv1alpha2 "github.com/kube-bind/kube-bind/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2" ) -// FakeClusterBindings implements ClusterBindingInterface -type FakeClusterBindings struct { +// fakeClusterBindings implements ClusterBindingInterface +type fakeClusterBindings struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.ClusterBinding, *v1alpha2.ClusterBindingList, *kubebindv1alpha2.ClusterBindingApplyConfiguration] Fake *FakeKubeBindV1alpha2 - ns string -} - -var clusterbindingsResource = v1alpha2.SchemeGroupVersion.WithResource("clusterbindings") - -var clusterbindingsKind = v1alpha2.SchemeGroupVersion.WithKind("ClusterBinding") - -// Get takes name of the clusterBinding, and returns the corresponding clusterBinding object, and an error if there is any. -func (c *FakeClusterBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ClusterBinding, err error) { - emptyResult := &v1alpha2.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(clusterbindingsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ClusterBinding), err -} - -// List takes label and field selectors, and returns the list of ClusterBindings that match those selectors. -func (c *FakeClusterBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ClusterBindingList, err error) { - emptyResult := &v1alpha2.ClusterBindingList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(clusterbindingsResource, clusterbindingsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.ClusterBindingList{ListMeta: obj.(*v1alpha2.ClusterBindingList).ListMeta} - for _, item := range obj.(*v1alpha2.ClusterBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterBindings. -func (c *FakeClusterBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(clusterbindingsResource, c.ns, opts)) - -} - -// Create takes the representation of a clusterBinding and creates it. Returns the server's representation of the clusterBinding, and an error, if there is any. -func (c *FakeClusterBindings) Create(ctx context.Context, clusterBinding *v1alpha2.ClusterBinding, opts v1.CreateOptions) (result *v1alpha2.ClusterBinding, err error) { - emptyResult := &v1alpha2.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(clusterbindingsResource, c.ns, clusterBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ClusterBinding), err -} - -// Update takes the representation of a clusterBinding and updates it. Returns the server's representation of the clusterBinding, and an error, if there is any. -func (c *FakeClusterBindings) Update(ctx context.Context, clusterBinding *v1alpha2.ClusterBinding, opts v1.UpdateOptions) (result *v1alpha2.ClusterBinding, err error) { - emptyResult := &v1alpha2.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(clusterbindingsResource, c.ns, clusterBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ClusterBinding), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusterBindings) UpdateStatus(ctx context.Context, clusterBinding *v1alpha2.ClusterBinding, opts v1.UpdateOptions) (result *v1alpha2.ClusterBinding, err error) { - emptyResult := &v1alpha2.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(clusterbindingsResource, "status", c.ns, clusterBinding, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ClusterBinding), err -} - -// Delete takes name of the clusterBinding and deletes it. Returns an error if one occurs. -func (c *FakeClusterBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(clusterbindingsResource, c.ns, name, opts), &v1alpha2.ClusterBinding{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(clusterbindingsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.ClusterBindingList{}) - return err -} - -// Patch applies the patch and returns the patched clusterBinding. -func (c *FakeClusterBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ClusterBinding, err error) { - emptyResult := &v1alpha2.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(clusterbindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ClusterBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied clusterBinding. -func (c *FakeClusterBindings) Apply(ctx context.Context, clusterBinding *kubebindv1alpha2.ClusterBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ClusterBinding, err error) { - if clusterBinding == nil { - return nil, fmt.Errorf("clusterBinding provided to Apply must not be nil") - } - data, err := json.Marshal(clusterBinding) - if err != nil { - return nil, err - } - name := clusterBinding.Name - if name == nil { - return nil, fmt.Errorf("clusterBinding.Name must be provided to Apply") - } - emptyResult := &v1alpha2.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(clusterbindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.ClusterBinding), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeClusterBindings) ApplyStatus(ctx context.Context, clusterBinding *kubebindv1alpha2.ClusterBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ClusterBinding, err error) { - if clusterBinding == nil { - return nil, fmt.Errorf("clusterBinding provided to Apply must not be nil") - } - data, err := json.Marshal(clusterBinding) - if err != nil { - return nil, err - } - name := clusterBinding.Name - if name == nil { - return nil, fmt.Errorf("clusterBinding.Name must be provided to Apply") - } - emptyResult := &v1alpha2.ClusterBinding{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(clusterbindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeClusterBindings(fake *FakeKubeBindV1alpha2, namespace string) typedkubebindv1alpha2.ClusterBindingInterface { + return &fakeClusterBindings{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.ClusterBinding, *v1alpha2.ClusterBindingList, *kubebindv1alpha2.ClusterBindingApplyConfiguration]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("clusterbindings"), + v1alpha2.SchemeGroupVersion.WithKind("ClusterBinding"), + func() *v1alpha2.ClusterBinding { return &v1alpha2.ClusterBinding{} }, + func() *v1alpha2.ClusterBindingList { return &v1alpha2.ClusterBindingList{} }, + func(dst, src *v1alpha2.ClusterBindingList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.ClusterBindingList) []*v1alpha2.ClusterBinding { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.ClusterBindingList, items []*v1alpha2.ClusterBinding) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha2.ClusterBinding), err } diff --git a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_kubebind_client.go b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_kubebind_client.go index 11dc40def..0be3be76e 100644 --- a/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_kubebind_client.go +++ b/sdk/kcp/clientset/versioned/typed/kubebind/v1alpha2/fake/fake_kubebind_client.go @@ -30,31 +30,31 @@ type FakeKubeBindV1alpha2 struct { } func (c *FakeKubeBindV1alpha2) APIResourceSchemas() v1alpha2.APIResourceSchemaInterface { - return &FakeAPIResourceSchemas{c} + return newFakeAPIResourceSchemas(c) } func (c *FakeKubeBindV1alpha2) APIServiceBindings() v1alpha2.APIServiceBindingInterface { - return &FakeAPIServiceBindings{c} + return newFakeAPIServiceBindings(c) } func (c *FakeKubeBindV1alpha2) APIServiceExports(namespace string) v1alpha2.APIServiceExportInterface { - return &FakeAPIServiceExports{c, namespace} + return newFakeAPIServiceExports(c, namespace) } func (c *FakeKubeBindV1alpha2) APIServiceExportRequests(namespace string) v1alpha2.APIServiceExportRequestInterface { - return &FakeAPIServiceExportRequests{c, namespace} + return newFakeAPIServiceExportRequests(c, namespace) } func (c *FakeKubeBindV1alpha2) APIServiceNamespaces(namespace string) v1alpha2.APIServiceNamespaceInterface { - return &FakeAPIServiceNamespaces{c, namespace} + return newFakeAPIServiceNamespaces(c, namespace) } func (c *FakeKubeBindV1alpha2) BoundAPIResourceSchemas(namespace string) v1alpha2.BoundAPIResourceSchemaInterface { - return &FakeBoundAPIResourceSchemas{c, namespace} + return newFakeBoundAPIResourceSchemas(c, namespace) } func (c *FakeKubeBindV1alpha2) ClusterBindings(namespace string) v1alpha2.ClusterBindingInterface { - return &FakeClusterBindings{c, namespace} + return newFakeClusterBindings(c, namespace) } // RESTClient returns a RESTClient that is used to communicate diff --git a/test/e2e/bind/happy-case_test.go b/test/e2e/bind/happy-case_test.go index e705f1c13..d71344f3d 100644 --- a/test/e2e/bind/happy-case_test.go +++ b/test/e2e/bind/happy-case_test.go @@ -109,7 +109,7 @@ spec: iostreams, _, bufOut, _ := genericclioptions.NewTestIOStreams() authURLDryRunCh := make(chan string, 1) go simulateBrowser(t, authURLDryRunCh, serviceGVR.Resource) - framework.Bind(t, iostreams, authURLDryRunCh, nil, fmt.Sprintf("http://%s/export", addr.String()), "--kubeconfig", consumerKubeconfig, "--skip-konnector", "--dry-run") + framework.Bind(t, iostreams, authURLDryRunCh, nil, fmt.Sprintf("http://%s/exports", addr.String()), "--kubeconfig", consumerKubeconfig, "--skip-konnector", "--dry-run") _, err := yaml.YAMLToJSON(bufOut.Bytes()) require.NoError(t, err) }, @@ -121,7 +121,7 @@ spec: authURLCh := make(chan string, 1) go simulateBrowser(t, authURLCh, serviceGVR.Resource) invocations := make(chan framework.SubCommandInvocation, 1) - framework.Bind(t, iostreams, authURLCh, invocations, fmt.Sprintf("http://%s/export", addr.String()), "--kubeconfig", consumerKubeconfig, "--skip-konnector") + framework.Bind(t, iostreams, authURLCh, invocations, fmt.Sprintf("http://%s/exports", addr.String()), "--kubeconfig", consumerKubeconfig, "--skip-konnector") inv := <-invocations requireEqualSlicePattern(t, []string{"apiservice", "--remote-kubeconfig-namespace", "*", "--remote-kubeconfig-name", "*", "-f", "-", "--kubeconfig=" + consumerKubeconfig, "--skip-konnector=true", "--no-banner"}, inv.Args) framework.BindAPIService(t, inv.Stdin, "", inv.Args...) @@ -347,7 +347,7 @@ spec: authURLCh := make(chan string, 1) go simulateBrowser(t, authURLCh, serviceGVR.Resource) invocations := make(chan framework.SubCommandInvocation, 1) - framework.Bind(t, iostreams, authURLCh, invocations, fmt.Sprintf("http://%s/export", addr.String()), "--kubeconfig", consumerKubeconfig, "--skip-konnector") + framework.Bind(t, iostreams, authURLCh, invocations, fmt.Sprintf("http://%s/exports", addr.String()), "--kubeconfig", consumerKubeconfig, "--skip-konnector") inv := <-invocations requireEqualSlicePattern(t, []string{"apiservice", "--remote-kubeconfig-namespace", "*", "--remote-kubeconfig-name", "*", "-f", "-", "--kubeconfig=" + consumerKubeconfig, "--skip-konnector=true", "--no-banner"}, inv.Args) framework.BindAPIService(t, inv.Stdin, "", inv.Args...) @@ -369,14 +369,14 @@ func simulateBrowser(t *testing.T, authURLCh chan string, resource string) { require.NoError(t, err) t.Logf("Waiting for browser to be at /resources") - framework.BrowerEventuallyAtPath(t, browser, "/resources") + framework.BrowserEventuallyAtPath(t, browser, "/resources") t.Logf("Clicking %s", resource) err = browser.Click("a." + resource) require.NoError(t, err) t.Logf("Waiting for browser to be forwarded to client") - framework.BrowerEventuallyAtPath(t, browser, "/callback") + framework.BrowserEventuallyAtPath(t, browser, "/callback") } func toUnstructured(t *testing.T, manifest string) *unstructured.Unstructured { diff --git a/test/e2e/framework/backend.go b/test/e2e/framework/backend.go index 5061f4f61..7a9eb4f29 100644 --- a/test/e2e/framework/backend.go +++ b/test/e2e/framework/backend.go @@ -87,6 +87,8 @@ func StartBackendWithoutDefaultArgs(t *testing.T, clientConfig *rest.Config, arg options.OIDC.IssuerClientID = "kube-bind-" + port createDexClient(t, addr) + options.TestingSkipNameValidation = true + completed, err := options.Complete() require.NoError(t, err) @@ -96,7 +98,6 @@ func StartBackendWithoutDefaultArgs(t *testing.T, clientConfig *rest.Config, arg server, err := backend.NewServer(ctx, config) require.NoError(t, err) - server.OptionallyStartInformers(ctx) err = server.Run(ctx) require.NoError(t, err) t.Logf("backend listening on %s", addr) diff --git a/test/e2e/framework/browser.go b/test/e2e/framework/browser.go index 540343d00..80d4c96ae 100644 --- a/test/e2e/framework/browser.go +++ b/test/e2e/framework/browser.go @@ -25,7 +25,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" ) -func BrowerEventuallyAtPath(t *testing.T, browser *browser.Browser, path string) { +func BrowserEventuallyAtPath(t *testing.T, browser *browser.Browser, path string) { require.Eventuallyf(t, func() bool { if browser.Url().Path == path { t.Logf("Browser is at %s, waiting for path %s", browser.Url(), path)