diff --git a/go.mod b/go.mod index b09f287..8410991 100644 --- a/go.mod +++ b/go.mod @@ -5,22 +5,22 @@ go 1.22.5 require ( github.com/ghodss/yaml v1.0.0 github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 - github.com/loft-sh/agentapi/v4 v4.1.0-alpha.16 - github.com/loft-sh/apiserver v0.0.0-20240607231110-634aeeab2b36 - k8s.io/api v0.30.4 - k8s.io/apimachinery v0.30.4 - k8s.io/apiserver v0.30.4 - k8s.io/client-go v0.30.4 - k8s.io/klog/v2 v2.120.1 + github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17 + github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d + k8s.io/api v0.31.1 + k8s.io/apimachinery v0.31.1 + k8s.io/apiserver v0.31.1 + k8s.io/client-go v0.31.1 + k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a - sigs.k8s.io/controller-runtime v0.18.5 - sigs.k8s.io/controller-tools v0.15.0 + sigs.k8s.io/controller-runtime v0.19.0 + sigs.k8s.io/controller-tools v0.16.3 ) require ( github.com/NYTimes/gziphandler v1.1.1 // indirect - github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect - github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef // 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 @@ -28,80 +28,84 @@ require ( github.com/coreos/go-semver v0.3.1 // indirect 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.11.2 // indirect - github.com/evanphx/json-patch v5.6.0+incompatible // indirect + github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/jsonreference v0.20.4 // indirect - github.com/go-openapi/swag v0.22.7 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/gobuffalo/flect v1.0.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/google/cel-go v0.17.8 // indirect + github.com/google/cel-go v0.21.0 // indirect github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect github.com/imdario/mergo v0.3.16 // indirect 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.10 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_golang v1.20.4 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.46.0 // indirect + github.com/prometheus/common v0.60.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/spf13/cobra v1.8.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stoewer/go-strcase v1.2.0 // indirect - go.etcd.io/etcd/api/v3 v3.5.14 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect - go.etcd.io/etcd/client/v3 v3.5.14 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect - go.opentelemetry.io/otel v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.27.0 // indirect - go.opentelemetry.io/otel/sdk v1.27.0 // indirect - go.opentelemetry.io/otel/trace v1.27.0 // indirect - go.opentelemetry.io/proto/otlp v1.0.0 // indirect + github.com/stoewer/go-strcase v1.3.0 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.etcd.io/etcd/api/v3 v3.5.16 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect + go.etcd.io/etcd/client/v3 v3.5.16 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.26.0 // indirect - golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect - golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/crypto v0.27.0 // indirect + golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/term v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect - golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.24.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect - google.golang.org/grpc v1.64.1 // indirect - google.golang.org/protobuf v1.34.1 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/time v0.6.0 // indirect + golang.org/x/tools v0.25.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect + google.golang.org/grpc v1.67.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.30.4 // indirect - k8s.io/component-base v0.30.4 // indirect - k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect + k8s.io/apiextensions-apiserver v0.31.1 // indirect + k8s.io/component-base v0.31.1 // indirect + k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 // indirect + sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect diff --git a/go.sum b/go.sum index 10c0781..7e4f65b 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,9 @@ github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +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= @@ -16,23 +16,23 @@ github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+BtnqkLAU= -github.com/emicklei/go-restful/v3 v3.11.2/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/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= +github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= 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/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -42,13 +42,12 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= -github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= -github.com/go-openapi/swag v0.22.7 h1:JWrc1uc/P9cSomxfnsFSVWoE1FW6bNbrVPmpQYpCcR8= -github.com/go-openapi/swag v0.22.7/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= @@ -58,16 +57,14 @@ 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/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 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.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/cel-go v0.17.8 h1:j9m730pMZt1Fc4oKhCLUHfjj6527LuhYcYw0Rl8gqto= -github.com/google/cel-go v0.17.8/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= +github.com/google/cel-go v0.21.0 h1:cl6uW/gxN+Hy50tNYvI691+sXxioCnstFzLp2WO4GCI= +github.com/google/cel-go v0.21.0/go.mod h1:rHUlWCcBKgyEk+eV03RPdZUekPp6YcJwV0FxuUksYxc= github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU= github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49/go.mod h1:BkkQ4L1KS1xMt2aWSPStnn55ChGC0DPOn2FQYj+f25M= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -80,16 +77,16 @@ github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSF github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= 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.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= -github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -102,16 +99,20 @@ 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.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= +github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= 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= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 h1:aqT1UeosCYB+3DEzfxW0evhcYHxhoBVAEWtkXLXFimI= github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= -github.com/loft-sh/agentapi/v4 v4.1.0-alpha.16 h1:z2dl4P/ZeB5asCqEdy63RXa+2bMuHfutRBaevkZRKV4= -github.com/loft-sh/agentapi/v4 v4.1.0-alpha.16/go.mod h1:cak14ySJvMXIcPqG4l9MAqC8WFqqtXg9BwbOauK3r7Y= -github.com/loft-sh/apiserver v0.0.0-20240607231110-634aeeab2b36 h1:1euJ7mNHMI2MMA+g+jEYYKtoMrHZTkUMapHnmjHb9lM= -github.com/loft-sh/apiserver v0.0.0-20240607231110-634aeeab2b36/go.mod h1:XxI95azXiqXHiIDRiyDTpZcxdtXQlUqeU5VMMDz8INA= +github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17 h1:yoTwfLkurXmA7ENb8YWQePIVK42vZVSeV4unngNc8c8= +github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17/go.mod h1:CXweRDab9ZcSzcaitULFagYGgSzW8Q12W3cBdKMjR8k= +github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= +github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -127,19 +128,19 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= -github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= -github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= +github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= +github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= +github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= 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.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= +github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA= +github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= 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.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= @@ -149,17 +150,16 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= +github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= +github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= @@ -167,44 +167,46 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= -go.etcd.io/etcd/api/v3 v3.5.14 h1:vHObSCxyB9zlF60w7qzAdTcGaglbJOpSj1Xj9+WGxq0= -go.etcd.io/etcd/api/v3 v3.5.14/go.mod h1:BmtWcRlQvwa1h3G2jvKYwIQy4PkHlDej5t7uLMUdJUU= -go.etcd.io/etcd/client/pkg/v3 v3.5.14 h1:SaNH6Y+rVEdxfpA2Jr5wkEvN6Zykme5+YnbCkxvuWxQ= -go.etcd.io/etcd/client/pkg/v3 v3.5.14/go.mod h1:8uMgAokyG1czCtIdsq+AGyYQMvpIKnSvPjFMunkgeZI= -go.etcd.io/etcd/client/v2 v2.305.10 h1:MrmRktzv/XF8CvtQt+P6wLUlURaNpSDJHFZhe//2QE4= -go.etcd.io/etcd/client/v2 v2.305.10/go.mod h1:m3CKZi69HzilhVqtPDcjhSGp+kA1OmbNn0qamH80xjA= -go.etcd.io/etcd/client/v3 v3.5.14 h1:CWfRs4FDaDoSz81giL7zPpZH2Z35tbOrAJkkjMqOupg= -go.etcd.io/etcd/client/v3 v3.5.14/go.mod h1:k3XfdV/VIHy/97rqWjoUzrj9tk7GgJGH9J8L4dNXmAk= -go.etcd.io/etcd/pkg/v3 v3.5.10 h1:WPR8K0e9kWl1gAhB5A7gEa5ZBTNkT9NdNWrR8Qpo1CM= -go.etcd.io/etcd/pkg/v3 v3.5.10/go.mod h1:TKTuCKKcF1zxmfKWDkfz5qqYaE3JncKKZPFf8c1nFUs= -go.etcd.io/etcd/raft/v3 v3.5.10 h1:cgNAYe7xrsrn/5kXMSaH8kM/Ky8mAdMqGOxyYwpP0LA= -go.etcd.io/etcd/raft/v3 v3.5.10/go.mod h1:odD6kr8XQXTy9oQnyMPBOr0TVe+gT0neQhElQ6jbGRc= -go.etcd.io/etcd/server/v3 v3.5.10 h1:4NOGyOwD5sUZ22PiWYKmfxqoeh72z6EhYjNosKGLmZg= -go.etcd.io/etcd/server/v3 v3.5.10/go.mod h1:gBplPHfs6YI0L+RpGkTQO7buDbHv5HJGG/Bst0/zIPo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= -go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= -go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 h1:3d+S281UTjM+AbF31XSOYn1qXn3BgIdWl8HNEpx08Jk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I= -go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= -go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= -go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= -go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= -go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= -go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= -go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= -go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= +go.etcd.io/etcd/api/v3 v3.5.16 h1:WvmyJVbjWqK4R1E+B12RRHz3bRGy9XVfh++MgbN+6n0= +go.etcd.io/etcd/api/v3 v3.5.16/go.mod h1:1P4SlIP/VwkDmGo3OlOD7faPeP8KDIFhqvciH5EfN28= +go.etcd.io/etcd/client/pkg/v3 v3.5.16 h1:ZgY48uH6UvB+/7R9Yf4x574uCO3jIx0TRDyetSfId3Q= +go.etcd.io/etcd/client/pkg/v3 v3.5.16/go.mod h1:V8acl8pcEK0Y2g19YlOV9m9ssUe6MgiDSobSoaBAM0E= +go.etcd.io/etcd/client/v2 v2.305.13 h1:RWfV1SX5jTU0lbCvpVQe3iPQeAHETWdOTb6pxhd77C8= +go.etcd.io/etcd/client/v2 v2.305.13/go.mod h1:iQnL7fepbiomdXMb3om1rHq96htNNGv2sJkEcZGDRRg= +go.etcd.io/etcd/client/v3 v3.5.16 h1:sSmVYOAHeC9doqi0gv7v86oY/BTld0SEFGaxsU9eRhE= +go.etcd.io/etcd/client/v3 v3.5.16/go.mod h1:X+rExSGkyqxvu276cr2OwPLBaeqFu1cIl4vmRjAD/50= +go.etcd.io/etcd/pkg/v3 v3.5.13 h1:st9bDWNsKkBNpP4PR1MvM/9NqUPfvYZx/YXegsYEH8M= +go.etcd.io/etcd/pkg/v3 v3.5.13/go.mod h1:N+4PLrp7agI/Viy+dUYpX7iRtSPvKq+w8Y14d1vX+m0= +go.etcd.io/etcd/raft/v3 v3.5.13 h1:7r/NKAOups1YnKcfro2RvGGo2PTuizF/xh26Z2CTAzA= +go.etcd.io/etcd/raft/v3 v3.5.13/go.mod h1:uUFibGLn2Ksm2URMxN1fICGhk8Wu96EfDQyuLhAcAmw= +go.etcd.io/etcd/server/v3 v3.5.13 h1:V6KG+yMfMSqWt+lGnhFpP5z5dRUj1BDRJ5k1fQ9DFok= +go.etcd.io/etcd/server/v3 v3.5.13/go.mod h1:K/8nbsGupHqmr5MkgaZpLlH1QdX1pcNQLAkODy44XcQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 h1:hCq2hNMwsegUvPzI7sPOvtO9cqyy5GbWt/Ybp2xrx8Q= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0/go.mod h1:LqaApwGx/oUmzsbqxkzuBvyoPpkxk3JQWnqfVrJ3wCA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 h1:ZIg3ZT/aQ7AfKqdwp7ECpOK6vHqquXXuyTjIO8ZdmPs= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0/go.mod h1:DQAwmETtZV00skUwgD6+0U89g80NKsJE3DCKeLLPQMI= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 h1:lsInsfvhVIfOI6qHVyysXMNDnjO9Npvl7tlDPJFBVd4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0/go.mod h1:KQsVNh4OjgjTG0G6EiNi1jVpnaeeKsKMRwbLN+f1+8M= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 h1:m0yTiGDLUvVYaTFbAvCkVYIYcvwKt3G7OLoN77NUs/8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0/go.mod h1:wBQbT4UekBfegL2nx0Xk1vBcnzyBPsIVm9hRG4fYcr4= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= +go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= +go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -214,22 +216,22 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= -golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= -golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= -golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= -golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -238,78 +240,79 @@ golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= +golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU= -google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= -google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f h1:jTm13A2itBi3La6yTGqn8bVSrc3ZZ1r8ENHlIXBfnRA= +google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f/go.mod h1:CLGoBuH1VHxAUXVPP8FfPwPEVJB6lz3URE5mY2SuayE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f h1:cUMEy+8oS78BWIH9OWazBkzbr090Od9tWBNtZHkOhf0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= 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= +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/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/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.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 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.30.4 h1:XASIELmW8w8q0i1Y4124LqPoWMycLjyQti/fdYHYjCs= -k8s.io/api v0.30.4/go.mod h1:ZqniWRKu7WIeLijbbzetF4U9qZ03cg5IRwl8YVs8mX0= -k8s.io/apiextensions-apiserver v0.30.4 h1:FwOMIk/rzZvM/Gx0IOz0+biZ+dlnlCeyfXW17uzV1qE= -k8s.io/apiextensions-apiserver v0.30.4/go.mod h1:m8cAkJ9PVU8Olb4cPW4hrUDBZGvoSJ0kY0G0CfdGQac= -k8s.io/apimachinery v0.30.4 h1:5QHQI2tInzr8LsT4kU/2+fSeibH1eIHswNx480cqIoY= -k8s.io/apimachinery v0.30.4/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/apiserver v0.30.4 h1:rHkGJhxd+m4jILrgkenwSmG4X0QXk6ecGuybzS/PQak= -k8s.io/apiserver v0.30.4/go.mod h1:oyGAj9B9/0+I9huJyf4/8SMBF2mNh2bTMlu7703dkH8= -k8s.io/client-go v0.30.4 h1:eculUe+HPQoPbixfwmaSZGsKcOf7D288tH6hDAdd+wY= -k8s.io/client-go v0.30.4/go.mod h1:IBS0R/Mt0LHkNHF4E6n+SUDPG7+m2po6RZU7YHeOpzc= -k8s.io/component-base v0.30.4 h1:FlgKqazIkIIxpLA4wFXsiPiDllJn9fhsN3G4TeX7T7U= -k8s.io/component-base v0.30.4/go.mod h1:Qd3h+OJxV/LrnriXG/E15ZK83dzd306qJHW9+87S5ls= -k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= -k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= +k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= +k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40= +k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ= +k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= +k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apiserver v0.31.1 h1:Sars5ejQDCRBY5f7R3QFHdqN3s61nhkpaX8/k1iEw1c= +k8s.io/apiserver v0.31.1/go.mod h1:lzDhpeToamVZJmmFlaLwdYZwd7zB+WYRYIboqA1kGxM= +k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= +k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= +k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8= +k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a h1:zD1uj3Jf+mD4zmA7W+goE5TxDkI7OGJjBNBzq5fJtLA= k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc= -k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak= -k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 h1:/U5vjBbQn3RChhv7P11uhYvCSm5G2GaIi5AIGBS6r4c= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0/go.mod h1:z7+wmGM2dfIiLRfrC6jb5kV2Mq/sK1ZP303cxzkV5Y4= -sigs.k8s.io/controller-runtime v0.18.5 h1:nTHio/W+Q4aBlQMgbnC5hZb4IjIidyrizMai9P6n4Rk= -sigs.k8s.io/controller-runtime v0.18.5/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= -sigs.k8s.io/controller-tools v0.15.0 h1:4dxdABXGDhIa68Fiwaif0vcu32xfwmgQ+w8p+5CxoAI= -sigs.k8s.io/controller-tools v0.15.0/go.mod h1:8zUSS2T8Hx0APCNRhJWbS3CAQEbIxLa07khzh7pZmXM= +k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 h1:MDF6h2H/h4tbzmtIKTuctcwZmY0tY9mD9fNT47QO6HI= +k8s.io/utils v0.0.0-20240921022957-49e7df575cb6/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= +sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q= +sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/controller-tools v0.16.3 h1:z48C5/d4jCVQQvtiSBL5MYyZ3EO2eFIOXrIKMgHVhFY= +sigs.k8s.io/controller-tools v0.16.3/go.mod h1:AEj6k+w1kYpLZv2einOH3mj52ips4W/6FUjnB5tkJGs= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/pkg/apis/management/v1/zz_generated.defaults.go b/pkg/apis/management/v1/zz_generated.defaults.go index ced57d8..d7e4331 100644 --- a/pkg/apis/management/v1/zz_generated.defaults.go +++ b/pkg/apis/management/v1/zz_generated.defaults.go @@ -6,6 +6,7 @@ package v1 import ( + v1 "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -53,6 +54,51 @@ func SetObjectDefaults_ProjectRunnersList(in *ProjectRunnersList) { func SetObjectDefaults_Runner(in *Runner) { if in.Spec.RunnerSpec.ClusterRef != nil { if in.Spec.RunnerSpec.ClusterRef.PodTemplate != nil { + for i := range in.Spec.RunnerSpec.ClusterRef.PodTemplate.Spec.Volumes { + a := &in.Spec.RunnerSpec.ClusterRef.PodTemplate.Spec.Volumes[i] + if a.VolumeSource.ISCSI != nil { + if a.VolumeSource.ISCSI.ISCSIInterface == "" { + a.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if a.VolumeSource.RBD != nil { + if a.VolumeSource.RBD.RBDPool == "" { + a.VolumeSource.RBD.RBDPool = "rbd" + } + if a.VolumeSource.RBD.RadosUser == "" { + a.VolumeSource.RBD.RadosUser = "admin" + } + if a.VolumeSource.RBD.Keyring == "" { + a.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if a.VolumeSource.AzureDisk != nil { + if a.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + a.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if a.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + a.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if a.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + a.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if a.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + a.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if a.VolumeSource.ScaleIO != nil { + if a.VolumeSource.ScaleIO.StorageMode == "" { + a.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if a.VolumeSource.ScaleIO.FSType == "" { + a.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } for i := range in.Spec.RunnerSpec.ClusterRef.PodTemplate.Spec.InitContainers { a := &in.Spec.RunnerSpec.ClusterRef.PodTemplate.Spec.InitContainers[i] for j := range a.Ports { diff --git a/pkg/apis/management/zz_generated.defaults.go b/pkg/apis/management/zz_generated.defaults.go index dac9209..619605f 100644 --- a/pkg/apis/management/zz_generated.defaults.go +++ b/pkg/apis/management/zz_generated.defaults.go @@ -6,6 +6,7 @@ package management import ( + v1 "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -53,6 +54,51 @@ func SetObjectDefaults_ProjectRunnersList(in *ProjectRunnersList) { func SetObjectDefaults_Runner(in *Runner) { if in.Spec.RunnerSpec.ClusterRef != nil { if in.Spec.RunnerSpec.ClusterRef.PodTemplate != nil { + for i := range in.Spec.RunnerSpec.ClusterRef.PodTemplate.Spec.Volumes { + a := &in.Spec.RunnerSpec.ClusterRef.PodTemplate.Spec.Volumes[i] + if a.VolumeSource.ISCSI != nil { + if a.VolumeSource.ISCSI.ISCSIInterface == "" { + a.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if a.VolumeSource.RBD != nil { + if a.VolumeSource.RBD.RBDPool == "" { + a.VolumeSource.RBD.RBDPool = "rbd" + } + if a.VolumeSource.RBD.RadosUser == "" { + a.VolumeSource.RBD.RadosUser = "admin" + } + if a.VolumeSource.RBD.Keyring == "" { + a.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if a.VolumeSource.AzureDisk != nil { + if a.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + a.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if a.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + a.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if a.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + a.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if a.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + a.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if a.VolumeSource.ScaleIO != nil { + if a.VolumeSource.ScaleIO.StorageMode == "" { + a.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if a.VolumeSource.ScaleIO.FSType == "" { + a.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } for i := range in.Spec.RunnerSpec.ClusterRef.PodTemplate.Spec.InitContainers { a := &in.Spec.RunnerSpec.ClusterRef.PodTemplate.Spec.InitContainers[i] for j := range a.Ports { diff --git a/pkg/apis/storage/v1/devpodworkspaceinstance_types.go b/pkg/apis/storage/v1/devpodworkspaceinstance_types.go index e47a71e..51e8fed 100644 --- a/pkg/apis/storage/v1/devpodworkspaceinstance_types.go +++ b/pkg/apis/storage/v1/devpodworkspaceinstance_types.go @@ -112,6 +112,10 @@ type DevPodWorkspaceInstanceSpec struct { // Access to the DevPod machine instance object itself // +optional Access []Access `json:"access,omitempty"` + + // PreventWakeUpOnConnection is used to prevent workspace that uses sleep mode from waking up on incomming ssh connection. + // +optional + PreventWakeUpOnConnection bool `json:"preventWakeUpOnConnection,omitempty"` } type RunnerRef struct { diff --git a/pkg/apis/storage/v1/devpodworkspacetemplate_types.go b/pkg/apis/storage/v1/devpodworkspacetemplate_types.go index 6326033..5d5bdb7 100644 --- a/pkg/apis/storage/v1/devpodworkspacetemplate_types.go +++ b/pkg/apis/storage/v1/devpodworkspacetemplate_types.go @@ -130,6 +130,10 @@ type DevPodWorkspaceTemplateDefinition struct { // CredentialForwarding specifies controls for how workspaces created by this template forward credentials into the workspace // +optional CredentialForwarding *CredentialForwarding `json:"credentialForwarding,omitempty"` + + // PreventWakeUpOnConnection is used to prevent workspace that uses sleep mode from waking up on incomming ssh connection. + // +optional + PreventWakeUpOnConnection bool `json:"preventWakeUpOnConnection,omitempty"` } // +enum diff --git a/pkg/apis/storage/v1/zz_generated.defaults.go b/pkg/apis/storage/v1/zz_generated.defaults.go index ff69702..e794423 100644 --- a/pkg/apis/storage/v1/zz_generated.defaults.go +++ b/pkg/apis/storage/v1/zz_generated.defaults.go @@ -6,6 +6,7 @@ package v1 import ( + v1 "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -21,6 +22,51 @@ func RegisterDefaults(scheme *runtime.Scheme) error { func SetObjectDefaults_Runner(in *Runner) { if in.Spec.ClusterRef != nil { if in.Spec.ClusterRef.PodTemplate != nil { + for i := range in.Spec.ClusterRef.PodTemplate.Spec.Volumes { + a := &in.Spec.ClusterRef.PodTemplate.Spec.Volumes[i] + if a.VolumeSource.ISCSI != nil { + if a.VolumeSource.ISCSI.ISCSIInterface == "" { + a.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if a.VolumeSource.RBD != nil { + if a.VolumeSource.RBD.RBDPool == "" { + a.VolumeSource.RBD.RBDPool = "rbd" + } + if a.VolumeSource.RBD.RadosUser == "" { + a.VolumeSource.RBD.RadosUser = "admin" + } + if a.VolumeSource.RBD.Keyring == "" { + a.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if a.VolumeSource.AzureDisk != nil { + if a.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + a.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if a.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + a.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if a.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + a.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if a.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + a.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if a.VolumeSource.ScaleIO != nil { + if a.VolumeSource.ScaleIO.StorageMode == "" { + a.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if a.VolumeSource.ScaleIO.FSType == "" { + a.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } for i := range in.Spec.ClusterRef.PodTemplate.Spec.InitContainers { a := &in.Spec.ClusterRef.PodTemplate.Spec.InitContainers[i] for j := range a.Ports { diff --git a/pkg/clientset/versioned/fake/clientset_generated.go b/pkg/clientset/versioned/fake/clientset_generated.go index 2f24047..9490a48 100644 --- a/pkg/clientset/versioned/fake/clientset_generated.go +++ b/pkg/clientset/versioned/fake/clientset_generated.go @@ -19,8 +19,12 @@ import ( // NewSimpleClientset returns a clientset that will respond with the provided objects. // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). func NewSimpleClientset(objects ...runtime.Object) *Clientset { o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects { diff --git a/pkg/clientset/versioned/typed/management/v1/agentauditevent.go b/pkg/clientset/versioned/typed/management/v1/agentauditevent.go index b5de1bf..4165cef 100644 --- a/pkg/clientset/versioned/typed/management/v1/agentauditevent.go +++ b/pkg/clientset/versioned/typed/management/v1/agentauditevent.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // AgentAuditEventsGetter has a method to return a AgentAuditEventInterface. @@ -24,6 +23,7 @@ type AgentAuditEventsGetter interface { type AgentAuditEventInterface interface { Create(ctx context.Context, agentAuditEvent *v1.AgentAuditEvent, opts metav1.CreateOptions) (*v1.AgentAuditEvent, error) Update(ctx context.Context, agentAuditEvent *v1.AgentAuditEvent, opts metav1.UpdateOptions) (*v1.AgentAuditEvent, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, agentAuditEvent *v1.AgentAuditEvent, opts metav1.UpdateOptions) (*v1.AgentAuditEvent, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type AgentAuditEventInterface interface { // agentAuditEvents implements AgentAuditEventInterface type agentAuditEvents struct { - client rest.Interface + *gentype.ClientWithList[*v1.AgentAuditEvent, *v1.AgentAuditEventList] } // newAgentAuditEvents returns a AgentAuditEvents func newAgentAuditEvents(c *ManagementV1Client) *agentAuditEvents { return &agentAuditEvents{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.AgentAuditEvent, *v1.AgentAuditEventList]( + "agentauditevents", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.AgentAuditEvent { return &v1.AgentAuditEvent{} }, + func() *v1.AgentAuditEventList { return &v1.AgentAuditEventList{} }), } } - -// Get takes name of the agentAuditEvent, and returns the corresponding agentAuditEvent object, and an error if there is any. -func (c *agentAuditEvents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AgentAuditEvent, err error) { - result = &v1.AgentAuditEvent{} - err = c.client.Get(). - Resource("agentauditevents"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of AgentAuditEvents that match those selectors. -func (c *agentAuditEvents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AgentAuditEventList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.AgentAuditEventList{} - err = c.client.Get(). - Resource("agentauditevents"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested agentAuditEvents. -func (c *agentAuditEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("agentauditevents"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a agentAuditEvent and creates it. Returns the server's representation of the agentAuditEvent, and an error, if there is any. -func (c *agentAuditEvents) Create(ctx context.Context, agentAuditEvent *v1.AgentAuditEvent, opts metav1.CreateOptions) (result *v1.AgentAuditEvent, err error) { - result = &v1.AgentAuditEvent{} - err = c.client.Post(). - Resource("agentauditevents"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(agentAuditEvent). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a agentAuditEvent and updates it. Returns the server's representation of the agentAuditEvent, and an error, if there is any. -func (c *agentAuditEvents) Update(ctx context.Context, agentAuditEvent *v1.AgentAuditEvent, opts metav1.UpdateOptions) (result *v1.AgentAuditEvent, err error) { - result = &v1.AgentAuditEvent{} - err = c.client.Put(). - Resource("agentauditevents"). - Name(agentAuditEvent.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(agentAuditEvent). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *agentAuditEvents) UpdateStatus(ctx context.Context, agentAuditEvent *v1.AgentAuditEvent, opts metav1.UpdateOptions) (result *v1.AgentAuditEvent, err error) { - result = &v1.AgentAuditEvent{} - err = c.client.Put(). - Resource("agentauditevents"). - Name(agentAuditEvent.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(agentAuditEvent). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the agentAuditEvent and deletes it. Returns an error if one occurs. -func (c *agentAuditEvents) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("agentauditevents"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *agentAuditEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("agentauditevents"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched agentAuditEvent. -func (c *agentAuditEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AgentAuditEvent, err error) { - result = &v1.AgentAuditEvent{} - err = c.client.Patch(pt). - Resource("agentauditevents"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/announcement.go b/pkg/clientset/versioned/typed/management/v1/announcement.go index 2d79557..e508230 100644 --- a/pkg/clientset/versioned/typed/management/v1/announcement.go +++ b/pkg/clientset/versioned/typed/management/v1/announcement.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // AnnouncementsGetter has a method to return a AnnouncementInterface. @@ -24,6 +23,7 @@ type AnnouncementsGetter interface { type AnnouncementInterface interface { Create(ctx context.Context, announcement *v1.Announcement, opts metav1.CreateOptions) (*v1.Announcement, error) Update(ctx context.Context, announcement *v1.Announcement, opts metav1.UpdateOptions) (*v1.Announcement, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, announcement *v1.Announcement, opts metav1.UpdateOptions) (*v1.Announcement, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type AnnouncementInterface interface { // announcements implements AnnouncementInterface type announcements struct { - client rest.Interface + *gentype.ClientWithList[*v1.Announcement, *v1.AnnouncementList] } // newAnnouncements returns a Announcements func newAnnouncements(c *ManagementV1Client) *announcements { return &announcements{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Announcement, *v1.AnnouncementList]( + "announcements", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Announcement { return &v1.Announcement{} }, + func() *v1.AnnouncementList { return &v1.AnnouncementList{} }), } } - -// Get takes name of the announcement, and returns the corresponding announcement object, and an error if there is any. -func (c *announcements) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Announcement, err error) { - result = &v1.Announcement{} - err = c.client.Get(). - Resource("announcements"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Announcements that match those selectors. -func (c *announcements) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AnnouncementList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.AnnouncementList{} - err = c.client.Get(). - Resource("announcements"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested announcements. -func (c *announcements) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("announcements"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a announcement and creates it. Returns the server's representation of the announcement, and an error, if there is any. -func (c *announcements) Create(ctx context.Context, announcement *v1.Announcement, opts metav1.CreateOptions) (result *v1.Announcement, err error) { - result = &v1.Announcement{} - err = c.client.Post(). - Resource("announcements"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(announcement). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a announcement and updates it. Returns the server's representation of the announcement, and an error, if there is any. -func (c *announcements) Update(ctx context.Context, announcement *v1.Announcement, opts metav1.UpdateOptions) (result *v1.Announcement, err error) { - result = &v1.Announcement{} - err = c.client.Put(). - Resource("announcements"). - Name(announcement.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(announcement). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *announcements) UpdateStatus(ctx context.Context, announcement *v1.Announcement, opts metav1.UpdateOptions) (result *v1.Announcement, err error) { - result = &v1.Announcement{} - err = c.client.Put(). - Resource("announcements"). - Name(announcement.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(announcement). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the announcement and deletes it. Returns an error if one occurs. -func (c *announcements) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("announcements"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *announcements) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("announcements"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched announcement. -func (c *announcements) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Announcement, err error) { - result = &v1.Announcement{} - err = c.client.Patch(pt). - Resource("announcements"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/app.go b/pkg/clientset/versioned/typed/management/v1/app.go index 7b4571e..6815ccc 100644 --- a/pkg/clientset/versioned/typed/management/v1/app.go +++ b/pkg/clientset/versioned/typed/management/v1/app.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // AppsGetter has a method to return a AppInterface. @@ -24,6 +23,7 @@ type AppsGetter interface { type AppInterface interface { Create(ctx context.Context, app *v1.App, opts metav1.CreateOptions) (*v1.App, error) Update(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (*v1.App, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (*v1.App, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -38,141 +38,26 @@ type AppInterface interface { // apps implements AppInterface type apps struct { - client rest.Interface + *gentype.ClientWithList[*v1.App, *v1.AppList] } // newApps returns a Apps func newApps(c *ManagementV1Client) *apps { return &apps{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.App, *v1.AppList]( + "apps", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.App { return &v1.App{} }, + func() *v1.AppList { return &v1.AppList{} }), } } -// Get takes name of the app, and returns the corresponding app object, and an error if there is any. -func (c *apps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.App, err error) { - result = &v1.App{} - err = c.client.Get(). - Resource("apps"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Apps that match those selectors. -func (c *apps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.AppList{} - err = c.client.Get(). - Resource("apps"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested apps. -func (c *apps) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("apps"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a app and creates it. Returns the server's representation of the app, and an error, if there is any. -func (c *apps) Create(ctx context.Context, app *v1.App, opts metav1.CreateOptions) (result *v1.App, err error) { - result = &v1.App{} - err = c.client.Post(). - Resource("apps"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(app). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a app and updates it. Returns the server's representation of the app, and an error, if there is any. -func (c *apps) Update(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (result *v1.App, err error) { - result = &v1.App{} - err = c.client.Put(). - Resource("apps"). - Name(app.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(app). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *apps) UpdateStatus(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (result *v1.App, err error) { - result = &v1.App{} - err = c.client.Put(). - Resource("apps"). - Name(app.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(app). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the app and deletes it. Returns an error if one occurs. -func (c *apps) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("apps"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *apps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("apps"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched app. -func (c *apps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.App, err error) { - result = &v1.App{} - err = c.client.Patch(pt). - Resource("apps"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // GetCredentials takes name of the app, and returns the corresponding v1.AppCredentials object, and an error if there is any. func (c *apps) GetCredentials(ctx context.Context, appName string, options metav1.GetOptions) (result *v1.AppCredentials, err error) { result = &v1.AppCredentials{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("apps"). Name(appName). SubResource("credentials"). diff --git a/pkg/clientset/versioned/typed/management/v1/backup.go b/pkg/clientset/versioned/typed/management/v1/backup.go index 3868629..5884633 100644 --- a/pkg/clientset/versioned/typed/management/v1/backup.go +++ b/pkg/clientset/versioned/typed/management/v1/backup.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // BackupsGetter has a method to return a BackupInterface. @@ -24,6 +23,7 @@ type BackupsGetter interface { type BackupInterface interface { Create(ctx context.Context, backup *v1.Backup, opts metav1.CreateOptions) (*v1.Backup, error) Update(ctx context.Context, backup *v1.Backup, opts metav1.UpdateOptions) (*v1.Backup, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, backup *v1.Backup, opts metav1.UpdateOptions) (*v1.Backup, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type BackupInterface interface { // backups implements BackupInterface type backups struct { - client rest.Interface + *gentype.ClientWithList[*v1.Backup, *v1.BackupList] } // newBackups returns a Backups func newBackups(c *ManagementV1Client) *backups { return &backups{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Backup, *v1.BackupList]( + "backups", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Backup { return &v1.Backup{} }, + func() *v1.BackupList { return &v1.BackupList{} }), } } - -// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any. -func (c *backups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Backup, err error) { - result = &v1.Backup{} - err = c.client.Get(). - Resource("backups"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Backups that match those selectors. -func (c *backups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.BackupList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.BackupList{} - err = c.client.Get(). - Resource("backups"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested backups. -func (c *backups) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("backups"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any. -func (c *backups) Create(ctx context.Context, backup *v1.Backup, opts metav1.CreateOptions) (result *v1.Backup, err error) { - result = &v1.Backup{} - err = c.client.Post(). - Resource("backups"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backup). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any. -func (c *backups) Update(ctx context.Context, backup *v1.Backup, opts metav1.UpdateOptions) (result *v1.Backup, err error) { - result = &v1.Backup{} - err = c.client.Put(). - Resource("backups"). - Name(backup.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backup). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *backups) UpdateStatus(ctx context.Context, backup *v1.Backup, opts metav1.UpdateOptions) (result *v1.Backup, err error) { - result = &v1.Backup{} - err = c.client.Put(). - Resource("backups"). - Name(backup.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backup). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the backup and deletes it. Returns an error if one occurs. -func (c *backups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("backups"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *backups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("backups"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched backup. -func (c *backups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Backup, err error) { - result = &v1.Backup{} - err = c.client.Patch(pt). - Resource("backups"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/cluster.go b/pkg/clientset/versioned/typed/management/v1/cluster.go index 8e2b1c8..78379be 100644 --- a/pkg/clientset/versioned/typed/management/v1/cluster.go +++ b/pkg/clientset/versioned/typed/management/v1/cluster.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ClustersGetter has a method to return a ClusterInterface. @@ -24,6 +23,7 @@ type ClustersGetter interface { type ClusterInterface interface { Create(ctx context.Context, cluster *v1.Cluster, opts metav1.CreateOptions) (*v1.Cluster, error) Update(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (*v1.Cluster, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (*v1.Cluster, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -42,141 +42,26 @@ type ClusterInterface interface { // clusters implements ClusterInterface type clusters struct { - client rest.Interface + *gentype.ClientWithList[*v1.Cluster, *v1.ClusterList] } // newClusters returns a Clusters func newClusters(c *ManagementV1Client) *clusters { return &clusters{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Cluster, *v1.ClusterList]( + "clusters", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Cluster { return &v1.Cluster{} }, + func() *v1.ClusterList { return &v1.ClusterList{} }), } } -// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. -func (c *clusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Cluster, err error) { - result = &v1.Cluster{} - err = c.client.Get(). - Resource("clusters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Clusters that match those selectors. -func (c *clusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterList{} - err = c.client.Get(). - Resource("clusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusters. -func (c *clusters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("clusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *clusters) Create(ctx context.Context, cluster *v1.Cluster, opts metav1.CreateOptions) (result *v1.Cluster, err error) { - result = &v1.Cluster{} - err = c.client.Post(). - Resource("clusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cluster). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *clusters) Update(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (result *v1.Cluster, err error) { - result = &v1.Cluster{} - err = c.client.Put(). - Resource("clusters"). - Name(cluster.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cluster). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *clusters) UpdateStatus(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (result *v1.Cluster, err error) { - result = &v1.Cluster{} - err = c.client.Put(). - Resource("clusters"). - Name(cluster.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cluster). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cluster and deletes it. Returns an error if one occurs. -func (c *clusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusters"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clusters"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cluster. -func (c *clusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Cluster, err error) { - result = &v1.Cluster{} - err = c.client.Patch(pt). - Resource("clusters"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // ListAccess takes name of the cluster, and returns the corresponding v1.ClusterMemberAccess object, and an error if there is any. func (c *clusters) ListAccess(ctx context.Context, clusterName string, options metav1.GetOptions) (result *v1.ClusterMemberAccess, err error) { result = &v1.ClusterMemberAccess{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("clusters"). Name(clusterName). SubResource("memberaccess"). @@ -189,7 +74,7 @@ func (c *clusters) ListAccess(ctx context.Context, clusterName string, options m // ListMembers takes name of the cluster, and returns the corresponding v1.ClusterMembers object, and an error if there is any. func (c *clusters) ListMembers(ctx context.Context, clusterName string, options metav1.GetOptions) (result *v1.ClusterMembers, err error) { result = &v1.ClusterMembers{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("clusters"). Name(clusterName). SubResource("members"). @@ -202,7 +87,7 @@ func (c *clusters) ListMembers(ctx context.Context, clusterName string, options // ListVirtualClusterDefaults takes name of the cluster, and returns the corresponding v1.ClusterVirtualClusterDefaults object, and an error if there is any. func (c *clusters) ListVirtualClusterDefaults(ctx context.Context, clusterName string, options metav1.GetOptions) (result *v1.ClusterVirtualClusterDefaults, err error) { result = &v1.ClusterVirtualClusterDefaults{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("clusters"). Name(clusterName). SubResource("virtualclusterdefaults"). @@ -215,7 +100,7 @@ func (c *clusters) ListVirtualClusterDefaults(ctx context.Context, clusterName s // GetAgentConfig takes name of the cluster, and returns the corresponding v1.ClusterAgentConfig object, and an error if there is any. func (c *clusters) GetAgentConfig(ctx context.Context, clusterName string, options metav1.GetOptions) (result *v1.ClusterAgentConfig, err error) { result = &v1.ClusterAgentConfig{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("clusters"). Name(clusterName). SubResource("agentconfig"). @@ -228,7 +113,7 @@ func (c *clusters) GetAgentConfig(ctx context.Context, clusterName string, optio // GetAccessKey takes name of the cluster, and returns the corresponding v1.ClusterAccessKey object, and an error if there is any. func (c *clusters) GetAccessKey(ctx context.Context, clusterName string, options metav1.GetOptions) (result *v1.ClusterAccessKey, err error) { result = &v1.ClusterAccessKey{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("clusters"). Name(clusterName). SubResource("accesskey"). diff --git a/pkg/clientset/versioned/typed/management/v1/clusteraccess.go b/pkg/clientset/versioned/typed/management/v1/clusteraccess.go index d730a2f..efebdf7 100644 --- a/pkg/clientset/versioned/typed/management/v1/clusteraccess.go +++ b/pkg/clientset/versioned/typed/management/v1/clusteraccess.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ClusterAccessesGetter has a method to return a ClusterAccessInterface. @@ -24,6 +23,7 @@ type ClusterAccessesGetter interface { type ClusterAccessInterface interface { Create(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.CreateOptions) (*v1.ClusterAccess, error) Update(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (*v1.ClusterAccess, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (*v1.ClusterAccess, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type ClusterAccessInterface interface { // clusterAccesses implements ClusterAccessInterface type clusterAccesses struct { - client rest.Interface + *gentype.ClientWithList[*v1.ClusterAccess, *v1.ClusterAccessList] } // newClusterAccesses returns a ClusterAccesses func newClusterAccesses(c *ManagementV1Client) *clusterAccesses { return &clusterAccesses{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.ClusterAccess, *v1.ClusterAccessList]( + "clusteraccesses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ClusterAccess { return &v1.ClusterAccess{} }, + func() *v1.ClusterAccessList { return &v1.ClusterAccessList{} }), } } - -// Get takes name of the clusterAccess, and returns the corresponding clusterAccess object, and an error if there is any. -func (c *clusterAccesses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterAccess, err error) { - result = &v1.ClusterAccess{} - err = c.client.Get(). - Resource("clusteraccesses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterAccesses that match those selectors. -func (c *clusterAccesses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterAccessList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterAccessList{} - err = c.client.Get(). - Resource("clusteraccesses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterAccesses. -func (c *clusterAccesses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("clusteraccesses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterAccess and creates it. Returns the server's representation of the clusterAccess, and an error, if there is any. -func (c *clusterAccesses) Create(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.CreateOptions) (result *v1.ClusterAccess, err error) { - result = &v1.ClusterAccess{} - err = c.client.Post(). - Resource("clusteraccesses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterAccess). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterAccess and updates it. Returns the server's representation of the clusterAccess, and an error, if there is any. -func (c *clusterAccesses) Update(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (result *v1.ClusterAccess, err error) { - result = &v1.ClusterAccess{} - err = c.client.Put(). - Resource("clusteraccesses"). - Name(clusterAccess.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterAccess). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *clusterAccesses) UpdateStatus(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (result *v1.ClusterAccess, err error) { - result = &v1.ClusterAccess{} - err = c.client.Put(). - Resource("clusteraccesses"). - Name(clusterAccess.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterAccess). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterAccess and deletes it. Returns an error if one occurs. -func (c *clusterAccesses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusteraccesses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterAccesses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clusteraccesses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterAccess. -func (c *clusterAccesses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterAccess, err error) { - result = &v1.ClusterAccess{} - err = c.client.Patch(pt). - Resource("clusteraccesses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/clusterroletemplate.go b/pkg/clientset/versioned/typed/management/v1/clusterroletemplate.go index 793504f..20c6015 100644 --- a/pkg/clientset/versioned/typed/management/v1/clusterroletemplate.go +++ b/pkg/clientset/versioned/typed/management/v1/clusterroletemplate.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ClusterRoleTemplatesGetter has a method to return a ClusterRoleTemplateInterface. @@ -24,6 +23,7 @@ type ClusterRoleTemplatesGetter interface { type ClusterRoleTemplateInterface interface { Create(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.CreateOptions) (*v1.ClusterRoleTemplate, error) Update(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (*v1.ClusterRoleTemplate, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (*v1.ClusterRoleTemplate, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type ClusterRoleTemplateInterface interface { // clusterRoleTemplates implements ClusterRoleTemplateInterface type clusterRoleTemplates struct { - client rest.Interface + *gentype.ClientWithList[*v1.ClusterRoleTemplate, *v1.ClusterRoleTemplateList] } // newClusterRoleTemplates returns a ClusterRoleTemplates func newClusterRoleTemplates(c *ManagementV1Client) *clusterRoleTemplates { return &clusterRoleTemplates{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.ClusterRoleTemplate, *v1.ClusterRoleTemplateList]( + "clusterroletemplates", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ClusterRoleTemplate { return &v1.ClusterRoleTemplate{} }, + func() *v1.ClusterRoleTemplateList { return &v1.ClusterRoleTemplateList{} }), } } - -// Get takes name of the clusterRoleTemplate, and returns the corresponding clusterRoleTemplate object, and an error if there is any. -func (c *clusterRoleTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRoleTemplate, err error) { - result = &v1.ClusterRoleTemplate{} - err = c.client.Get(). - Resource("clusterroletemplates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterRoleTemplates that match those selectors. -func (c *clusterRoleTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterRoleTemplateList{} - err = c.client.Get(). - Resource("clusterroletemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterRoleTemplates. -func (c *clusterRoleTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("clusterroletemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterRoleTemplate and creates it. Returns the server's representation of the clusterRoleTemplate, and an error, if there is any. -func (c *clusterRoleTemplates) Create(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.CreateOptions) (result *v1.ClusterRoleTemplate, err error) { - result = &v1.ClusterRoleTemplate{} - err = c.client.Post(). - Resource("clusterroletemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRoleTemplate). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterRoleTemplate and updates it. Returns the server's representation of the clusterRoleTemplate, and an error, if there is any. -func (c *clusterRoleTemplates) Update(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (result *v1.ClusterRoleTemplate, err error) { - result = &v1.ClusterRoleTemplate{} - err = c.client.Put(). - Resource("clusterroletemplates"). - Name(clusterRoleTemplate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRoleTemplate). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *clusterRoleTemplates) UpdateStatus(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (result *v1.ClusterRoleTemplate, err error) { - result = &v1.ClusterRoleTemplate{} - err = c.client.Put(). - Resource("clusterroletemplates"). - Name(clusterRoleTemplate.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRoleTemplate). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterRoleTemplate and deletes it. Returns an error if one occurs. -func (c *clusterRoleTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterroletemplates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterRoleTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clusterroletemplates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterRoleTemplate. -func (c *clusterRoleTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleTemplate, err error) { - result = &v1.ClusterRoleTemplate{} - err = c.client.Patch(pt). - Resource("clusterroletemplates"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/config.go b/pkg/clientset/versioned/typed/management/v1/config.go index a9dfe8c..de5d0ea 100644 --- a/pkg/clientset/versioned/typed/management/v1/config.go +++ b/pkg/clientset/versioned/typed/management/v1/config.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ConfigsGetter has a method to return a ConfigInterface. @@ -24,6 +23,7 @@ type ConfigsGetter interface { type ConfigInterface interface { Create(ctx context.Context, config *v1.Config, opts metav1.CreateOptions) (*v1.Config, error) Update(ctx context.Context, config *v1.Config, opts metav1.UpdateOptions) (*v1.Config, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, config *v1.Config, opts metav1.UpdateOptions) (*v1.Config, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type ConfigInterface interface { // configs implements ConfigInterface type configs struct { - client rest.Interface + *gentype.ClientWithList[*v1.Config, *v1.ConfigList] } // newConfigs returns a Configs func newConfigs(c *ManagementV1Client) *configs { return &configs{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Config, *v1.ConfigList]( + "configs", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Config { return &v1.Config{} }, + func() *v1.ConfigList { return &v1.ConfigList{} }), } } - -// Get takes name of the config, and returns the corresponding config object, and an error if there is any. -func (c *configs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Config, err error) { - result = &v1.Config{} - err = c.client.Get(). - Resource("configs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Configs that match those selectors. -func (c *configs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ConfigList{} - err = c.client.Get(). - Resource("configs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested configs. -func (c *configs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("configs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a config and creates it. Returns the server's representation of the config, and an error, if there is any. -func (c *configs) Create(ctx context.Context, config *v1.Config, opts metav1.CreateOptions) (result *v1.Config, err error) { - result = &v1.Config{} - err = c.client.Post(). - Resource("configs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(config). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a config and updates it. Returns the server's representation of the config, and an error, if there is any. -func (c *configs) Update(ctx context.Context, config *v1.Config, opts metav1.UpdateOptions) (result *v1.Config, err error) { - result = &v1.Config{} - err = c.client.Put(). - Resource("configs"). - Name(config.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(config). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *configs) UpdateStatus(ctx context.Context, config *v1.Config, opts metav1.UpdateOptions) (result *v1.Config, err error) { - result = &v1.Config{} - err = c.client.Put(). - Resource("configs"). - Name(config.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(config). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the config and deletes it. Returns an error if one occurs. -func (c *configs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("configs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *configs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("configs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched config. -func (c *configs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Config, err error) { - result = &v1.Config{} - err = c.client.Patch(pt). - Resource("configs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/convertvirtualclusterconfig.go b/pkg/clientset/versioned/typed/management/v1/convertvirtualclusterconfig.go index 28fac07..bf46924 100644 --- a/pkg/clientset/versioned/typed/management/v1/convertvirtualclusterconfig.go +++ b/pkg/clientset/versioned/typed/management/v1/convertvirtualclusterconfig.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ConvertVirtualClusterConfigsGetter has a method to return a ConvertVirtualClusterConfigInterface. @@ -24,6 +23,7 @@ type ConvertVirtualClusterConfigsGetter interface { type ConvertVirtualClusterConfigInterface interface { Create(ctx context.Context, convertVirtualClusterConfig *v1.ConvertVirtualClusterConfig, opts metav1.CreateOptions) (*v1.ConvertVirtualClusterConfig, error) Update(ctx context.Context, convertVirtualClusterConfig *v1.ConvertVirtualClusterConfig, opts metav1.UpdateOptions) (*v1.ConvertVirtualClusterConfig, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, convertVirtualClusterConfig *v1.ConvertVirtualClusterConfig, opts metav1.UpdateOptions) (*v1.ConvertVirtualClusterConfig, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type ConvertVirtualClusterConfigInterface interface { // convertVirtualClusterConfigs implements ConvertVirtualClusterConfigInterface type convertVirtualClusterConfigs struct { - client rest.Interface + *gentype.ClientWithList[*v1.ConvertVirtualClusterConfig, *v1.ConvertVirtualClusterConfigList] } // newConvertVirtualClusterConfigs returns a ConvertVirtualClusterConfigs func newConvertVirtualClusterConfigs(c *ManagementV1Client) *convertVirtualClusterConfigs { return &convertVirtualClusterConfigs{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.ConvertVirtualClusterConfig, *v1.ConvertVirtualClusterConfigList]( + "convertvirtualclusterconfigs", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ConvertVirtualClusterConfig { return &v1.ConvertVirtualClusterConfig{} }, + func() *v1.ConvertVirtualClusterConfigList { return &v1.ConvertVirtualClusterConfigList{} }), } } - -// Get takes name of the convertVirtualClusterConfig, and returns the corresponding convertVirtualClusterConfig object, and an error if there is any. -func (c *convertVirtualClusterConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ConvertVirtualClusterConfig, err error) { - result = &v1.ConvertVirtualClusterConfig{} - err = c.client.Get(). - Resource("convertvirtualclusterconfigs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ConvertVirtualClusterConfigs that match those selectors. -func (c *convertVirtualClusterConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConvertVirtualClusterConfigList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ConvertVirtualClusterConfigList{} - err = c.client.Get(). - Resource("convertvirtualclusterconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested convertVirtualClusterConfigs. -func (c *convertVirtualClusterConfigs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("convertvirtualclusterconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a convertVirtualClusterConfig and creates it. Returns the server's representation of the convertVirtualClusterConfig, and an error, if there is any. -func (c *convertVirtualClusterConfigs) Create(ctx context.Context, convertVirtualClusterConfig *v1.ConvertVirtualClusterConfig, opts metav1.CreateOptions) (result *v1.ConvertVirtualClusterConfig, err error) { - result = &v1.ConvertVirtualClusterConfig{} - err = c.client.Post(). - Resource("convertvirtualclusterconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(convertVirtualClusterConfig). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a convertVirtualClusterConfig and updates it. Returns the server's representation of the convertVirtualClusterConfig, and an error, if there is any. -func (c *convertVirtualClusterConfigs) Update(ctx context.Context, convertVirtualClusterConfig *v1.ConvertVirtualClusterConfig, opts metav1.UpdateOptions) (result *v1.ConvertVirtualClusterConfig, err error) { - result = &v1.ConvertVirtualClusterConfig{} - err = c.client.Put(). - Resource("convertvirtualclusterconfigs"). - Name(convertVirtualClusterConfig.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(convertVirtualClusterConfig). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *convertVirtualClusterConfigs) UpdateStatus(ctx context.Context, convertVirtualClusterConfig *v1.ConvertVirtualClusterConfig, opts metav1.UpdateOptions) (result *v1.ConvertVirtualClusterConfig, err error) { - result = &v1.ConvertVirtualClusterConfig{} - err = c.client.Put(). - Resource("convertvirtualclusterconfigs"). - Name(convertVirtualClusterConfig.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(convertVirtualClusterConfig). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the convertVirtualClusterConfig and deletes it. Returns an error if one occurs. -func (c *convertVirtualClusterConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("convertvirtualclusterconfigs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *convertVirtualClusterConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("convertvirtualclusterconfigs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched convertVirtualClusterConfig. -func (c *convertVirtualClusterConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConvertVirtualClusterConfig, err error) { - result = &v1.ConvertVirtualClusterConfig{} - err = c.client.Patch(pt). - Resource("convertvirtualclusterconfigs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/devpodenvironmenttemplate.go b/pkg/clientset/versioned/typed/management/v1/devpodenvironmenttemplate.go index c46bb97..881e4fb 100644 --- a/pkg/clientset/versioned/typed/management/v1/devpodenvironmenttemplate.go +++ b/pkg/clientset/versioned/typed/management/v1/devpodenvironmenttemplate.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // DevPodEnvironmentTemplatesGetter has a method to return a DevPodEnvironmentTemplateInterface. @@ -35,118 +34,18 @@ type DevPodEnvironmentTemplateInterface interface { // devPodEnvironmentTemplates implements DevPodEnvironmentTemplateInterface type devPodEnvironmentTemplates struct { - client rest.Interface + *gentype.ClientWithList[*v1.DevPodEnvironmentTemplate, *v1.DevPodEnvironmentTemplateList] } // newDevPodEnvironmentTemplates returns a DevPodEnvironmentTemplates func newDevPodEnvironmentTemplates(c *ManagementV1Client) *devPodEnvironmentTemplates { return &devPodEnvironmentTemplates{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.DevPodEnvironmentTemplate, *v1.DevPodEnvironmentTemplateList]( + "devpodenvironmenttemplates", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.DevPodEnvironmentTemplate { return &v1.DevPodEnvironmentTemplate{} }, + func() *v1.DevPodEnvironmentTemplateList { return &v1.DevPodEnvironmentTemplateList{} }), } } - -// Get takes name of the devPodEnvironmentTemplate, and returns the corresponding devPodEnvironmentTemplate object, and an error if there is any. -func (c *devPodEnvironmentTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodEnvironmentTemplate, err error) { - result = &v1.DevPodEnvironmentTemplate{} - err = c.client.Get(). - Resource("devpodenvironmenttemplates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DevPodEnvironmentTemplates that match those selectors. -func (c *devPodEnvironmentTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodEnvironmentTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DevPodEnvironmentTemplateList{} - err = c.client.Get(). - Resource("devpodenvironmenttemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested devPodEnvironmentTemplates. -func (c *devPodEnvironmentTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("devpodenvironmenttemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a devPodEnvironmentTemplate and creates it. Returns the server's representation of the devPodEnvironmentTemplate, and an error, if there is any. -func (c *devPodEnvironmentTemplates) Create(ctx context.Context, devPodEnvironmentTemplate *v1.DevPodEnvironmentTemplate, opts metav1.CreateOptions) (result *v1.DevPodEnvironmentTemplate, err error) { - result = &v1.DevPodEnvironmentTemplate{} - err = c.client.Post(). - Resource("devpodenvironmenttemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodEnvironmentTemplate). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a devPodEnvironmentTemplate and updates it. Returns the server's representation of the devPodEnvironmentTemplate, and an error, if there is any. -func (c *devPodEnvironmentTemplates) Update(ctx context.Context, devPodEnvironmentTemplate *v1.DevPodEnvironmentTemplate, opts metav1.UpdateOptions) (result *v1.DevPodEnvironmentTemplate, err error) { - result = &v1.DevPodEnvironmentTemplate{} - err = c.client.Put(). - Resource("devpodenvironmenttemplates"). - Name(devPodEnvironmentTemplate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodEnvironmentTemplate). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the devPodEnvironmentTemplate and deletes it. Returns an error if one occurs. -func (c *devPodEnvironmentTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("devpodenvironmenttemplates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *devPodEnvironmentTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("devpodenvironmenttemplates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched devPodEnvironmentTemplate. -func (c *devPodEnvironmentTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodEnvironmentTemplate, err error) { - result = &v1.DevPodEnvironmentTemplate{} - err = c.client.Patch(pt). - Resource("devpodenvironmenttemplates"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/devpodworkspaceinstance.go b/pkg/clientset/versioned/typed/management/v1/devpodworkspaceinstance.go index 21ad807..4a1d6d9 100644 --- a/pkg/clientset/versioned/typed/management/v1/devpodworkspaceinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/devpodworkspaceinstance.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // DevPodWorkspaceInstancesGetter has a method to return a DevPodWorkspaceInstanceInterface. @@ -38,137 +37,27 @@ type DevPodWorkspaceInstanceInterface interface { // devPodWorkspaceInstances implements DevPodWorkspaceInstanceInterface type devPodWorkspaceInstances struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.DevPodWorkspaceInstance, *v1.DevPodWorkspaceInstanceList] } // newDevPodWorkspaceInstances returns a DevPodWorkspaceInstances func newDevPodWorkspaceInstances(c *ManagementV1Client, namespace string) *devPodWorkspaceInstances { return &devPodWorkspaceInstances{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.DevPodWorkspaceInstance, *v1.DevPodWorkspaceInstanceList]( + "devpodworkspaceinstances", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.DevPodWorkspaceInstance { return &v1.DevPodWorkspaceInstance{} }, + func() *v1.DevPodWorkspaceInstanceList { return &v1.DevPodWorkspaceInstanceList{} }), } } -// Get takes name of the devPodWorkspaceInstance, and returns the corresponding devPodWorkspaceInstance object, and an error if there is any. -func (c *devPodWorkspaceInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodWorkspaceInstance, err error) { - result = &v1.DevPodWorkspaceInstance{} - err = c.client.Get(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DevPodWorkspaceInstances that match those selectors. -func (c *devPodWorkspaceInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodWorkspaceInstanceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DevPodWorkspaceInstanceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested devPodWorkspaceInstances. -func (c *devPodWorkspaceInstances) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a devPodWorkspaceInstance and creates it. Returns the server's representation of the devPodWorkspaceInstance, and an error, if there is any. -func (c *devPodWorkspaceInstances) Create(ctx context.Context, devPodWorkspaceInstance *v1.DevPodWorkspaceInstance, opts metav1.CreateOptions) (result *v1.DevPodWorkspaceInstance, err error) { - result = &v1.DevPodWorkspaceInstance{} - err = c.client.Post(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodWorkspaceInstance). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a devPodWorkspaceInstance and updates it. Returns the server's representation of the devPodWorkspaceInstance, and an error, if there is any. -func (c *devPodWorkspaceInstances) Update(ctx context.Context, devPodWorkspaceInstance *v1.DevPodWorkspaceInstance, opts metav1.UpdateOptions) (result *v1.DevPodWorkspaceInstance, err error) { - result = &v1.DevPodWorkspaceInstance{} - err = c.client.Put(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - Name(devPodWorkspaceInstance.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodWorkspaceInstance). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the devPodWorkspaceInstance and deletes it. Returns an error if one occurs. -func (c *devPodWorkspaceInstances) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *devPodWorkspaceInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched devPodWorkspaceInstance. -func (c *devPodWorkspaceInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspaceInstance, err error) { - result = &v1.DevPodWorkspaceInstance{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // GetState takes name of the devPodWorkspaceInstance, and returns the corresponding v1.DevPodWorkspaceInstanceState object, and an error if there is any. func (c *devPodWorkspaceInstances) GetState(ctx context.Context, devPodWorkspaceInstanceName string, options metav1.GetOptions) (result *v1.DevPodWorkspaceInstanceState, err error) { result = &v1.DevPodWorkspaceInstanceState{} - err = c.client.Get(). - Namespace(c.ns). + err = c.GetClient().Get(). + Namespace(c.GetNamespace()). Resource("devpodworkspaceinstances"). Name(devPodWorkspaceInstanceName). SubResource("state"). @@ -181,8 +70,8 @@ func (c *devPodWorkspaceInstances) GetState(ctx context.Context, devPodWorkspace // SetState takes the representation of a devPodWorkspaceInstanceState and creates it. Returns the server's representation of the devPodWorkspaceInstanceState, and an error, if there is any. func (c *devPodWorkspaceInstances) SetState(ctx context.Context, devPodWorkspaceInstanceName string, devPodWorkspaceInstanceState *v1.DevPodWorkspaceInstanceState, opts metav1.CreateOptions) (result *v1.DevPodWorkspaceInstanceState, err error) { result = &v1.DevPodWorkspaceInstanceState{} - err = c.client.Post(). - Namespace(c.ns). + err = c.GetClient().Post(). + Namespace(c.GetNamespace()). Resource("devpodworkspaceinstances"). Name(devPodWorkspaceInstanceName). SubResource("state"). diff --git a/pkg/clientset/versioned/typed/management/v1/devpodworkspacetemplate.go b/pkg/clientset/versioned/typed/management/v1/devpodworkspacetemplate.go index 85655d3..4f29902 100644 --- a/pkg/clientset/versioned/typed/management/v1/devpodworkspacetemplate.go +++ b/pkg/clientset/versioned/typed/management/v1/devpodworkspacetemplate.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // DevPodWorkspaceTemplatesGetter has a method to return a DevPodWorkspaceTemplateInterface. @@ -24,6 +23,7 @@ type DevPodWorkspaceTemplatesGetter interface { type DevPodWorkspaceTemplateInterface interface { Create(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.CreateOptions) (*v1.DevPodWorkspaceTemplate, error) Update(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (*v1.DevPodWorkspaceTemplate, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (*v1.DevPodWorkspaceTemplate, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type DevPodWorkspaceTemplateInterface interface { // devPodWorkspaceTemplates implements DevPodWorkspaceTemplateInterface type devPodWorkspaceTemplates struct { - client rest.Interface + *gentype.ClientWithList[*v1.DevPodWorkspaceTemplate, *v1.DevPodWorkspaceTemplateList] } // newDevPodWorkspaceTemplates returns a DevPodWorkspaceTemplates func newDevPodWorkspaceTemplates(c *ManagementV1Client) *devPodWorkspaceTemplates { return &devPodWorkspaceTemplates{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.DevPodWorkspaceTemplate, *v1.DevPodWorkspaceTemplateList]( + "devpodworkspacetemplates", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.DevPodWorkspaceTemplate { return &v1.DevPodWorkspaceTemplate{} }, + func() *v1.DevPodWorkspaceTemplateList { return &v1.DevPodWorkspaceTemplateList{} }), } } - -// Get takes name of the devPodWorkspaceTemplate, and returns the corresponding devPodWorkspaceTemplate object, and an error if there is any. -func (c *devPodWorkspaceTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodWorkspaceTemplate, err error) { - result = &v1.DevPodWorkspaceTemplate{} - err = c.client.Get(). - Resource("devpodworkspacetemplates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DevPodWorkspaceTemplates that match those selectors. -func (c *devPodWorkspaceTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodWorkspaceTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DevPodWorkspaceTemplateList{} - err = c.client.Get(). - Resource("devpodworkspacetemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested devPodWorkspaceTemplates. -func (c *devPodWorkspaceTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("devpodworkspacetemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a devPodWorkspaceTemplate and creates it. Returns the server's representation of the devPodWorkspaceTemplate, and an error, if there is any. -func (c *devPodWorkspaceTemplates) Create(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.CreateOptions) (result *v1.DevPodWorkspaceTemplate, err error) { - result = &v1.DevPodWorkspaceTemplate{} - err = c.client.Post(). - Resource("devpodworkspacetemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodWorkspaceTemplate). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a devPodWorkspaceTemplate and updates it. Returns the server's representation of the devPodWorkspaceTemplate, and an error, if there is any. -func (c *devPodWorkspaceTemplates) Update(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (result *v1.DevPodWorkspaceTemplate, err error) { - result = &v1.DevPodWorkspaceTemplate{} - err = c.client.Put(). - Resource("devpodworkspacetemplates"). - Name(devPodWorkspaceTemplate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodWorkspaceTemplate). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *devPodWorkspaceTemplates) UpdateStatus(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (result *v1.DevPodWorkspaceTemplate, err error) { - result = &v1.DevPodWorkspaceTemplate{} - err = c.client.Put(). - Resource("devpodworkspacetemplates"). - Name(devPodWorkspaceTemplate.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodWorkspaceTemplate). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the devPodWorkspaceTemplate and deletes it. Returns an error if one occurs. -func (c *devPodWorkspaceTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("devpodworkspacetemplates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *devPodWorkspaceTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("devpodworkspacetemplates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched devPodWorkspaceTemplate. -func (c *devPodWorkspaceTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspaceTemplate, err error) { - result = &v1.DevPodWorkspaceTemplate{} - err = c.client.Patch(pt). - Resource("devpodworkspacetemplates"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/directclusterendpointtoken.go b/pkg/clientset/versioned/typed/management/v1/directclusterendpointtoken.go index 905f640..fbe2de9 100644 --- a/pkg/clientset/versioned/typed/management/v1/directclusterendpointtoken.go +++ b/pkg/clientset/versioned/typed/management/v1/directclusterendpointtoken.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // DirectClusterEndpointTokensGetter has a method to return a DirectClusterEndpointTokenInterface. @@ -24,6 +23,7 @@ type DirectClusterEndpointTokensGetter interface { type DirectClusterEndpointTokenInterface interface { Create(ctx context.Context, directClusterEndpointToken *v1.DirectClusterEndpointToken, opts metav1.CreateOptions) (*v1.DirectClusterEndpointToken, error) Update(ctx context.Context, directClusterEndpointToken *v1.DirectClusterEndpointToken, opts metav1.UpdateOptions) (*v1.DirectClusterEndpointToken, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, directClusterEndpointToken *v1.DirectClusterEndpointToken, opts metav1.UpdateOptions) (*v1.DirectClusterEndpointToken, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type DirectClusterEndpointTokenInterface interface { // directClusterEndpointTokens implements DirectClusterEndpointTokenInterface type directClusterEndpointTokens struct { - client rest.Interface + *gentype.ClientWithList[*v1.DirectClusterEndpointToken, *v1.DirectClusterEndpointTokenList] } // newDirectClusterEndpointTokens returns a DirectClusterEndpointTokens func newDirectClusterEndpointTokens(c *ManagementV1Client) *directClusterEndpointTokens { return &directClusterEndpointTokens{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.DirectClusterEndpointToken, *v1.DirectClusterEndpointTokenList]( + "directclusterendpointtokens", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.DirectClusterEndpointToken { return &v1.DirectClusterEndpointToken{} }, + func() *v1.DirectClusterEndpointTokenList { return &v1.DirectClusterEndpointTokenList{} }), } } - -// Get takes name of the directClusterEndpointToken, and returns the corresponding directClusterEndpointToken object, and an error if there is any. -func (c *directClusterEndpointTokens) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DirectClusterEndpointToken, err error) { - result = &v1.DirectClusterEndpointToken{} - err = c.client.Get(). - Resource("directclusterendpointtokens"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DirectClusterEndpointTokens that match those selectors. -func (c *directClusterEndpointTokens) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DirectClusterEndpointTokenList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DirectClusterEndpointTokenList{} - err = c.client.Get(). - Resource("directclusterendpointtokens"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested directClusterEndpointTokens. -func (c *directClusterEndpointTokens) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("directclusterendpointtokens"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a directClusterEndpointToken and creates it. Returns the server's representation of the directClusterEndpointToken, and an error, if there is any. -func (c *directClusterEndpointTokens) Create(ctx context.Context, directClusterEndpointToken *v1.DirectClusterEndpointToken, opts metav1.CreateOptions) (result *v1.DirectClusterEndpointToken, err error) { - result = &v1.DirectClusterEndpointToken{} - err = c.client.Post(). - Resource("directclusterendpointtokens"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(directClusterEndpointToken). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a directClusterEndpointToken and updates it. Returns the server's representation of the directClusterEndpointToken, and an error, if there is any. -func (c *directClusterEndpointTokens) Update(ctx context.Context, directClusterEndpointToken *v1.DirectClusterEndpointToken, opts metav1.UpdateOptions) (result *v1.DirectClusterEndpointToken, err error) { - result = &v1.DirectClusterEndpointToken{} - err = c.client.Put(). - Resource("directclusterendpointtokens"). - Name(directClusterEndpointToken.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(directClusterEndpointToken). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *directClusterEndpointTokens) UpdateStatus(ctx context.Context, directClusterEndpointToken *v1.DirectClusterEndpointToken, opts metav1.UpdateOptions) (result *v1.DirectClusterEndpointToken, err error) { - result = &v1.DirectClusterEndpointToken{} - err = c.client.Put(). - Resource("directclusterendpointtokens"). - Name(directClusterEndpointToken.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(directClusterEndpointToken). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the directClusterEndpointToken and deletes it. Returns an error if one occurs. -func (c *directClusterEndpointTokens) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("directclusterendpointtokens"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *directClusterEndpointTokens) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("directclusterendpointtokens"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched directClusterEndpointToken. -func (c *directClusterEndpointTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DirectClusterEndpointToken, err error) { - result = &v1.DirectClusterEndpointToken{} - err = c.client.Patch(pt). - Resource("directclusterendpointtokens"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/event.go b/pkg/clientset/versioned/typed/management/v1/event.go index 00e638d..0ae798a 100644 --- a/pkg/clientset/versioned/typed/management/v1/event.go +++ b/pkg/clientset/versioned/typed/management/v1/event.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // EventsGetter has a method to return a EventInterface. @@ -24,6 +23,7 @@ type EventsGetter interface { type EventInterface interface { Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (*v1.Event, error) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (*v1.Event, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (*v1.Event, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type EventInterface interface { // events implements EventInterface type events struct { - client rest.Interface + *gentype.ClientWithList[*v1.Event, *v1.EventList] } // newEvents returns a Events func newEvents(c *ManagementV1Client) *events { return &events{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Event, *v1.EventList]( + "events", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Event { return &v1.Event{} }, + func() *v1.EventList { return &v1.EventList{} }), } } - -// Get takes name of the event, and returns the corresponding event object, and an error if there is any. -func (c *events) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Get(). - Resource("events"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.EventList{} - err = c.client.Get(). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested events. -func (c *events) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Post(). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(event). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Put(). - Resource("events"). - Name(event.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(event). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *events) UpdateStatus(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Put(). - Resource("events"). - Name(event.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(event). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *events) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("events"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *events) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("events"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched event. -func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Patch(pt). - Resource("events"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_agentauditevent.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_agentauditevent.go index 8a56680..01c6961 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_agentauditevent.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_agentauditevent.go @@ -24,20 +24,22 @@ var agentauditeventsKind = v1.SchemeGroupVersion.WithKind("AgentAuditEvent") // Get takes name of the agentAuditEvent, and returns the corresponding agentAuditEvent object, and an error if there is any. func (c *FakeAgentAuditEvents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AgentAuditEvent, err error) { + emptyResult := &v1.AgentAuditEvent{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(agentauditeventsResource, name), &v1.AgentAuditEvent{}) + Invokes(testing.NewRootGetActionWithOptions(agentauditeventsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.AgentAuditEvent), err } // List takes label and field selectors, and returns the list of AgentAuditEvents that match those selectors. func (c *FakeAgentAuditEvents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AgentAuditEventList, err error) { + emptyResult := &v1.AgentAuditEventList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(agentauditeventsResource, agentauditeventsKind, opts), &v1.AgentAuditEventList{}) + Invokes(testing.NewRootListActionWithOptions(agentauditeventsResource, agentauditeventsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeAgentAuditEvents) List(ctx context.Context, opts metav1.ListOptions // Watch returns a watch.Interface that watches the requested agentAuditEvents. func (c *FakeAgentAuditEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(agentauditeventsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(agentauditeventsResource, opts)) } // Create takes the representation of a agentAuditEvent and creates it. Returns the server's representation of the agentAuditEvent, and an error, if there is any. func (c *FakeAgentAuditEvents) Create(ctx context.Context, agentAuditEvent *v1.AgentAuditEvent, opts metav1.CreateOptions) (result *v1.AgentAuditEvent, err error) { + emptyResult := &v1.AgentAuditEvent{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(agentauditeventsResource, agentAuditEvent), &v1.AgentAuditEvent{}) + Invokes(testing.NewRootCreateActionWithOptions(agentauditeventsResource, agentAuditEvent, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.AgentAuditEvent), err } // Update takes the representation of a agentAuditEvent and updates it. Returns the server's representation of the agentAuditEvent, and an error, if there is any. func (c *FakeAgentAuditEvents) Update(ctx context.Context, agentAuditEvent *v1.AgentAuditEvent, opts metav1.UpdateOptions) (result *v1.AgentAuditEvent, err error) { + emptyResult := &v1.AgentAuditEvent{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(agentauditeventsResource, agentAuditEvent), &v1.AgentAuditEvent{}) + Invokes(testing.NewRootUpdateActionWithOptions(agentauditeventsResource, agentAuditEvent, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.AgentAuditEvent), 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 *FakeAgentAuditEvents) UpdateStatus(ctx context.Context, agentAuditEvent *v1.AgentAuditEvent, opts metav1.UpdateOptions) (*v1.AgentAuditEvent, error) { +func (c *FakeAgentAuditEvents) UpdateStatus(ctx context.Context, agentAuditEvent *v1.AgentAuditEvent, opts metav1.UpdateOptions) (result *v1.AgentAuditEvent, err error) { + emptyResult := &v1.AgentAuditEvent{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(agentauditeventsResource, "status", agentAuditEvent), &v1.AgentAuditEvent{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(agentauditeventsResource, "status", agentAuditEvent, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.AgentAuditEvent), err } @@ -99,7 +104,7 @@ func (c *FakeAgentAuditEvents) Delete(ctx context.Context, name string, opts met // DeleteCollection deletes a collection of objects. func (c *FakeAgentAuditEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(agentauditeventsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(agentauditeventsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.AgentAuditEventList{}) return err @@ -107,10 +112,11 @@ func (c *FakeAgentAuditEvents) DeleteCollection(ctx context.Context, opts metav1 // Patch applies the patch and returns the patched agentAuditEvent. func (c *FakeAgentAuditEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AgentAuditEvent, err error) { + emptyResult := &v1.AgentAuditEvent{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(agentauditeventsResource, name, pt, data, subresources...), &v1.AgentAuditEvent{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(agentauditeventsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.AgentAuditEvent), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_announcement.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_announcement.go index 0baea60..d11150f 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_announcement.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_announcement.go @@ -24,20 +24,22 @@ var announcementsKind = v1.SchemeGroupVersion.WithKind("Announcement") // Get takes name of the announcement, and returns the corresponding announcement object, and an error if there is any. func (c *FakeAnnouncements) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Announcement, err error) { + emptyResult := &v1.Announcement{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(announcementsResource, name), &v1.Announcement{}) + Invokes(testing.NewRootGetActionWithOptions(announcementsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Announcement), err } // List takes label and field selectors, and returns the list of Announcements that match those selectors. func (c *FakeAnnouncements) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AnnouncementList, err error) { + emptyResult := &v1.AnnouncementList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(announcementsResource, announcementsKind, opts), &v1.AnnouncementList{}) + Invokes(testing.NewRootListActionWithOptions(announcementsResource, announcementsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeAnnouncements) List(ctx context.Context, opts metav1.ListOptions) ( // Watch returns a watch.Interface that watches the requested announcements. func (c *FakeAnnouncements) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(announcementsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(announcementsResource, opts)) } // Create takes the representation of a announcement and creates it. Returns the server's representation of the announcement, and an error, if there is any. func (c *FakeAnnouncements) Create(ctx context.Context, announcement *v1.Announcement, opts metav1.CreateOptions) (result *v1.Announcement, err error) { + emptyResult := &v1.Announcement{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(announcementsResource, announcement), &v1.Announcement{}) + Invokes(testing.NewRootCreateActionWithOptions(announcementsResource, announcement, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Announcement), err } // Update takes the representation of a announcement and updates it. Returns the server's representation of the announcement, and an error, if there is any. func (c *FakeAnnouncements) Update(ctx context.Context, announcement *v1.Announcement, opts metav1.UpdateOptions) (result *v1.Announcement, err error) { + emptyResult := &v1.Announcement{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(announcementsResource, announcement), &v1.Announcement{}) + Invokes(testing.NewRootUpdateActionWithOptions(announcementsResource, announcement, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Announcement), 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 *FakeAnnouncements) UpdateStatus(ctx context.Context, announcement *v1.Announcement, opts metav1.UpdateOptions) (*v1.Announcement, error) { +func (c *FakeAnnouncements) UpdateStatus(ctx context.Context, announcement *v1.Announcement, opts metav1.UpdateOptions) (result *v1.Announcement, err error) { + emptyResult := &v1.Announcement{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(announcementsResource, "status", announcement), &v1.Announcement{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(announcementsResource, "status", announcement, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Announcement), err } @@ -99,7 +104,7 @@ func (c *FakeAnnouncements) Delete(ctx context.Context, name string, opts metav1 // DeleteCollection deletes a collection of objects. func (c *FakeAnnouncements) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(announcementsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(announcementsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.AnnouncementList{}) return err @@ -107,10 +112,11 @@ func (c *FakeAnnouncements) DeleteCollection(ctx context.Context, opts metav1.De // Patch applies the patch and returns the patched announcement. func (c *FakeAnnouncements) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Announcement, err error) { + emptyResult := &v1.Announcement{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(announcementsResource, name, pt, data, subresources...), &v1.Announcement{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(announcementsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Announcement), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_app.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_app.go index e3a60f2..0a71d4a 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_app.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_app.go @@ -24,20 +24,22 @@ var appsKind = v1.SchemeGroupVersion.WithKind("App") // Get takes name of the app, and returns the corresponding app object, and an error if there is any. func (c *FakeApps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.App, err error) { + emptyResult := &v1.App{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(appsResource, name), &v1.App{}) + Invokes(testing.NewRootGetActionWithOptions(appsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.App), err } // List takes label and field selectors, and returns the list of Apps that match those selectors. func (c *FakeApps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppList, err error) { + emptyResult := &v1.AppList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(appsResource, appsKind, opts), &v1.AppList{}) + Invokes(testing.NewRootListActionWithOptions(appsResource, appsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeApps) List(ctx context.Context, opts metav1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested apps. func (c *FakeApps) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(appsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(appsResource, opts)) } // Create takes the representation of a app and creates it. Returns the server's representation of the app, and an error, if there is any. func (c *FakeApps) Create(ctx context.Context, app *v1.App, opts metav1.CreateOptions) (result *v1.App, err error) { + emptyResult := &v1.App{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(appsResource, app), &v1.App{}) + Invokes(testing.NewRootCreateActionWithOptions(appsResource, app, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.App), err } // Update takes the representation of a app and updates it. Returns the server's representation of the app, and an error, if there is any. func (c *FakeApps) Update(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (result *v1.App, err error) { + emptyResult := &v1.App{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(appsResource, app), &v1.App{}) + Invokes(testing.NewRootUpdateActionWithOptions(appsResource, app, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.App), 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 *FakeApps) UpdateStatus(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (*v1.App, error) { +func (c *FakeApps) UpdateStatus(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (result *v1.App, err error) { + emptyResult := &v1.App{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(appsResource, "status", app), &v1.App{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(appsResource, "status", app, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.App), err } @@ -99,7 +104,7 @@ func (c *FakeApps) Delete(ctx context.Context, name string, opts metav1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakeApps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(appsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(appsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.AppList{}) return err @@ -107,20 +112,22 @@ func (c *FakeApps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptio // Patch applies the patch and returns the patched app. func (c *FakeApps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.App, err error) { + emptyResult := &v1.App{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(appsResource, name, pt, data, subresources...), &v1.App{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(appsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.App), err } // GetCredentials takes name of the app, and returns the corresponding appCredentials object, and an error if there is any. func (c *FakeApps) GetCredentials(ctx context.Context, appName string, options metav1.GetOptions) (result *v1.AppCredentials, err error) { + emptyResult := &v1.AppCredentials{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(appsResource, "credentials", appName), &v1.AppCredentials{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(appsResource, "credentials", appName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.AppCredentials), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_backup.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_backup.go index 1a0a41a..ae69f60 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_backup.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_backup.go @@ -24,20 +24,22 @@ var backupsKind = v1.SchemeGroupVersion.WithKind("Backup") // Get takes name of the backup, and returns the corresponding backup object, and an error if there is any. func (c *FakeBackups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Backup, err error) { + emptyResult := &v1.Backup{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(backupsResource, name), &v1.Backup{}) + Invokes(testing.NewRootGetActionWithOptions(backupsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Backup), err } // List takes label and field selectors, and returns the list of Backups that match those selectors. func (c *FakeBackups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.BackupList, err error) { + emptyResult := &v1.BackupList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(backupsResource, backupsKind, opts), &v1.BackupList{}) + Invokes(testing.NewRootListActionWithOptions(backupsResource, backupsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeBackups) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested backups. func (c *FakeBackups) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(backupsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(backupsResource, opts)) } // Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any. func (c *FakeBackups) Create(ctx context.Context, backup *v1.Backup, opts metav1.CreateOptions) (result *v1.Backup, err error) { + emptyResult := &v1.Backup{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(backupsResource, backup), &v1.Backup{}) + Invokes(testing.NewRootCreateActionWithOptions(backupsResource, backup, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Backup), err } // Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any. func (c *FakeBackups) Update(ctx context.Context, backup *v1.Backup, opts metav1.UpdateOptions) (result *v1.Backup, err error) { + emptyResult := &v1.Backup{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(backupsResource, backup), &v1.Backup{}) + Invokes(testing.NewRootUpdateActionWithOptions(backupsResource, backup, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Backup), 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 *FakeBackups) UpdateStatus(ctx context.Context, backup *v1.Backup, opts metav1.UpdateOptions) (*v1.Backup, error) { +func (c *FakeBackups) UpdateStatus(ctx context.Context, backup *v1.Backup, opts metav1.UpdateOptions) (result *v1.Backup, err error) { + emptyResult := &v1.Backup{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(backupsResource, "status", backup), &v1.Backup{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(backupsResource, "status", backup, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Backup), err } @@ -99,7 +104,7 @@ func (c *FakeBackups) Delete(ctx context.Context, name string, opts metav1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeBackups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(backupsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(backupsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.BackupList{}) return err @@ -107,10 +112,11 @@ func (c *FakeBackups) DeleteCollection(ctx context.Context, opts metav1.DeleteOp // Patch applies the patch and returns the patched backup. func (c *FakeBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Backup, err error) { + emptyResult := &v1.Backup{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(backupsResource, name, pt, data, subresources...), &v1.Backup{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(backupsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Backup), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_cluster.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_cluster.go index 77c2c17..a478405 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_cluster.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_cluster.go @@ -24,20 +24,22 @@ var clustersKind = v1.SchemeGroupVersion.WithKind("Cluster") // Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. func (c *FakeClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Cluster, err error) { + emptyResult := &v1.Cluster{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clustersResource, name), &v1.Cluster{}) + Invokes(testing.NewRootGetActionWithOptions(clustersResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Cluster), err } // List takes label and field selectors, and returns the list of Clusters that match those selectors. func (c *FakeClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterList, err error) { + emptyResult := &v1.ClusterList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clustersResource, clustersKind, opts), &v1.ClusterList{}) + Invokes(testing.NewRootListActionWithOptions(clustersResource, clustersKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeClusters) List(ctx context.Context, opts metav1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested clusters. func (c *FakeClusters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clustersResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clustersResource, opts)) } // Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. func (c *FakeClusters) Create(ctx context.Context, cluster *v1.Cluster, opts metav1.CreateOptions) (result *v1.Cluster, err error) { + emptyResult := &v1.Cluster{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clustersResource, cluster), &v1.Cluster{}) + Invokes(testing.NewRootCreateActionWithOptions(clustersResource, cluster, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Cluster), err } // Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. func (c *FakeClusters) Update(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (result *v1.Cluster, err error) { + emptyResult := &v1.Cluster{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clustersResource, cluster), &v1.Cluster{}) + Invokes(testing.NewRootUpdateActionWithOptions(clustersResource, cluster, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Cluster), 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 *FakeClusters) UpdateStatus(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (*v1.Cluster, error) { +func (c *FakeClusters) UpdateStatus(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (result *v1.Cluster, err error) { + emptyResult := &v1.Cluster{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &v1.Cluster{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(clustersResource, "status", cluster, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Cluster), err } @@ -99,7 +104,7 @@ func (c *FakeClusters) Delete(ctx context.Context, name string, opts metav1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clustersResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clustersResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ClusterList{}) return err @@ -107,60 +112,66 @@ func (c *FakeClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteO // Patch applies the patch and returns the patched cluster. func (c *FakeClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Cluster, err error) { + emptyResult := &v1.Cluster{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustersResource, name, pt, data, subresources...), &v1.Cluster{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clustersResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Cluster), err } // ListAccess takes name of the cluster, and returns the corresponding clusterMemberAccess object, and an error if there is any. func (c *FakeClusters) ListAccess(ctx context.Context, clusterName string, options metav1.GetOptions) (result *v1.ClusterMemberAccess, err error) { + emptyResult := &v1.ClusterMemberAccess{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(clustersResource, "memberaccess", clusterName), &v1.ClusterMemberAccess{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(clustersResource, "memberaccess", clusterName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterMemberAccess), err } // ListMembers takes name of the cluster, and returns the corresponding clusterMembers object, and an error if there is any. func (c *FakeClusters) ListMembers(ctx context.Context, clusterName string, options metav1.GetOptions) (result *v1.ClusterMembers, err error) { + emptyResult := &v1.ClusterMembers{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(clustersResource, "members", clusterName), &v1.ClusterMembers{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(clustersResource, "members", clusterName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterMembers), err } // ListVirtualClusterDefaults takes name of the cluster, and returns the corresponding clusterVirtualClusterDefaults object, and an error if there is any. func (c *FakeClusters) ListVirtualClusterDefaults(ctx context.Context, clusterName string, options metav1.GetOptions) (result *v1.ClusterVirtualClusterDefaults, err error) { + emptyResult := &v1.ClusterVirtualClusterDefaults{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(clustersResource, "virtualclusterdefaults", clusterName), &v1.ClusterVirtualClusterDefaults{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(clustersResource, "virtualclusterdefaults", clusterName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterVirtualClusterDefaults), err } // GetAgentConfig takes name of the cluster, and returns the corresponding clusterAgentConfig object, and an error if there is any. func (c *FakeClusters) GetAgentConfig(ctx context.Context, clusterName string, options metav1.GetOptions) (result *v1.ClusterAgentConfig, err error) { + emptyResult := &v1.ClusterAgentConfig{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(clustersResource, "agentconfig", clusterName), &v1.ClusterAgentConfig{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(clustersResource, "agentconfig", clusterName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterAgentConfig), err } // GetAccessKey takes name of the cluster, and returns the corresponding clusterAccessKey object, and an error if there is any. func (c *FakeClusters) GetAccessKey(ctx context.Context, clusterName string, options metav1.GetOptions) (result *v1.ClusterAccessKey, err error) { + emptyResult := &v1.ClusterAccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(clustersResource, "accesskey", clusterName), &v1.ClusterAccessKey{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(clustersResource, "accesskey", clusterName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterAccessKey), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_clusteraccess.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_clusteraccess.go index 835d72b..3d72514 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_clusteraccess.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_clusteraccess.go @@ -24,20 +24,22 @@ var clusteraccessesKind = v1.SchemeGroupVersion.WithKind("ClusterAccess") // Get takes name of the clusterAccess, and returns the corresponding clusterAccess object, and an error if there is any. func (c *FakeClusterAccesses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterAccess, err error) { + emptyResult := &v1.ClusterAccess{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusteraccessesResource, name), &v1.ClusterAccess{}) + Invokes(testing.NewRootGetActionWithOptions(clusteraccessesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterAccess), err } // List takes label and field selectors, and returns the list of ClusterAccesses that match those selectors. func (c *FakeClusterAccesses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterAccessList, err error) { + emptyResult := &v1.ClusterAccessList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusteraccessesResource, clusteraccessesKind, opts), &v1.ClusterAccessList{}) + Invokes(testing.NewRootListActionWithOptions(clusteraccessesResource, clusteraccessesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeClusterAccesses) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested clusterAccesses. func (c *FakeClusterAccesses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusteraccessesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clusteraccessesResource, opts)) } // Create takes the representation of a clusterAccess and creates it. Returns the server's representation of the clusterAccess, and an error, if there is any. func (c *FakeClusterAccesses) Create(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.CreateOptions) (result *v1.ClusterAccess, err error) { + emptyResult := &v1.ClusterAccess{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusteraccessesResource, clusterAccess), &v1.ClusterAccess{}) + Invokes(testing.NewRootCreateActionWithOptions(clusteraccessesResource, clusterAccess, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterAccess), err } // Update takes the representation of a clusterAccess and updates it. Returns the server's representation of the clusterAccess, and an error, if there is any. func (c *FakeClusterAccesses) Update(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (result *v1.ClusterAccess, err error) { + emptyResult := &v1.ClusterAccess{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusteraccessesResource, clusterAccess), &v1.ClusterAccess{}) + Invokes(testing.NewRootUpdateActionWithOptions(clusteraccessesResource, clusterAccess, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterAccess), 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 *FakeClusterAccesses) UpdateStatus(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (*v1.ClusterAccess, error) { +func (c *FakeClusterAccesses) UpdateStatus(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (result *v1.ClusterAccess, err error) { + emptyResult := &v1.ClusterAccess{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clusteraccessesResource, "status", clusterAccess), &v1.ClusterAccess{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(clusteraccessesResource, "status", clusterAccess, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterAccess), err } @@ -99,7 +104,7 @@ func (c *FakeClusterAccesses) Delete(ctx context.Context, name string, opts meta // DeleteCollection deletes a collection of objects. func (c *FakeClusterAccesses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusteraccessesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clusteraccessesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ClusterAccessList{}) return err @@ -107,10 +112,11 @@ func (c *FakeClusterAccesses) DeleteCollection(ctx context.Context, opts metav1. // Patch applies the patch and returns the patched clusterAccess. func (c *FakeClusterAccesses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterAccess, err error) { + emptyResult := &v1.ClusterAccess{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusteraccessesResource, name, pt, data, subresources...), &v1.ClusterAccess{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusteraccessesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterAccess), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_clusterroletemplate.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_clusterroletemplate.go index 411bed5..b5969d8 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_clusterroletemplate.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_clusterroletemplate.go @@ -24,20 +24,22 @@ var clusterroletemplatesKind = v1.SchemeGroupVersion.WithKind("ClusterRoleTempla // Get takes name of the clusterRoleTemplate, and returns the corresponding clusterRoleTemplate object, and an error if there is any. func (c *FakeClusterRoleTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRoleTemplate, err error) { + emptyResult := &v1.ClusterRoleTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterroletemplatesResource, name), &v1.ClusterRoleTemplate{}) + Invokes(testing.NewRootGetActionWithOptions(clusterroletemplatesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleTemplate), err } // List takes label and field selectors, and returns the list of ClusterRoleTemplates that match those selectors. func (c *FakeClusterRoleTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleTemplateList, err error) { + emptyResult := &v1.ClusterRoleTemplateList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterroletemplatesResource, clusterroletemplatesKind, opts), &v1.ClusterRoleTemplateList{}) + Invokes(testing.NewRootListActionWithOptions(clusterroletemplatesResource, clusterroletemplatesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeClusterRoleTemplates) List(ctx context.Context, opts metav1.ListOpt // Watch returns a watch.Interface that watches the requested clusterRoleTemplates. func (c *FakeClusterRoleTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusterroletemplatesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clusterroletemplatesResource, opts)) } // Create takes the representation of a clusterRoleTemplate and creates it. Returns the server's representation of the clusterRoleTemplate, and an error, if there is any. func (c *FakeClusterRoleTemplates) Create(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.CreateOptions) (result *v1.ClusterRoleTemplate, err error) { + emptyResult := &v1.ClusterRoleTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterroletemplatesResource, clusterRoleTemplate), &v1.ClusterRoleTemplate{}) + Invokes(testing.NewRootCreateActionWithOptions(clusterroletemplatesResource, clusterRoleTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleTemplate), err } // Update takes the representation of a clusterRoleTemplate and updates it. Returns the server's representation of the clusterRoleTemplate, and an error, if there is any. func (c *FakeClusterRoleTemplates) Update(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (result *v1.ClusterRoleTemplate, err error) { + emptyResult := &v1.ClusterRoleTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterroletemplatesResource, clusterRoleTemplate), &v1.ClusterRoleTemplate{}) + Invokes(testing.NewRootUpdateActionWithOptions(clusterroletemplatesResource, clusterRoleTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleTemplate), 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 *FakeClusterRoleTemplates) UpdateStatus(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (*v1.ClusterRoleTemplate, error) { +func (c *FakeClusterRoleTemplates) UpdateStatus(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (result *v1.ClusterRoleTemplate, err error) { + emptyResult := &v1.ClusterRoleTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clusterroletemplatesResource, "status", clusterRoleTemplate), &v1.ClusterRoleTemplate{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(clusterroletemplatesResource, "status", clusterRoleTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleTemplate), err } @@ -99,7 +104,7 @@ func (c *FakeClusterRoleTemplates) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoleTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterroletemplatesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clusterroletemplatesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ClusterRoleTemplateList{}) return err @@ -107,10 +112,11 @@ func (c *FakeClusterRoleTemplates) DeleteCollection(ctx context.Context, opts me // Patch applies the patch and returns the patched clusterRoleTemplate. func (c *FakeClusterRoleTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleTemplate, err error) { + emptyResult := &v1.ClusterRoleTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterroletemplatesResource, name, pt, data, subresources...), &v1.ClusterRoleTemplate{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterroletemplatesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleTemplate), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_config.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_config.go index a7c8601..0e242c1 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_config.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_config.go @@ -24,20 +24,22 @@ var configsKind = v1.SchemeGroupVersion.WithKind("Config") // Get takes name of the config, and returns the corresponding config object, and an error if there is any. func (c *FakeConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Config, err error) { + emptyResult := &v1.Config{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(configsResource, name), &v1.Config{}) + Invokes(testing.NewRootGetActionWithOptions(configsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Config), err } // List takes label and field selectors, and returns the list of Configs that match those selectors. func (c *FakeConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigList, err error) { + emptyResult := &v1.ConfigList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(configsResource, configsKind, opts), &v1.ConfigList{}) + Invokes(testing.NewRootListActionWithOptions(configsResource, configsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeConfigs) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested configs. func (c *FakeConfigs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(configsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(configsResource, opts)) } // Create takes the representation of a config and creates it. Returns the server's representation of the config, and an error, if there is any. func (c *FakeConfigs) Create(ctx context.Context, config *v1.Config, opts metav1.CreateOptions) (result *v1.Config, err error) { + emptyResult := &v1.Config{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(configsResource, config), &v1.Config{}) + Invokes(testing.NewRootCreateActionWithOptions(configsResource, config, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Config), err } // Update takes the representation of a config and updates it. Returns the server's representation of the config, and an error, if there is any. func (c *FakeConfigs) Update(ctx context.Context, config *v1.Config, opts metav1.UpdateOptions) (result *v1.Config, err error) { + emptyResult := &v1.Config{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(configsResource, config), &v1.Config{}) + Invokes(testing.NewRootUpdateActionWithOptions(configsResource, config, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Config), 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 *FakeConfigs) UpdateStatus(ctx context.Context, config *v1.Config, opts metav1.UpdateOptions) (*v1.Config, error) { +func (c *FakeConfigs) UpdateStatus(ctx context.Context, config *v1.Config, opts metav1.UpdateOptions) (result *v1.Config, err error) { + emptyResult := &v1.Config{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(configsResource, "status", config), &v1.Config{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(configsResource, "status", config, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Config), err } @@ -99,7 +104,7 @@ func (c *FakeConfigs) Delete(ctx context.Context, name string, opts metav1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(configsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(configsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ConfigList{}) return err @@ -107,10 +112,11 @@ func (c *FakeConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOp // Patch applies the patch and returns the patched config. func (c *FakeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Config, err error) { + emptyResult := &v1.Config{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(configsResource, name, pt, data, subresources...), &v1.Config{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(configsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Config), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_convertvirtualclusterconfig.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_convertvirtualclusterconfig.go index c4718ca..b51d9c8 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_convertvirtualclusterconfig.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_convertvirtualclusterconfig.go @@ -24,20 +24,22 @@ var convertvirtualclusterconfigsKind = v1.SchemeGroupVersion.WithKind("ConvertVi // Get takes name of the convertVirtualClusterConfig, and returns the corresponding convertVirtualClusterConfig object, and an error if there is any. func (c *FakeConvertVirtualClusterConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ConvertVirtualClusterConfig, err error) { + emptyResult := &v1.ConvertVirtualClusterConfig{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(convertvirtualclusterconfigsResource, name), &v1.ConvertVirtualClusterConfig{}) + Invokes(testing.NewRootGetActionWithOptions(convertvirtualclusterconfigsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ConvertVirtualClusterConfig), err } // List takes label and field selectors, and returns the list of ConvertVirtualClusterConfigs that match those selectors. func (c *FakeConvertVirtualClusterConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConvertVirtualClusterConfigList, err error) { + emptyResult := &v1.ConvertVirtualClusterConfigList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(convertvirtualclusterconfigsResource, convertvirtualclusterconfigsKind, opts), &v1.ConvertVirtualClusterConfigList{}) + Invokes(testing.NewRootListActionWithOptions(convertvirtualclusterconfigsResource, convertvirtualclusterconfigsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeConvertVirtualClusterConfigs) List(ctx context.Context, opts metav1 // Watch returns a watch.Interface that watches the requested convertVirtualClusterConfigs. func (c *FakeConvertVirtualClusterConfigs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(convertvirtualclusterconfigsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(convertvirtualclusterconfigsResource, opts)) } // Create takes the representation of a convertVirtualClusterConfig and creates it. Returns the server's representation of the convertVirtualClusterConfig, and an error, if there is any. func (c *FakeConvertVirtualClusterConfigs) Create(ctx context.Context, convertVirtualClusterConfig *v1.ConvertVirtualClusterConfig, opts metav1.CreateOptions) (result *v1.ConvertVirtualClusterConfig, err error) { + emptyResult := &v1.ConvertVirtualClusterConfig{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(convertvirtualclusterconfigsResource, convertVirtualClusterConfig), &v1.ConvertVirtualClusterConfig{}) + Invokes(testing.NewRootCreateActionWithOptions(convertvirtualclusterconfigsResource, convertVirtualClusterConfig, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ConvertVirtualClusterConfig), err } // Update takes the representation of a convertVirtualClusterConfig and updates it. Returns the server's representation of the convertVirtualClusterConfig, and an error, if there is any. func (c *FakeConvertVirtualClusterConfigs) Update(ctx context.Context, convertVirtualClusterConfig *v1.ConvertVirtualClusterConfig, opts metav1.UpdateOptions) (result *v1.ConvertVirtualClusterConfig, err error) { + emptyResult := &v1.ConvertVirtualClusterConfig{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(convertvirtualclusterconfigsResource, convertVirtualClusterConfig), &v1.ConvertVirtualClusterConfig{}) + Invokes(testing.NewRootUpdateActionWithOptions(convertvirtualclusterconfigsResource, convertVirtualClusterConfig, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ConvertVirtualClusterConfig), 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 *FakeConvertVirtualClusterConfigs) UpdateStatus(ctx context.Context, convertVirtualClusterConfig *v1.ConvertVirtualClusterConfig, opts metav1.UpdateOptions) (*v1.ConvertVirtualClusterConfig, error) { +func (c *FakeConvertVirtualClusterConfigs) UpdateStatus(ctx context.Context, convertVirtualClusterConfig *v1.ConvertVirtualClusterConfig, opts metav1.UpdateOptions) (result *v1.ConvertVirtualClusterConfig, err error) { + emptyResult := &v1.ConvertVirtualClusterConfig{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(convertvirtualclusterconfigsResource, "status", convertVirtualClusterConfig), &v1.ConvertVirtualClusterConfig{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(convertvirtualclusterconfigsResource, "status", convertVirtualClusterConfig, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ConvertVirtualClusterConfig), err } @@ -99,7 +104,7 @@ func (c *FakeConvertVirtualClusterConfigs) Delete(ctx context.Context, name stri // DeleteCollection deletes a collection of objects. func (c *FakeConvertVirtualClusterConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(convertvirtualclusterconfigsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(convertvirtualclusterconfigsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ConvertVirtualClusterConfigList{}) return err @@ -107,10 +112,11 @@ func (c *FakeConvertVirtualClusterConfigs) DeleteCollection(ctx context.Context, // Patch applies the patch and returns the patched convertVirtualClusterConfig. func (c *FakeConvertVirtualClusterConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConvertVirtualClusterConfig, err error) { + emptyResult := &v1.ConvertVirtualClusterConfig{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(convertvirtualclusterconfigsResource, name, pt, data, subresources...), &v1.ConvertVirtualClusterConfig{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(convertvirtualclusterconfigsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ConvertVirtualClusterConfig), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodenvironmenttemplate.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodenvironmenttemplate.go index 7c8633c..6514ba8 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodenvironmenttemplate.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodenvironmenttemplate.go @@ -24,20 +24,22 @@ var devpodenvironmenttemplatesKind = v1.SchemeGroupVersion.WithKind("DevPodEnvir // Get takes name of the devPodEnvironmentTemplate, and returns the corresponding devPodEnvironmentTemplate object, and an error if there is any. func (c *FakeDevPodEnvironmentTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodEnvironmentTemplate, err error) { + emptyResult := &v1.DevPodEnvironmentTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(devpodenvironmenttemplatesResource, name), &v1.DevPodEnvironmentTemplate{}) + Invokes(testing.NewRootGetActionWithOptions(devpodenvironmenttemplatesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodEnvironmentTemplate), err } // List takes label and field selectors, and returns the list of DevPodEnvironmentTemplates that match those selectors. func (c *FakeDevPodEnvironmentTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodEnvironmentTemplateList, err error) { + emptyResult := &v1.DevPodEnvironmentTemplateList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(devpodenvironmenttemplatesResource, devpodenvironmenttemplatesKind, opts), &v1.DevPodEnvironmentTemplateList{}) + Invokes(testing.NewRootListActionWithOptions(devpodenvironmenttemplatesResource, devpodenvironmenttemplatesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,25 +58,27 @@ func (c *FakeDevPodEnvironmentTemplates) List(ctx context.Context, opts metav1.L // Watch returns a watch.Interface that watches the requested devPodEnvironmentTemplates. func (c *FakeDevPodEnvironmentTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(devpodenvironmenttemplatesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(devpodenvironmenttemplatesResource, opts)) } // Create takes the representation of a devPodEnvironmentTemplate and creates it. Returns the server's representation of the devPodEnvironmentTemplate, and an error, if there is any. func (c *FakeDevPodEnvironmentTemplates) Create(ctx context.Context, devPodEnvironmentTemplate *v1.DevPodEnvironmentTemplate, opts metav1.CreateOptions) (result *v1.DevPodEnvironmentTemplate, err error) { + emptyResult := &v1.DevPodEnvironmentTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(devpodenvironmenttemplatesResource, devPodEnvironmentTemplate), &v1.DevPodEnvironmentTemplate{}) + Invokes(testing.NewRootCreateActionWithOptions(devpodenvironmenttemplatesResource, devPodEnvironmentTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodEnvironmentTemplate), err } // Update takes the representation of a devPodEnvironmentTemplate and updates it. Returns the server's representation of the devPodEnvironmentTemplate, and an error, if there is any. func (c *FakeDevPodEnvironmentTemplates) Update(ctx context.Context, devPodEnvironmentTemplate *v1.DevPodEnvironmentTemplate, opts metav1.UpdateOptions) (result *v1.DevPodEnvironmentTemplate, err error) { + emptyResult := &v1.DevPodEnvironmentTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(devpodenvironmenttemplatesResource, devPodEnvironmentTemplate), &v1.DevPodEnvironmentTemplate{}) + Invokes(testing.NewRootUpdateActionWithOptions(devpodenvironmenttemplatesResource, devPodEnvironmentTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodEnvironmentTemplate), err } @@ -88,7 +92,7 @@ func (c *FakeDevPodEnvironmentTemplates) Delete(ctx context.Context, name string // DeleteCollection deletes a collection of objects. func (c *FakeDevPodEnvironmentTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(devpodenvironmenttemplatesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(devpodenvironmenttemplatesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.DevPodEnvironmentTemplateList{}) return err @@ -96,10 +100,11 @@ func (c *FakeDevPodEnvironmentTemplates) DeleteCollection(ctx context.Context, o // Patch applies the patch and returns the patched devPodEnvironmentTemplate. func (c *FakeDevPodEnvironmentTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodEnvironmentTemplate, err error) { + emptyResult := &v1.DevPodEnvironmentTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(devpodenvironmenttemplatesResource, name, pt, data, subresources...), &v1.DevPodEnvironmentTemplate{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(devpodenvironmenttemplatesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodEnvironmentTemplate), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspaceinstance.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspaceinstance.go index 592454f..759bff6 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspaceinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspaceinstance.go @@ -25,22 +25,24 @@ var devpodworkspaceinstancesKind = v1.SchemeGroupVersion.WithKind("DevPodWorkspa // Get takes name of the devPodWorkspaceInstance, and returns the corresponding devPodWorkspaceInstance object, and an error if there is any. func (c *FakeDevPodWorkspaceInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodWorkspaceInstance, err error) { + emptyResult := &v1.DevPodWorkspaceInstance{} obj, err := c.Fake. - Invokes(testing.NewGetAction(devpodworkspaceinstancesResource, c.ns, name), &v1.DevPodWorkspaceInstance{}) + Invokes(testing.NewGetActionWithOptions(devpodworkspaceinstancesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceInstance), err } // List takes label and field selectors, and returns the list of DevPodWorkspaceInstances that match those selectors. func (c *FakeDevPodWorkspaceInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodWorkspaceInstanceList, err error) { + emptyResult := &v1.DevPodWorkspaceInstanceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(devpodworkspaceinstancesResource, devpodworkspaceinstancesKind, c.ns, opts), &v1.DevPodWorkspaceInstanceList{}) + Invokes(testing.NewListActionWithOptions(devpodworkspaceinstancesResource, devpodworkspaceinstancesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,28 +61,30 @@ func (c *FakeDevPodWorkspaceInstances) List(ctx context.Context, opts metav1.Lis // Watch returns a watch.Interface that watches the requested devPodWorkspaceInstances. func (c *FakeDevPodWorkspaceInstances) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(devpodworkspaceinstancesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(devpodworkspaceinstancesResource, c.ns, opts)) } // Create takes the representation of a devPodWorkspaceInstance and creates it. Returns the server's representation of the devPodWorkspaceInstance, and an error, if there is any. func (c *FakeDevPodWorkspaceInstances) Create(ctx context.Context, devPodWorkspaceInstance *v1.DevPodWorkspaceInstance, opts metav1.CreateOptions) (result *v1.DevPodWorkspaceInstance, err error) { + emptyResult := &v1.DevPodWorkspaceInstance{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(devpodworkspaceinstancesResource, c.ns, devPodWorkspaceInstance), &v1.DevPodWorkspaceInstance{}) + Invokes(testing.NewCreateActionWithOptions(devpodworkspaceinstancesResource, c.ns, devPodWorkspaceInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceInstance), err } // Update takes the representation of a devPodWorkspaceInstance and updates it. Returns the server's representation of the devPodWorkspaceInstance, and an error, if there is any. func (c *FakeDevPodWorkspaceInstances) Update(ctx context.Context, devPodWorkspaceInstance *v1.DevPodWorkspaceInstance, opts metav1.UpdateOptions) (result *v1.DevPodWorkspaceInstance, err error) { + emptyResult := &v1.DevPodWorkspaceInstance{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(devpodworkspaceinstancesResource, c.ns, devPodWorkspaceInstance), &v1.DevPodWorkspaceInstance{}) + Invokes(testing.NewUpdateActionWithOptions(devpodworkspaceinstancesResource, c.ns, devPodWorkspaceInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceInstance), err } @@ -95,7 +99,7 @@ func (c *FakeDevPodWorkspaceInstances) Delete(ctx context.Context, name string, // DeleteCollection deletes a collection of objects. func (c *FakeDevPodWorkspaceInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(devpodworkspaceinstancesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(devpodworkspaceinstancesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.DevPodWorkspaceInstanceList{}) return err @@ -103,33 +107,36 @@ func (c *FakeDevPodWorkspaceInstances) DeleteCollection(ctx context.Context, opt // Patch applies the patch and returns the patched devPodWorkspaceInstance. func (c *FakeDevPodWorkspaceInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspaceInstance, err error) { + emptyResult := &v1.DevPodWorkspaceInstance{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(devpodworkspaceinstancesResource, c.ns, name, pt, data, subresources...), &v1.DevPodWorkspaceInstance{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(devpodworkspaceinstancesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceInstance), err } // GetState takes name of the devPodWorkspaceInstance, and returns the corresponding devPodWorkspaceInstanceState object, and an error if there is any. func (c *FakeDevPodWorkspaceInstances) GetState(ctx context.Context, devPodWorkspaceInstanceName string, options metav1.GetOptions) (result *v1.DevPodWorkspaceInstanceState, err error) { + emptyResult := &v1.DevPodWorkspaceInstanceState{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(devpodworkspaceinstancesResource, c.ns, "state", devPodWorkspaceInstanceName), &v1.DevPodWorkspaceInstanceState{}) + Invokes(testing.NewGetSubresourceActionWithOptions(devpodworkspaceinstancesResource, c.ns, "state", devPodWorkspaceInstanceName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceInstanceState), err } // SetState takes the representation of a devPodWorkspaceInstanceState and creates it. Returns the server's representation of the devPodWorkspaceInstanceState, and an error, if there is any. func (c *FakeDevPodWorkspaceInstances) SetState(ctx context.Context, devPodWorkspaceInstanceName string, devPodWorkspaceInstanceState *v1.DevPodWorkspaceInstanceState, opts metav1.CreateOptions) (result *v1.DevPodWorkspaceInstanceState, err error) { + emptyResult := &v1.DevPodWorkspaceInstanceState{} obj, err := c.Fake. - Invokes(testing.NewCreateSubresourceAction(devpodworkspaceinstancesResource, devPodWorkspaceInstanceName, "state", c.ns, devPodWorkspaceInstanceState), &v1.DevPodWorkspaceInstanceState{}) + Invokes(testing.NewCreateSubresourceActionWithOptions(devpodworkspaceinstancesResource, devPodWorkspaceInstanceName, "state", c.ns, devPodWorkspaceInstanceState, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceInstanceState), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspacetemplate.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspacetemplate.go index b66c08f..cb98add 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspacetemplate.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspacetemplate.go @@ -24,20 +24,22 @@ var devpodworkspacetemplatesKind = v1.SchemeGroupVersion.WithKind("DevPodWorkspa // Get takes name of the devPodWorkspaceTemplate, and returns the corresponding devPodWorkspaceTemplate object, and an error if there is any. func (c *FakeDevPodWorkspaceTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodWorkspaceTemplate, err error) { + emptyResult := &v1.DevPodWorkspaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(devpodworkspacetemplatesResource, name), &v1.DevPodWorkspaceTemplate{}) + Invokes(testing.NewRootGetActionWithOptions(devpodworkspacetemplatesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceTemplate), err } // List takes label and field selectors, and returns the list of DevPodWorkspaceTemplates that match those selectors. func (c *FakeDevPodWorkspaceTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodWorkspaceTemplateList, err error) { + emptyResult := &v1.DevPodWorkspaceTemplateList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(devpodworkspacetemplatesResource, devpodworkspacetemplatesKind, opts), &v1.DevPodWorkspaceTemplateList{}) + Invokes(testing.NewRootListActionWithOptions(devpodworkspacetemplatesResource, devpodworkspacetemplatesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeDevPodWorkspaceTemplates) List(ctx context.Context, opts metav1.Lis // Watch returns a watch.Interface that watches the requested devPodWorkspaceTemplates. func (c *FakeDevPodWorkspaceTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(devpodworkspacetemplatesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(devpodworkspacetemplatesResource, opts)) } // Create takes the representation of a devPodWorkspaceTemplate and creates it. Returns the server's representation of the devPodWorkspaceTemplate, and an error, if there is any. func (c *FakeDevPodWorkspaceTemplates) Create(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.CreateOptions) (result *v1.DevPodWorkspaceTemplate, err error) { + emptyResult := &v1.DevPodWorkspaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(devpodworkspacetemplatesResource, devPodWorkspaceTemplate), &v1.DevPodWorkspaceTemplate{}) + Invokes(testing.NewRootCreateActionWithOptions(devpodworkspacetemplatesResource, devPodWorkspaceTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceTemplate), err } // Update takes the representation of a devPodWorkspaceTemplate and updates it. Returns the server's representation of the devPodWorkspaceTemplate, and an error, if there is any. func (c *FakeDevPodWorkspaceTemplates) Update(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (result *v1.DevPodWorkspaceTemplate, err error) { + emptyResult := &v1.DevPodWorkspaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(devpodworkspacetemplatesResource, devPodWorkspaceTemplate), &v1.DevPodWorkspaceTemplate{}) + Invokes(testing.NewRootUpdateActionWithOptions(devpodworkspacetemplatesResource, devPodWorkspaceTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceTemplate), 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 *FakeDevPodWorkspaceTemplates) UpdateStatus(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (*v1.DevPodWorkspaceTemplate, error) { +func (c *FakeDevPodWorkspaceTemplates) UpdateStatus(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (result *v1.DevPodWorkspaceTemplate, err error) { + emptyResult := &v1.DevPodWorkspaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(devpodworkspacetemplatesResource, "status", devPodWorkspaceTemplate), &v1.DevPodWorkspaceTemplate{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(devpodworkspacetemplatesResource, "status", devPodWorkspaceTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceTemplate), err } @@ -99,7 +104,7 @@ func (c *FakeDevPodWorkspaceTemplates) Delete(ctx context.Context, name string, // DeleteCollection deletes a collection of objects. func (c *FakeDevPodWorkspaceTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(devpodworkspacetemplatesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(devpodworkspacetemplatesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.DevPodWorkspaceTemplateList{}) return err @@ -107,10 +112,11 @@ func (c *FakeDevPodWorkspaceTemplates) DeleteCollection(ctx context.Context, opt // Patch applies the patch and returns the patched devPodWorkspaceTemplate. func (c *FakeDevPodWorkspaceTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspaceTemplate, err error) { + emptyResult := &v1.DevPodWorkspaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(devpodworkspacetemplatesResource, name, pt, data, subresources...), &v1.DevPodWorkspaceTemplate{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(devpodworkspacetemplatesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceTemplate), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_directclusterendpointtoken.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_directclusterendpointtoken.go index fc4b448..1d24adc 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_directclusterendpointtoken.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_directclusterendpointtoken.go @@ -24,20 +24,22 @@ var directclusterendpointtokensKind = v1.SchemeGroupVersion.WithKind("DirectClus // Get takes name of the directClusterEndpointToken, and returns the corresponding directClusterEndpointToken object, and an error if there is any. func (c *FakeDirectClusterEndpointTokens) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DirectClusterEndpointToken, err error) { + emptyResult := &v1.DirectClusterEndpointToken{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(directclusterendpointtokensResource, name), &v1.DirectClusterEndpointToken{}) + Invokes(testing.NewRootGetActionWithOptions(directclusterendpointtokensResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DirectClusterEndpointToken), err } // List takes label and field selectors, and returns the list of DirectClusterEndpointTokens that match those selectors. func (c *FakeDirectClusterEndpointTokens) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DirectClusterEndpointTokenList, err error) { + emptyResult := &v1.DirectClusterEndpointTokenList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(directclusterendpointtokensResource, directclusterendpointtokensKind, opts), &v1.DirectClusterEndpointTokenList{}) + Invokes(testing.NewRootListActionWithOptions(directclusterendpointtokensResource, directclusterendpointtokensKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeDirectClusterEndpointTokens) List(ctx context.Context, opts metav1. // Watch returns a watch.Interface that watches the requested directClusterEndpointTokens. func (c *FakeDirectClusterEndpointTokens) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(directclusterendpointtokensResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(directclusterendpointtokensResource, opts)) } // Create takes the representation of a directClusterEndpointToken and creates it. Returns the server's representation of the directClusterEndpointToken, and an error, if there is any. func (c *FakeDirectClusterEndpointTokens) Create(ctx context.Context, directClusterEndpointToken *v1.DirectClusterEndpointToken, opts metav1.CreateOptions) (result *v1.DirectClusterEndpointToken, err error) { + emptyResult := &v1.DirectClusterEndpointToken{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(directclusterendpointtokensResource, directClusterEndpointToken), &v1.DirectClusterEndpointToken{}) + Invokes(testing.NewRootCreateActionWithOptions(directclusterendpointtokensResource, directClusterEndpointToken, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DirectClusterEndpointToken), err } // Update takes the representation of a directClusterEndpointToken and updates it. Returns the server's representation of the directClusterEndpointToken, and an error, if there is any. func (c *FakeDirectClusterEndpointTokens) Update(ctx context.Context, directClusterEndpointToken *v1.DirectClusterEndpointToken, opts metav1.UpdateOptions) (result *v1.DirectClusterEndpointToken, err error) { + emptyResult := &v1.DirectClusterEndpointToken{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(directclusterendpointtokensResource, directClusterEndpointToken), &v1.DirectClusterEndpointToken{}) + Invokes(testing.NewRootUpdateActionWithOptions(directclusterendpointtokensResource, directClusterEndpointToken, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DirectClusterEndpointToken), 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 *FakeDirectClusterEndpointTokens) UpdateStatus(ctx context.Context, directClusterEndpointToken *v1.DirectClusterEndpointToken, opts metav1.UpdateOptions) (*v1.DirectClusterEndpointToken, error) { +func (c *FakeDirectClusterEndpointTokens) UpdateStatus(ctx context.Context, directClusterEndpointToken *v1.DirectClusterEndpointToken, opts metav1.UpdateOptions) (result *v1.DirectClusterEndpointToken, err error) { + emptyResult := &v1.DirectClusterEndpointToken{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(directclusterendpointtokensResource, "status", directClusterEndpointToken), &v1.DirectClusterEndpointToken{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(directclusterendpointtokensResource, "status", directClusterEndpointToken, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DirectClusterEndpointToken), err } @@ -99,7 +104,7 @@ func (c *FakeDirectClusterEndpointTokens) Delete(ctx context.Context, name strin // DeleteCollection deletes a collection of objects. func (c *FakeDirectClusterEndpointTokens) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(directclusterendpointtokensResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(directclusterendpointtokensResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.DirectClusterEndpointTokenList{}) return err @@ -107,10 +112,11 @@ func (c *FakeDirectClusterEndpointTokens) DeleteCollection(ctx context.Context, // Patch applies the patch and returns the patched directClusterEndpointToken. func (c *FakeDirectClusterEndpointTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DirectClusterEndpointToken, err error) { + emptyResult := &v1.DirectClusterEndpointToken{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(directclusterendpointtokensResource, name, pt, data, subresources...), &v1.DirectClusterEndpointToken{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(directclusterendpointtokensResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DirectClusterEndpointToken), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_event.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_event.go index bc31e97..7527620 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_event.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_event.go @@ -24,20 +24,22 @@ var eventsKind = v1.SchemeGroupVersion.WithKind("Event") // Get takes name of the event, and returns the corresponding event object, and an error if there is any. func (c *FakeEvents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(eventsResource, name), &v1.Event{}) + Invokes(testing.NewRootGetActionWithOptions(eventsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { + emptyResult := &v1.EventList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(eventsResource, eventsKind, opts), &v1.EventList{}) + Invokes(testing.NewRootListActionWithOptions(eventsResource, eventsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested events. func (c *FakeEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(eventsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(eventsResource, opts)) } // Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(eventsResource, event), &v1.Event{}) + Invokes(testing.NewRootCreateActionWithOptions(eventsResource, event, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } // Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(eventsResource, event), &v1.Event{}) + Invokes(testing.NewRootUpdateActionWithOptions(eventsResource, event, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), 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 *FakeEvents) UpdateStatus(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (*v1.Event, error) { +func (c *FakeEvents) UpdateStatus(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(eventsResource, "status", event), &v1.Event{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(eventsResource, "status", event, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } @@ -99,7 +104,7 @@ func (c *FakeEvents) Delete(ctx context.Context, name string, opts metav1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(eventsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(eventsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.EventList{}) return err @@ -107,10 +112,11 @@ func (c *FakeEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt // Patch applies the patch and returns the patched event. func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(eventsResource, name, pt, data, subresources...), &v1.Event{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(eventsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_feature.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_feature.go index 913693a..4073d36 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_feature.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_feature.go @@ -24,20 +24,22 @@ var featuresKind = v1.SchemeGroupVersion.WithKind("Feature") // Get takes name of the feature, and returns the corresponding feature object, and an error if there is any. func (c *FakeFeatures) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Feature, err error) { + emptyResult := &v1.Feature{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(featuresResource, name), &v1.Feature{}) + Invokes(testing.NewRootGetActionWithOptions(featuresResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Feature), err } // List takes label and field selectors, and returns the list of Features that match those selectors. func (c *FakeFeatures) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FeatureList, err error) { + emptyResult := &v1.FeatureList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(featuresResource, featuresKind, opts), &v1.FeatureList{}) + Invokes(testing.NewRootListActionWithOptions(featuresResource, featuresKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeFeatures) List(ctx context.Context, opts metav1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested features. func (c *FakeFeatures) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(featuresResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(featuresResource, opts)) } // Create takes the representation of a feature and creates it. Returns the server's representation of the feature, and an error, if there is any. func (c *FakeFeatures) Create(ctx context.Context, feature *v1.Feature, opts metav1.CreateOptions) (result *v1.Feature, err error) { + emptyResult := &v1.Feature{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(featuresResource, feature), &v1.Feature{}) + Invokes(testing.NewRootCreateActionWithOptions(featuresResource, feature, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Feature), err } // Update takes the representation of a feature and updates it. Returns the server's representation of the feature, and an error, if there is any. func (c *FakeFeatures) Update(ctx context.Context, feature *v1.Feature, opts metav1.UpdateOptions) (result *v1.Feature, err error) { + emptyResult := &v1.Feature{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(featuresResource, feature), &v1.Feature{}) + Invokes(testing.NewRootUpdateActionWithOptions(featuresResource, feature, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Feature), 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 *FakeFeatures) UpdateStatus(ctx context.Context, feature *v1.Feature, opts metav1.UpdateOptions) (*v1.Feature, error) { +func (c *FakeFeatures) UpdateStatus(ctx context.Context, feature *v1.Feature, opts metav1.UpdateOptions) (result *v1.Feature, err error) { + emptyResult := &v1.Feature{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(featuresResource, "status", feature), &v1.Feature{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(featuresResource, "status", feature, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Feature), err } @@ -99,7 +104,7 @@ func (c *FakeFeatures) Delete(ctx context.Context, name string, opts metav1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeFeatures) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(featuresResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(featuresResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.FeatureList{}) return err @@ -107,10 +112,11 @@ func (c *FakeFeatures) DeleteCollection(ctx context.Context, opts metav1.DeleteO // Patch applies the patch and returns the patched feature. func (c *FakeFeatures) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Feature, err error) { + emptyResult := &v1.Feature{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(featuresResource, name, pt, data, subresources...), &v1.Feature{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(featuresResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Feature), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_ingressauthtoken.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_ingressauthtoken.go index 312f138..2b3f70e 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_ingressauthtoken.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_ingressauthtoken.go @@ -24,20 +24,22 @@ var ingressauthtokensKind = v1.SchemeGroupVersion.WithKind("IngressAuthToken") // Get takes name of the ingressAuthToken, and returns the corresponding ingressAuthToken object, and an error if there is any. func (c *FakeIngressAuthTokens) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IngressAuthToken, err error) { + emptyResult := &v1.IngressAuthToken{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(ingressauthtokensResource, name), &v1.IngressAuthToken{}) + Invokes(testing.NewRootGetActionWithOptions(ingressauthtokensResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.IngressAuthToken), err } // List takes label and field selectors, and returns the list of IngressAuthTokens that match those selectors. func (c *FakeIngressAuthTokens) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressAuthTokenList, err error) { + emptyResult := &v1.IngressAuthTokenList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(ingressauthtokensResource, ingressauthtokensKind, opts), &v1.IngressAuthTokenList{}) + Invokes(testing.NewRootListActionWithOptions(ingressauthtokensResource, ingressauthtokensKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeIngressAuthTokens) List(ctx context.Context, opts metav1.ListOption // Watch returns a watch.Interface that watches the requested ingressAuthTokens. func (c *FakeIngressAuthTokens) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(ingressauthtokensResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(ingressauthtokensResource, opts)) } // Create takes the representation of a ingressAuthToken and creates it. Returns the server's representation of the ingressAuthToken, and an error, if there is any. func (c *FakeIngressAuthTokens) Create(ctx context.Context, ingressAuthToken *v1.IngressAuthToken, opts metav1.CreateOptions) (result *v1.IngressAuthToken, err error) { + emptyResult := &v1.IngressAuthToken{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(ingressauthtokensResource, ingressAuthToken), &v1.IngressAuthToken{}) + Invokes(testing.NewRootCreateActionWithOptions(ingressauthtokensResource, ingressAuthToken, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.IngressAuthToken), err } // Update takes the representation of a ingressAuthToken and updates it. Returns the server's representation of the ingressAuthToken, and an error, if there is any. func (c *FakeIngressAuthTokens) Update(ctx context.Context, ingressAuthToken *v1.IngressAuthToken, opts metav1.UpdateOptions) (result *v1.IngressAuthToken, err error) { + emptyResult := &v1.IngressAuthToken{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(ingressauthtokensResource, ingressAuthToken), &v1.IngressAuthToken{}) + Invokes(testing.NewRootUpdateActionWithOptions(ingressauthtokensResource, ingressAuthToken, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.IngressAuthToken), 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 *FakeIngressAuthTokens) UpdateStatus(ctx context.Context, ingressAuthToken *v1.IngressAuthToken, opts metav1.UpdateOptions) (*v1.IngressAuthToken, error) { +func (c *FakeIngressAuthTokens) UpdateStatus(ctx context.Context, ingressAuthToken *v1.IngressAuthToken, opts metav1.UpdateOptions) (result *v1.IngressAuthToken, err error) { + emptyResult := &v1.IngressAuthToken{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(ingressauthtokensResource, "status", ingressAuthToken), &v1.IngressAuthToken{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(ingressauthtokensResource, "status", ingressAuthToken, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.IngressAuthToken), err } @@ -99,7 +104,7 @@ func (c *FakeIngressAuthTokens) Delete(ctx context.Context, name string, opts me // DeleteCollection deletes a collection of objects. func (c *FakeIngressAuthTokens) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(ingressauthtokensResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(ingressauthtokensResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.IngressAuthTokenList{}) return err @@ -107,10 +112,11 @@ func (c *FakeIngressAuthTokens) DeleteCollection(ctx context.Context, opts metav // Patch applies the patch and returns the patched ingressAuthToken. func (c *FakeIngressAuthTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IngressAuthToken, err error) { + emptyResult := &v1.IngressAuthToken{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ingressauthtokensResource, name, pt, data, subresources...), &v1.IngressAuthToken{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressauthtokensResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.IngressAuthToken), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_license.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_license.go index 357af21..8444f1c 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_license.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_license.go @@ -24,20 +24,22 @@ var licensesKind = v1.SchemeGroupVersion.WithKind("License") // Get takes name of the license, and returns the corresponding license object, and an error if there is any. func (c *FakeLicenses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.License, err error) { + emptyResult := &v1.License{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(licensesResource, name), &v1.License{}) + Invokes(testing.NewRootGetActionWithOptions(licensesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.License), err } // List takes label and field selectors, and returns the list of Licenses that match those selectors. func (c *FakeLicenses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LicenseList, err error) { + emptyResult := &v1.LicenseList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(licensesResource, licensesKind, opts), &v1.LicenseList{}) + Invokes(testing.NewRootListActionWithOptions(licensesResource, licensesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeLicenses) List(ctx context.Context, opts metav1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested licenses. func (c *FakeLicenses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(licensesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(licensesResource, opts)) } // Create takes the representation of a license and creates it. Returns the server's representation of the license, and an error, if there is any. func (c *FakeLicenses) Create(ctx context.Context, license *v1.License, opts metav1.CreateOptions) (result *v1.License, err error) { + emptyResult := &v1.License{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(licensesResource, license), &v1.License{}) + Invokes(testing.NewRootCreateActionWithOptions(licensesResource, license, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.License), err } // Update takes the representation of a license and updates it. Returns the server's representation of the license, and an error, if there is any. func (c *FakeLicenses) Update(ctx context.Context, license *v1.License, opts metav1.UpdateOptions) (result *v1.License, err error) { + emptyResult := &v1.License{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(licensesResource, license), &v1.License{}) + Invokes(testing.NewRootUpdateActionWithOptions(licensesResource, license, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.License), 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 *FakeLicenses) UpdateStatus(ctx context.Context, license *v1.License, opts metav1.UpdateOptions) (*v1.License, error) { +func (c *FakeLicenses) UpdateStatus(ctx context.Context, license *v1.License, opts metav1.UpdateOptions) (result *v1.License, err error) { + emptyResult := &v1.License{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(licensesResource, "status", license), &v1.License{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(licensesResource, "status", license, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.License), err } @@ -99,7 +104,7 @@ func (c *FakeLicenses) Delete(ctx context.Context, name string, opts metav1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeLicenses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(licensesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(licensesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.LicenseList{}) return err @@ -107,20 +112,22 @@ func (c *FakeLicenses) DeleteCollection(ctx context.Context, opts metav1.DeleteO // Patch applies the patch and returns the patched license. func (c *FakeLicenses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.License, err error) { + emptyResult := &v1.License{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(licensesResource, name, pt, data, subresources...), &v1.License{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(licensesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.License), err } // LicenseRequest takes the representation of a licenseRequest and creates it. Returns the server's representation of the licenseRequest, and an error, if there is any. func (c *FakeLicenses) LicenseRequest(ctx context.Context, licenseName string, licenseRequest *v1.LicenseRequest, opts metav1.CreateOptions) (result *v1.LicenseRequest, err error) { + emptyResult := &v1.LicenseRequest{} obj, err := c.Fake. - Invokes(testing.NewRootCreateSubresourceAction(licensesResource, licenseName, "request", licenseRequest), &v1.LicenseRequest{}) + Invokes(testing.NewRootCreateSubresourceActionWithOptions(licensesResource, licenseName, "request", licenseRequest, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LicenseRequest), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_licensetoken.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_licensetoken.go index 31a39bf..cfb1384 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_licensetoken.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_licensetoken.go @@ -24,20 +24,22 @@ var licensetokensKind = v1.SchemeGroupVersion.WithKind("LicenseToken") // Get takes name of the licenseToken, and returns the corresponding licenseToken object, and an error if there is any. func (c *FakeLicenseTokens) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LicenseToken, err error) { + emptyResult := &v1.LicenseToken{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(licensetokensResource, name), &v1.LicenseToken{}) + Invokes(testing.NewRootGetActionWithOptions(licensetokensResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LicenseToken), err } // List takes label and field selectors, and returns the list of LicenseTokens that match those selectors. func (c *FakeLicenseTokens) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LicenseTokenList, err error) { + emptyResult := &v1.LicenseTokenList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(licensetokensResource, licensetokensKind, opts), &v1.LicenseTokenList{}) + Invokes(testing.NewRootListActionWithOptions(licensetokensResource, licensetokensKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeLicenseTokens) List(ctx context.Context, opts metav1.ListOptions) ( // Watch returns a watch.Interface that watches the requested licenseTokens. func (c *FakeLicenseTokens) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(licensetokensResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(licensetokensResource, opts)) } // Create takes the representation of a licenseToken and creates it. Returns the server's representation of the licenseToken, and an error, if there is any. func (c *FakeLicenseTokens) Create(ctx context.Context, licenseToken *v1.LicenseToken, opts metav1.CreateOptions) (result *v1.LicenseToken, err error) { + emptyResult := &v1.LicenseToken{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(licensetokensResource, licenseToken), &v1.LicenseToken{}) + Invokes(testing.NewRootCreateActionWithOptions(licensetokensResource, licenseToken, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LicenseToken), err } // Update takes the representation of a licenseToken and updates it. Returns the server's representation of the licenseToken, and an error, if there is any. func (c *FakeLicenseTokens) Update(ctx context.Context, licenseToken *v1.LicenseToken, opts metav1.UpdateOptions) (result *v1.LicenseToken, err error) { + emptyResult := &v1.LicenseToken{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(licensetokensResource, licenseToken), &v1.LicenseToken{}) + Invokes(testing.NewRootUpdateActionWithOptions(licensetokensResource, licenseToken, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LicenseToken), 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 *FakeLicenseTokens) UpdateStatus(ctx context.Context, licenseToken *v1.LicenseToken, opts metav1.UpdateOptions) (*v1.LicenseToken, error) { +func (c *FakeLicenseTokens) UpdateStatus(ctx context.Context, licenseToken *v1.LicenseToken, opts metav1.UpdateOptions) (result *v1.LicenseToken, err error) { + emptyResult := &v1.LicenseToken{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(licensetokensResource, "status", licenseToken), &v1.LicenseToken{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(licensetokensResource, "status", licenseToken, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LicenseToken), err } @@ -99,7 +104,7 @@ func (c *FakeLicenseTokens) Delete(ctx context.Context, name string, opts metav1 // DeleteCollection deletes a collection of objects. func (c *FakeLicenseTokens) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(licensetokensResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(licensetokensResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.LicenseTokenList{}) return err @@ -107,10 +112,11 @@ func (c *FakeLicenseTokens) DeleteCollection(ctx context.Context, opts metav1.De // Patch applies the patch and returns the patched licenseToken. func (c *FakeLicenseTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LicenseToken, err error) { + emptyResult := &v1.LicenseToken{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(licensetokensResource, name, pt, data, subresources...), &v1.LicenseToken{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(licensetokensResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LicenseToken), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_loftupgrade.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_loftupgrade.go index 442cf8e..d24e2c1 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_loftupgrade.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_loftupgrade.go @@ -24,20 +24,22 @@ var loftupgradesKind = v1.SchemeGroupVersion.WithKind("LoftUpgrade") // Get takes name of the loftUpgrade, and returns the corresponding loftUpgrade object, and an error if there is any. func (c *FakeLoftUpgrades) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LoftUpgrade, err error) { + emptyResult := &v1.LoftUpgrade{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(loftupgradesResource, name), &v1.LoftUpgrade{}) + Invokes(testing.NewRootGetActionWithOptions(loftupgradesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LoftUpgrade), err } // List takes label and field selectors, and returns the list of LoftUpgrades that match those selectors. func (c *FakeLoftUpgrades) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LoftUpgradeList, err error) { + emptyResult := &v1.LoftUpgradeList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(loftupgradesResource, loftupgradesKind, opts), &v1.LoftUpgradeList{}) + Invokes(testing.NewRootListActionWithOptions(loftupgradesResource, loftupgradesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeLoftUpgrades) List(ctx context.Context, opts metav1.ListOptions) (r // Watch returns a watch.Interface that watches the requested loftUpgrades. func (c *FakeLoftUpgrades) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(loftupgradesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(loftupgradesResource, opts)) } // Create takes the representation of a loftUpgrade and creates it. Returns the server's representation of the loftUpgrade, and an error, if there is any. func (c *FakeLoftUpgrades) Create(ctx context.Context, loftUpgrade *v1.LoftUpgrade, opts metav1.CreateOptions) (result *v1.LoftUpgrade, err error) { + emptyResult := &v1.LoftUpgrade{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(loftupgradesResource, loftUpgrade), &v1.LoftUpgrade{}) + Invokes(testing.NewRootCreateActionWithOptions(loftupgradesResource, loftUpgrade, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LoftUpgrade), err } // Update takes the representation of a loftUpgrade and updates it. Returns the server's representation of the loftUpgrade, and an error, if there is any. func (c *FakeLoftUpgrades) Update(ctx context.Context, loftUpgrade *v1.LoftUpgrade, opts metav1.UpdateOptions) (result *v1.LoftUpgrade, err error) { + emptyResult := &v1.LoftUpgrade{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(loftupgradesResource, loftUpgrade), &v1.LoftUpgrade{}) + Invokes(testing.NewRootUpdateActionWithOptions(loftupgradesResource, loftUpgrade, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LoftUpgrade), 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 *FakeLoftUpgrades) UpdateStatus(ctx context.Context, loftUpgrade *v1.LoftUpgrade, opts metav1.UpdateOptions) (*v1.LoftUpgrade, error) { +func (c *FakeLoftUpgrades) UpdateStatus(ctx context.Context, loftUpgrade *v1.LoftUpgrade, opts metav1.UpdateOptions) (result *v1.LoftUpgrade, err error) { + emptyResult := &v1.LoftUpgrade{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(loftupgradesResource, "status", loftUpgrade), &v1.LoftUpgrade{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(loftupgradesResource, "status", loftUpgrade, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LoftUpgrade), err } @@ -99,7 +104,7 @@ func (c *FakeLoftUpgrades) Delete(ctx context.Context, name string, opts metav1. // DeleteCollection deletes a collection of objects. func (c *FakeLoftUpgrades) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(loftupgradesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(loftupgradesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.LoftUpgradeList{}) return err @@ -107,10 +112,11 @@ func (c *FakeLoftUpgrades) DeleteCollection(ctx context.Context, opts metav1.Del // Patch applies the patch and returns the patched loftUpgrade. func (c *FakeLoftUpgrades) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LoftUpgrade, err error) { + emptyResult := &v1.LoftUpgrade{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(loftupgradesResource, name, pt, data, subresources...), &v1.LoftUpgrade{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(loftupgradesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LoftUpgrade), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_oidcclient.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_oidcclient.go index 3c19cee..c06f12b 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_oidcclient.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_oidcclient.go @@ -24,20 +24,22 @@ var oidcclientsKind = v1.SchemeGroupVersion.WithKind("OIDCClient") // Get takes name of the oIDCClient, and returns the corresponding oIDCClient object, and an error if there is any. func (c *FakeOIDCClients) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OIDCClient, err error) { + emptyResult := &v1.OIDCClient{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(oidcclientsResource, name), &v1.OIDCClient{}) + Invokes(testing.NewRootGetActionWithOptions(oidcclientsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.OIDCClient), err } // List takes label and field selectors, and returns the list of OIDCClients that match those selectors. func (c *FakeOIDCClients) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OIDCClientList, err error) { + emptyResult := &v1.OIDCClientList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(oidcclientsResource, oidcclientsKind, opts), &v1.OIDCClientList{}) + Invokes(testing.NewRootListActionWithOptions(oidcclientsResource, oidcclientsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeOIDCClients) List(ctx context.Context, opts metav1.ListOptions) (re // Watch returns a watch.Interface that watches the requested oIDCClients. func (c *FakeOIDCClients) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(oidcclientsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(oidcclientsResource, opts)) } // Create takes the representation of a oIDCClient and creates it. Returns the server's representation of the oIDCClient, and an error, if there is any. func (c *FakeOIDCClients) Create(ctx context.Context, oIDCClient *v1.OIDCClient, opts metav1.CreateOptions) (result *v1.OIDCClient, err error) { + emptyResult := &v1.OIDCClient{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(oidcclientsResource, oIDCClient), &v1.OIDCClient{}) + Invokes(testing.NewRootCreateActionWithOptions(oidcclientsResource, oIDCClient, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.OIDCClient), err } // Update takes the representation of a oIDCClient and updates it. Returns the server's representation of the oIDCClient, and an error, if there is any. func (c *FakeOIDCClients) Update(ctx context.Context, oIDCClient *v1.OIDCClient, opts metav1.UpdateOptions) (result *v1.OIDCClient, err error) { + emptyResult := &v1.OIDCClient{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(oidcclientsResource, oIDCClient), &v1.OIDCClient{}) + Invokes(testing.NewRootUpdateActionWithOptions(oidcclientsResource, oIDCClient, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.OIDCClient), 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 *FakeOIDCClients) UpdateStatus(ctx context.Context, oIDCClient *v1.OIDCClient, opts metav1.UpdateOptions) (*v1.OIDCClient, error) { +func (c *FakeOIDCClients) UpdateStatus(ctx context.Context, oIDCClient *v1.OIDCClient, opts metav1.UpdateOptions) (result *v1.OIDCClient, err error) { + emptyResult := &v1.OIDCClient{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(oidcclientsResource, "status", oIDCClient), &v1.OIDCClient{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(oidcclientsResource, "status", oIDCClient, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.OIDCClient), err } @@ -99,7 +104,7 @@ func (c *FakeOIDCClients) Delete(ctx context.Context, name string, opts metav1.D // DeleteCollection deletes a collection of objects. func (c *FakeOIDCClients) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(oidcclientsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(oidcclientsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.OIDCClientList{}) return err @@ -107,10 +112,11 @@ func (c *FakeOIDCClients) DeleteCollection(ctx context.Context, opts metav1.Dele // Patch applies the patch and returns the patched oIDCClient. func (c *FakeOIDCClients) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OIDCClient, err error) { + emptyResult := &v1.OIDCClient{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(oidcclientsResource, name, pt, data, subresources...), &v1.OIDCClient{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(oidcclientsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.OIDCClient), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_ownedaccesskey.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_ownedaccesskey.go index eeb1a84..629e3dd 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_ownedaccesskey.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_ownedaccesskey.go @@ -24,20 +24,22 @@ var ownedaccesskeysKind = v1.SchemeGroupVersion.WithKind("OwnedAccessKey") // Get takes name of the ownedAccessKey, and returns the corresponding ownedAccessKey object, and an error if there is any. func (c *FakeOwnedAccessKeys) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OwnedAccessKey, err error) { + emptyResult := &v1.OwnedAccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(ownedaccesskeysResource, name), &v1.OwnedAccessKey{}) + Invokes(testing.NewRootGetActionWithOptions(ownedaccesskeysResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.OwnedAccessKey), err } // List takes label and field selectors, and returns the list of OwnedAccessKeys that match those selectors. func (c *FakeOwnedAccessKeys) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OwnedAccessKeyList, err error) { + emptyResult := &v1.OwnedAccessKeyList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(ownedaccesskeysResource, ownedaccesskeysKind, opts), &v1.OwnedAccessKeyList{}) + Invokes(testing.NewRootListActionWithOptions(ownedaccesskeysResource, ownedaccesskeysKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeOwnedAccessKeys) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested ownedAccessKeys. func (c *FakeOwnedAccessKeys) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(ownedaccesskeysResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(ownedaccesskeysResource, opts)) } // Create takes the representation of a ownedAccessKey and creates it. Returns the server's representation of the ownedAccessKey, and an error, if there is any. func (c *FakeOwnedAccessKeys) Create(ctx context.Context, ownedAccessKey *v1.OwnedAccessKey, opts metav1.CreateOptions) (result *v1.OwnedAccessKey, err error) { + emptyResult := &v1.OwnedAccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(ownedaccesskeysResource, ownedAccessKey), &v1.OwnedAccessKey{}) + Invokes(testing.NewRootCreateActionWithOptions(ownedaccesskeysResource, ownedAccessKey, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.OwnedAccessKey), err } // Update takes the representation of a ownedAccessKey and updates it. Returns the server's representation of the ownedAccessKey, and an error, if there is any. func (c *FakeOwnedAccessKeys) Update(ctx context.Context, ownedAccessKey *v1.OwnedAccessKey, opts metav1.UpdateOptions) (result *v1.OwnedAccessKey, err error) { + emptyResult := &v1.OwnedAccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(ownedaccesskeysResource, ownedAccessKey), &v1.OwnedAccessKey{}) + Invokes(testing.NewRootUpdateActionWithOptions(ownedaccesskeysResource, ownedAccessKey, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.OwnedAccessKey), 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 *FakeOwnedAccessKeys) UpdateStatus(ctx context.Context, ownedAccessKey *v1.OwnedAccessKey, opts metav1.UpdateOptions) (*v1.OwnedAccessKey, error) { +func (c *FakeOwnedAccessKeys) UpdateStatus(ctx context.Context, ownedAccessKey *v1.OwnedAccessKey, opts metav1.UpdateOptions) (result *v1.OwnedAccessKey, err error) { + emptyResult := &v1.OwnedAccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(ownedaccesskeysResource, "status", ownedAccessKey), &v1.OwnedAccessKey{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(ownedaccesskeysResource, "status", ownedAccessKey, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.OwnedAccessKey), err } @@ -99,7 +104,7 @@ func (c *FakeOwnedAccessKeys) Delete(ctx context.Context, name string, opts meta // DeleteCollection deletes a collection of objects. func (c *FakeOwnedAccessKeys) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(ownedaccesskeysResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(ownedaccesskeysResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.OwnedAccessKeyList{}) return err @@ -107,10 +112,11 @@ func (c *FakeOwnedAccessKeys) DeleteCollection(ctx context.Context, opts metav1. // Patch applies the patch and returns the patched ownedAccessKey. func (c *FakeOwnedAccessKeys) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OwnedAccessKey, err error) { + emptyResult := &v1.OwnedAccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ownedaccesskeysResource, name, pt, data, subresources...), &v1.OwnedAccessKey{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(ownedaccesskeysResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.OwnedAccessKey), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_project.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_project.go index cf73cc7..cc068bb 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_project.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_project.go @@ -24,20 +24,22 @@ var projectsKind = v1.SchemeGroupVersion.WithKind("Project") // Get takes name of the project, and returns the corresponding project object, and an error if there is any. func (c *FakeProjects) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Project, err error) { + emptyResult := &v1.Project{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(projectsResource, name), &v1.Project{}) + Invokes(testing.NewRootGetActionWithOptions(projectsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Project), err } // List takes label and field selectors, and returns the list of Projects that match those selectors. func (c *FakeProjects) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectList, err error) { + emptyResult := &v1.ProjectList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(projectsResource, projectsKind, opts), &v1.ProjectList{}) + Invokes(testing.NewRootListActionWithOptions(projectsResource, projectsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeProjects) List(ctx context.Context, opts metav1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested projects. func (c *FakeProjects) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(projectsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(projectsResource, opts)) } // Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. func (c *FakeProjects) Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (result *v1.Project, err error) { + emptyResult := &v1.Project{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(projectsResource, project), &v1.Project{}) + Invokes(testing.NewRootCreateActionWithOptions(projectsResource, project, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Project), err } // Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. func (c *FakeProjects) Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) { + emptyResult := &v1.Project{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(projectsResource, project), &v1.Project{}) + Invokes(testing.NewRootUpdateActionWithOptions(projectsResource, project, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Project), 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 *FakeProjects) UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (*v1.Project, error) { +func (c *FakeProjects) UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) { + emptyResult := &v1.Project{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(projectsResource, "status", project), &v1.Project{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(projectsResource, "status", project, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Project), err } @@ -99,7 +104,7 @@ func (c *FakeProjects) Delete(ctx context.Context, name string, opts metav1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeProjects) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(projectsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(projectsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ProjectList{}) return err @@ -107,80 +112,88 @@ func (c *FakeProjects) DeleteCollection(ctx context.Context, opts metav1.DeleteO // Patch applies the patch and returns the patched project. func (c *FakeProjects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Project, err error) { + emptyResult := &v1.Project{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(projectsResource, name, pt, data, subresources...), &v1.Project{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(projectsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Project), err } // ListMembers takes name of the project, and returns the corresponding projectMembers object, and an error if there is any. func (c *FakeProjects) ListMembers(ctx context.Context, projectName string, options metav1.GetOptions) (result *v1.ProjectMembers, err error) { + emptyResult := &v1.ProjectMembers{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(projectsResource, "members", projectName), &v1.ProjectMembers{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(projectsResource, "members", projectName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ProjectMembers), err } // ListTemplates takes name of the project, and returns the corresponding projectTemplates object, and an error if there is any. func (c *FakeProjects) ListTemplates(ctx context.Context, projectName string, options metav1.GetOptions) (result *v1.ProjectTemplates, err error) { + emptyResult := &v1.ProjectTemplates{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(projectsResource, "templates", projectName), &v1.ProjectTemplates{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(projectsResource, "templates", projectName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ProjectTemplates), err } // ListRunners takes name of the project, and returns the corresponding projectRunners object, and an error if there is any. func (c *FakeProjects) ListRunners(ctx context.Context, projectName string, options metav1.GetOptions) (result *v1.ProjectRunners, err error) { + emptyResult := &v1.ProjectRunners{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(projectsResource, "runners", projectName), &v1.ProjectRunners{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(projectsResource, "runners", projectName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ProjectRunners), err } // ListClusters takes name of the project, and returns the corresponding projectClusters object, and an error if there is any. func (c *FakeProjects) ListClusters(ctx context.Context, projectName string, options metav1.GetOptions) (result *v1.ProjectClusters, err error) { + emptyResult := &v1.ProjectClusters{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(projectsResource, "clusters", projectName), &v1.ProjectClusters{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(projectsResource, "clusters", projectName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ProjectClusters), err } // MigrateVirtualClusterInstance takes the representation of a projectMigrateVirtualClusterInstance and creates it. Returns the server's representation of the projectMigrateVirtualClusterInstance, and an error, if there is any. func (c *FakeProjects) MigrateVirtualClusterInstance(ctx context.Context, projectName string, projectMigrateVirtualClusterInstance *v1.ProjectMigrateVirtualClusterInstance, opts metav1.CreateOptions) (result *v1.ProjectMigrateVirtualClusterInstance, err error) { + emptyResult := &v1.ProjectMigrateVirtualClusterInstance{} obj, err := c.Fake. - Invokes(testing.NewRootCreateSubresourceAction(projectsResource, projectName, "migratevirtualclusterinstance", projectMigrateVirtualClusterInstance), &v1.ProjectMigrateVirtualClusterInstance{}) + Invokes(testing.NewRootCreateSubresourceActionWithOptions(projectsResource, projectName, "migratevirtualclusterinstance", projectMigrateVirtualClusterInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ProjectMigrateVirtualClusterInstance), err } // ImportSpace takes the representation of a projectImportSpace and creates it. Returns the server's representation of the projectImportSpace, and an error, if there is any. func (c *FakeProjects) ImportSpace(ctx context.Context, projectName string, projectImportSpace *v1.ProjectImportSpace, opts metav1.CreateOptions) (result *v1.ProjectImportSpace, err error) { + emptyResult := &v1.ProjectImportSpace{} obj, err := c.Fake. - Invokes(testing.NewRootCreateSubresourceAction(projectsResource, projectName, "importspace", projectImportSpace), &v1.ProjectImportSpace{}) + Invokes(testing.NewRootCreateSubresourceActionWithOptions(projectsResource, projectName, "importspace", projectImportSpace, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ProjectImportSpace), err } // MigrateSpaceInstance takes the representation of a projectMigrateSpaceInstance and creates it. Returns the server's representation of the projectMigrateSpaceInstance, and an error, if there is any. func (c *FakeProjects) MigrateSpaceInstance(ctx context.Context, projectName string, projectMigrateSpaceInstance *v1.ProjectMigrateSpaceInstance, opts metav1.CreateOptions) (result *v1.ProjectMigrateSpaceInstance, err error) { + emptyResult := &v1.ProjectMigrateSpaceInstance{} obj, err := c.Fake. - Invokes(testing.NewRootCreateSubresourceAction(projectsResource, projectName, "migratespaceinstance", projectMigrateSpaceInstance), &v1.ProjectMigrateSpaceInstance{}) + Invokes(testing.NewRootCreateSubresourceActionWithOptions(projectsResource, projectName, "migratespaceinstance", projectMigrateSpaceInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ProjectMigrateSpaceInstance), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_projectsecret.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_projectsecret.go index 74f0578..7fd8847 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_projectsecret.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_projectsecret.go @@ -25,22 +25,24 @@ var projectsecretsKind = v1.SchemeGroupVersion.WithKind("ProjectSecret") // Get takes name of the projectSecret, and returns the corresponding projectSecret object, and an error if there is any. func (c *FakeProjectSecrets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ProjectSecret, err error) { + emptyResult := &v1.ProjectSecret{} obj, err := c.Fake. - Invokes(testing.NewGetAction(projectsecretsResource, c.ns, name), &v1.ProjectSecret{}) + Invokes(testing.NewGetActionWithOptions(projectsecretsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ProjectSecret), err } // List takes label and field selectors, and returns the list of ProjectSecrets that match those selectors. func (c *FakeProjectSecrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectSecretList, err error) { + emptyResult := &v1.ProjectSecretList{} obj, err := c.Fake. - Invokes(testing.NewListAction(projectsecretsResource, projectsecretsKind, c.ns, opts), &v1.ProjectSecretList{}) + Invokes(testing.NewListActionWithOptions(projectsecretsResource, projectsecretsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,28 +61,30 @@ func (c *FakeProjectSecrets) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested projectSecrets. func (c *FakeProjectSecrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(projectsecretsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(projectsecretsResource, c.ns, opts)) } // Create takes the representation of a projectSecret and creates it. Returns the server's representation of the projectSecret, and an error, if there is any. func (c *FakeProjectSecrets) Create(ctx context.Context, projectSecret *v1.ProjectSecret, opts metav1.CreateOptions) (result *v1.ProjectSecret, err error) { + emptyResult := &v1.ProjectSecret{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(projectsecretsResource, c.ns, projectSecret), &v1.ProjectSecret{}) + Invokes(testing.NewCreateActionWithOptions(projectsecretsResource, c.ns, projectSecret, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ProjectSecret), err } // Update takes the representation of a projectSecret and updates it. Returns the server's representation of the projectSecret, and an error, if there is any. func (c *FakeProjectSecrets) Update(ctx context.Context, projectSecret *v1.ProjectSecret, opts metav1.UpdateOptions) (result *v1.ProjectSecret, err error) { + emptyResult := &v1.ProjectSecret{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(projectsecretsResource, c.ns, projectSecret), &v1.ProjectSecret{}) + Invokes(testing.NewUpdateActionWithOptions(projectsecretsResource, c.ns, projectSecret, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ProjectSecret), err } @@ -95,7 +99,7 @@ func (c *FakeProjectSecrets) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeProjectSecrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(projectsecretsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(projectsecretsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ProjectSecretList{}) return err @@ -103,11 +107,12 @@ func (c *FakeProjectSecrets) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched projectSecret. func (c *FakeProjectSecrets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProjectSecret, err error) { + emptyResult := &v1.ProjectSecret{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(projectsecretsResource, c.ns, name, pt, data, subresources...), &v1.ProjectSecret{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(projectsecretsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ProjectSecret), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_redirecttoken.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_redirecttoken.go index 6aaf100..ca422b9 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_redirecttoken.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_redirecttoken.go @@ -24,20 +24,22 @@ var redirecttokensKind = v1.SchemeGroupVersion.WithKind("RedirectToken") // Get takes name of the redirectToken, and returns the corresponding redirectToken object, and an error if there is any. func (c *FakeRedirectTokens) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RedirectToken, err error) { + emptyResult := &v1.RedirectToken{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(redirecttokensResource, name), &v1.RedirectToken{}) + Invokes(testing.NewRootGetActionWithOptions(redirecttokensResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RedirectToken), err } // List takes label and field selectors, and returns the list of RedirectTokens that match those selectors. func (c *FakeRedirectTokens) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RedirectTokenList, err error) { + emptyResult := &v1.RedirectTokenList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(redirecttokensResource, redirecttokensKind, opts), &v1.RedirectTokenList{}) + Invokes(testing.NewRootListActionWithOptions(redirecttokensResource, redirecttokensKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeRedirectTokens) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested redirectTokens. func (c *FakeRedirectTokens) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(redirecttokensResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(redirecttokensResource, opts)) } // Create takes the representation of a redirectToken and creates it. Returns the server's representation of the redirectToken, and an error, if there is any. func (c *FakeRedirectTokens) Create(ctx context.Context, redirectToken *v1.RedirectToken, opts metav1.CreateOptions) (result *v1.RedirectToken, err error) { + emptyResult := &v1.RedirectToken{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(redirecttokensResource, redirectToken), &v1.RedirectToken{}) + Invokes(testing.NewRootCreateActionWithOptions(redirecttokensResource, redirectToken, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RedirectToken), err } // Update takes the representation of a redirectToken and updates it. Returns the server's representation of the redirectToken, and an error, if there is any. func (c *FakeRedirectTokens) Update(ctx context.Context, redirectToken *v1.RedirectToken, opts metav1.UpdateOptions) (result *v1.RedirectToken, err error) { + emptyResult := &v1.RedirectToken{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(redirecttokensResource, redirectToken), &v1.RedirectToken{}) + Invokes(testing.NewRootUpdateActionWithOptions(redirecttokensResource, redirectToken, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RedirectToken), 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 *FakeRedirectTokens) UpdateStatus(ctx context.Context, redirectToken *v1.RedirectToken, opts metav1.UpdateOptions) (*v1.RedirectToken, error) { +func (c *FakeRedirectTokens) UpdateStatus(ctx context.Context, redirectToken *v1.RedirectToken, opts metav1.UpdateOptions) (result *v1.RedirectToken, err error) { + emptyResult := &v1.RedirectToken{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(redirecttokensResource, "status", redirectToken), &v1.RedirectToken{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(redirecttokensResource, "status", redirectToken, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RedirectToken), err } @@ -99,7 +104,7 @@ func (c *FakeRedirectTokens) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeRedirectTokens) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(redirecttokensResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(redirecttokensResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RedirectTokenList{}) return err @@ -107,10 +112,11 @@ func (c *FakeRedirectTokens) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched redirectToken. func (c *FakeRedirectTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RedirectToken, err error) { + emptyResult := &v1.RedirectToken{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(redirecttokensResource, name, pt, data, subresources...), &v1.RedirectToken{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(redirecttokensResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RedirectToken), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_registervirtualcluster.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_registervirtualcluster.go index 221fff3..e3dfd56 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_registervirtualcluster.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_registervirtualcluster.go @@ -24,20 +24,22 @@ var registervirtualclustersKind = v1.SchemeGroupVersion.WithKind("RegisterVirtua // Get takes name of the registerVirtualCluster, and returns the corresponding registerVirtualCluster object, and an error if there is any. func (c *FakeRegisterVirtualClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RegisterVirtualCluster, err error) { + emptyResult := &v1.RegisterVirtualCluster{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(registervirtualclustersResource, name), &v1.RegisterVirtualCluster{}) + Invokes(testing.NewRootGetActionWithOptions(registervirtualclustersResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RegisterVirtualCluster), err } // List takes label and field selectors, and returns the list of RegisterVirtualClusters that match those selectors. func (c *FakeRegisterVirtualClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RegisterVirtualClusterList, err error) { + emptyResult := &v1.RegisterVirtualClusterList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(registervirtualclustersResource, registervirtualclustersKind, opts), &v1.RegisterVirtualClusterList{}) + Invokes(testing.NewRootListActionWithOptions(registervirtualclustersResource, registervirtualclustersKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeRegisterVirtualClusters) List(ctx context.Context, opts metav1.List // Watch returns a watch.Interface that watches the requested registerVirtualClusters. func (c *FakeRegisterVirtualClusters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(registervirtualclustersResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(registervirtualclustersResource, opts)) } // Create takes the representation of a registerVirtualCluster and creates it. Returns the server's representation of the registerVirtualCluster, and an error, if there is any. func (c *FakeRegisterVirtualClusters) Create(ctx context.Context, registerVirtualCluster *v1.RegisterVirtualCluster, opts metav1.CreateOptions) (result *v1.RegisterVirtualCluster, err error) { + emptyResult := &v1.RegisterVirtualCluster{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(registervirtualclustersResource, registerVirtualCluster), &v1.RegisterVirtualCluster{}) + Invokes(testing.NewRootCreateActionWithOptions(registervirtualclustersResource, registerVirtualCluster, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RegisterVirtualCluster), err } // Update takes the representation of a registerVirtualCluster and updates it. Returns the server's representation of the registerVirtualCluster, and an error, if there is any. func (c *FakeRegisterVirtualClusters) Update(ctx context.Context, registerVirtualCluster *v1.RegisterVirtualCluster, opts metav1.UpdateOptions) (result *v1.RegisterVirtualCluster, err error) { + emptyResult := &v1.RegisterVirtualCluster{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(registervirtualclustersResource, registerVirtualCluster), &v1.RegisterVirtualCluster{}) + Invokes(testing.NewRootUpdateActionWithOptions(registervirtualclustersResource, registerVirtualCluster, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RegisterVirtualCluster), 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 *FakeRegisterVirtualClusters) UpdateStatus(ctx context.Context, registerVirtualCluster *v1.RegisterVirtualCluster, opts metav1.UpdateOptions) (*v1.RegisterVirtualCluster, error) { +func (c *FakeRegisterVirtualClusters) UpdateStatus(ctx context.Context, registerVirtualCluster *v1.RegisterVirtualCluster, opts metav1.UpdateOptions) (result *v1.RegisterVirtualCluster, err error) { + emptyResult := &v1.RegisterVirtualCluster{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(registervirtualclustersResource, "status", registerVirtualCluster), &v1.RegisterVirtualCluster{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(registervirtualclustersResource, "status", registerVirtualCluster, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RegisterVirtualCluster), err } @@ -99,7 +104,7 @@ func (c *FakeRegisterVirtualClusters) Delete(ctx context.Context, name string, o // DeleteCollection deletes a collection of objects. func (c *FakeRegisterVirtualClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(registervirtualclustersResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(registervirtualclustersResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RegisterVirtualClusterList{}) return err @@ -107,10 +112,11 @@ func (c *FakeRegisterVirtualClusters) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched registerVirtualCluster. func (c *FakeRegisterVirtualClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RegisterVirtualCluster, err error) { + emptyResult := &v1.RegisterVirtualCluster{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(registervirtualclustersResource, name, pt, data, subresources...), &v1.RegisterVirtualCluster{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(registervirtualclustersResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RegisterVirtualCluster), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_resetaccesskey.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_resetaccesskey.go index 49f6a8d..bd9b9d3 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_resetaccesskey.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_resetaccesskey.go @@ -24,20 +24,22 @@ var resetaccesskeysKind = v1.SchemeGroupVersion.WithKind("ResetAccessKey") // Get takes name of the resetAccessKey, and returns the corresponding resetAccessKey object, and an error if there is any. func (c *FakeResetAccessKeys) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ResetAccessKey, err error) { + emptyResult := &v1.ResetAccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resetaccesskeysResource, name), &v1.ResetAccessKey{}) + Invokes(testing.NewRootGetActionWithOptions(resetaccesskeysResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ResetAccessKey), err } // List takes label and field selectors, and returns the list of ResetAccessKeys that match those selectors. func (c *FakeResetAccessKeys) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ResetAccessKeyList, err error) { + emptyResult := &v1.ResetAccessKeyList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(resetaccesskeysResource, resetaccesskeysKind, opts), &v1.ResetAccessKeyList{}) + Invokes(testing.NewRootListActionWithOptions(resetaccesskeysResource, resetaccesskeysKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeResetAccessKeys) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested resetAccessKeys. func (c *FakeResetAccessKeys) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(resetaccesskeysResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(resetaccesskeysResource, opts)) } // Create takes the representation of a resetAccessKey and creates it. Returns the server's representation of the resetAccessKey, and an error, if there is any. func (c *FakeResetAccessKeys) Create(ctx context.Context, resetAccessKey *v1.ResetAccessKey, opts metav1.CreateOptions) (result *v1.ResetAccessKey, err error) { + emptyResult := &v1.ResetAccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(resetaccesskeysResource, resetAccessKey), &v1.ResetAccessKey{}) + Invokes(testing.NewRootCreateActionWithOptions(resetaccesskeysResource, resetAccessKey, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ResetAccessKey), err } // Update takes the representation of a resetAccessKey and updates it. Returns the server's representation of the resetAccessKey, and an error, if there is any. func (c *FakeResetAccessKeys) Update(ctx context.Context, resetAccessKey *v1.ResetAccessKey, opts metav1.UpdateOptions) (result *v1.ResetAccessKey, err error) { + emptyResult := &v1.ResetAccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(resetaccesskeysResource, resetAccessKey), &v1.ResetAccessKey{}) + Invokes(testing.NewRootUpdateActionWithOptions(resetaccesskeysResource, resetAccessKey, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ResetAccessKey), 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 *FakeResetAccessKeys) UpdateStatus(ctx context.Context, resetAccessKey *v1.ResetAccessKey, opts metav1.UpdateOptions) (*v1.ResetAccessKey, error) { +func (c *FakeResetAccessKeys) UpdateStatus(ctx context.Context, resetAccessKey *v1.ResetAccessKey, opts metav1.UpdateOptions) (result *v1.ResetAccessKey, err error) { + emptyResult := &v1.ResetAccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(resetaccesskeysResource, "status", resetAccessKey), &v1.ResetAccessKey{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(resetaccesskeysResource, "status", resetAccessKey, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ResetAccessKey), err } @@ -99,7 +104,7 @@ func (c *FakeResetAccessKeys) Delete(ctx context.Context, name string, opts meta // DeleteCollection deletes a collection of objects. func (c *FakeResetAccessKeys) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(resetaccesskeysResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(resetaccesskeysResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ResetAccessKeyList{}) return err @@ -107,10 +112,11 @@ func (c *FakeResetAccessKeys) DeleteCollection(ctx context.Context, opts metav1. // Patch applies the patch and returns the patched resetAccessKey. func (c *FakeResetAccessKeys) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResetAccessKey, err error) { + emptyResult := &v1.ResetAccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(resetaccesskeysResource, name, pt, data, subresources...), &v1.ResetAccessKey{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(resetaccesskeysResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ResetAccessKey), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_runner.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_runner.go index 0e27871..04d0a6b 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_runner.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_runner.go @@ -24,20 +24,22 @@ var runnersKind = v1.SchemeGroupVersion.WithKind("Runner") // Get takes name of the runner, and returns the corresponding runner object, and an error if there is any. func (c *FakeRunners) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Runner, err error) { + emptyResult := &v1.Runner{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(runnersResource, name), &v1.Runner{}) + Invokes(testing.NewRootGetActionWithOptions(runnersResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Runner), err } // List takes label and field selectors, and returns the list of Runners that match those selectors. func (c *FakeRunners) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RunnerList, err error) { + emptyResult := &v1.RunnerList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(runnersResource, runnersKind, opts), &v1.RunnerList{}) + Invokes(testing.NewRootListActionWithOptions(runnersResource, runnersKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeRunners) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested runners. func (c *FakeRunners) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(runnersResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(runnersResource, opts)) } // Create takes the representation of a runner and creates it. Returns the server's representation of the runner, and an error, if there is any. func (c *FakeRunners) Create(ctx context.Context, runner *v1.Runner, opts metav1.CreateOptions) (result *v1.Runner, err error) { + emptyResult := &v1.Runner{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(runnersResource, runner), &v1.Runner{}) + Invokes(testing.NewRootCreateActionWithOptions(runnersResource, runner, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Runner), err } // Update takes the representation of a runner and updates it. Returns the server's representation of the runner, and an error, if there is any. func (c *FakeRunners) Update(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (result *v1.Runner, err error) { + emptyResult := &v1.Runner{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(runnersResource, runner), &v1.Runner{}) + Invokes(testing.NewRootUpdateActionWithOptions(runnersResource, runner, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Runner), 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 *FakeRunners) UpdateStatus(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (*v1.Runner, error) { +func (c *FakeRunners) UpdateStatus(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (result *v1.Runner, err error) { + emptyResult := &v1.Runner{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(runnersResource, "status", runner), &v1.Runner{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(runnersResource, "status", runner, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Runner), err } @@ -99,7 +104,7 @@ func (c *FakeRunners) Delete(ctx context.Context, name string, opts metav1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeRunners) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(runnersResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(runnersResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RunnerList{}) return err @@ -107,30 +112,33 @@ func (c *FakeRunners) DeleteCollection(ctx context.Context, opts metav1.DeleteOp // Patch applies the patch and returns the patched runner. func (c *FakeRunners) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Runner, err error) { + emptyResult := &v1.Runner{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runnersResource, name, pt, data, subresources...), &v1.Runner{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(runnersResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Runner), err } // GetConfig takes name of the runner, and returns the corresponding runnerConfig object, and an error if there is any. func (c *FakeRunners) GetConfig(ctx context.Context, runnerName string, options metav1.GetOptions) (result *v1.RunnerConfig, err error) { + emptyResult := &v1.RunnerConfig{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(runnersResource, "config", runnerName), &v1.RunnerConfig{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(runnersResource, "config", runnerName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RunnerConfig), err } // GetAccessKey takes name of the runner, and returns the corresponding runnerAccessKey object, and an error if there is any. func (c *FakeRunners) GetAccessKey(ctx context.Context, runnerName string, options metav1.GetOptions) (result *v1.RunnerAccessKey, err error) { + emptyResult := &v1.RunnerAccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(runnersResource, "accesskey", runnerName), &v1.RunnerAccessKey{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(runnersResource, "accesskey", runnerName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RunnerAccessKey), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_self.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_self.go index e66c72a..4e3f66b 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_self.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_self.go @@ -24,20 +24,22 @@ var selvesKind = v1.SchemeGroupVersion.WithKind("Self") // Get takes name of the self, and returns the corresponding self object, and an error if there is any. func (c *FakeSelves) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Self, err error) { + emptyResult := &v1.Self{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(selvesResource, name), &v1.Self{}) + Invokes(testing.NewRootGetActionWithOptions(selvesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Self), err } // List takes label and field selectors, and returns the list of Selves that match those selectors. func (c *FakeSelves) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SelfList, err error) { + emptyResult := &v1.SelfList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(selvesResource, selvesKind, opts), &v1.SelfList{}) + Invokes(testing.NewRootListActionWithOptions(selvesResource, selvesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeSelves) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested selves. func (c *FakeSelves) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(selvesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(selvesResource, opts)) } // Create takes the representation of a self and creates it. Returns the server's representation of the self, and an error, if there is any. func (c *FakeSelves) Create(ctx context.Context, self *v1.Self, opts metav1.CreateOptions) (result *v1.Self, err error) { + emptyResult := &v1.Self{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selvesResource, self), &v1.Self{}) + Invokes(testing.NewRootCreateActionWithOptions(selvesResource, self, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Self), err } // Update takes the representation of a self and updates it. Returns the server's representation of the self, and an error, if there is any. func (c *FakeSelves) Update(ctx context.Context, self *v1.Self, opts metav1.UpdateOptions) (result *v1.Self, err error) { + emptyResult := &v1.Self{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(selvesResource, self), &v1.Self{}) + Invokes(testing.NewRootUpdateActionWithOptions(selvesResource, self, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Self), 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 *FakeSelves) UpdateStatus(ctx context.Context, self *v1.Self, opts metav1.UpdateOptions) (*v1.Self, error) { +func (c *FakeSelves) UpdateStatus(ctx context.Context, self *v1.Self, opts metav1.UpdateOptions) (result *v1.Self, err error) { + emptyResult := &v1.Self{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(selvesResource, "status", self), &v1.Self{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(selvesResource, "status", self, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Self), err } @@ -99,7 +104,7 @@ func (c *FakeSelves) Delete(ctx context.Context, name string, opts metav1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeSelves) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(selvesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(selvesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.SelfList{}) return err @@ -107,10 +112,11 @@ func (c *FakeSelves) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt // Patch applies the patch and returns the patched self. func (c *FakeSelves) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Self, err error) { + emptyResult := &v1.Self{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(selvesResource, name, pt, data, subresources...), &v1.Self{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(selvesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Self), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_selfsubjectaccessreview.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_selfsubjectaccessreview.go index d902be4..3f8b7d9 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_selfsubjectaccessreview.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_selfsubjectaccessreview.go @@ -24,20 +24,22 @@ var selfsubjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectAc // Get takes name of the selfSubjectAccessReview, and returns the corresponding selfSubjectAccessReview object, and an error if there is any. func (c *FakeSelfSubjectAccessReviews) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SelfSubjectAccessReview, err error) { + emptyResult := &v1.SelfSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(selfsubjectaccessreviewsResource, name), &v1.SelfSubjectAccessReview{}) + Invokes(testing.NewRootGetActionWithOptions(selfsubjectaccessreviewsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SelfSubjectAccessReview), err } // List takes label and field selectors, and returns the list of SelfSubjectAccessReviews that match those selectors. func (c *FakeSelfSubjectAccessReviews) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SelfSubjectAccessReviewList, err error) { + emptyResult := &v1.SelfSubjectAccessReviewList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(selfsubjectaccessreviewsResource, selfsubjectaccessreviewsKind, opts), &v1.SelfSubjectAccessReviewList{}) + Invokes(testing.NewRootListActionWithOptions(selfsubjectaccessreviewsResource, selfsubjectaccessreviewsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeSelfSubjectAccessReviews) List(ctx context.Context, opts metav1.Lis // Watch returns a watch.Interface that watches the requested selfSubjectAccessReviews. func (c *FakeSelfSubjectAccessReviews) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(selfsubjectaccessreviewsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(selfsubjectaccessreviewsResource, opts)) } // Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (result *v1.SelfSubjectAccessReview, err error) { + emptyResult := &v1.SelfSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), &v1.SelfSubjectAccessReview{}) + Invokes(testing.NewRootCreateActionWithOptions(selfsubjectaccessreviewsResource, selfSubjectAccessReview, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SelfSubjectAccessReview), err } // Update takes the representation of a selfSubjectAccessReview and updates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. func (c *FakeSelfSubjectAccessReviews) Update(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.UpdateOptions) (result *v1.SelfSubjectAccessReview, err error) { + emptyResult := &v1.SelfSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), &v1.SelfSubjectAccessReview{}) + Invokes(testing.NewRootUpdateActionWithOptions(selfsubjectaccessreviewsResource, selfSubjectAccessReview, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SelfSubjectAccessReview), 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 *FakeSelfSubjectAccessReviews) UpdateStatus(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.UpdateOptions) (*v1.SelfSubjectAccessReview, error) { +func (c *FakeSelfSubjectAccessReviews) UpdateStatus(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.UpdateOptions) (result *v1.SelfSubjectAccessReview, err error) { + emptyResult := &v1.SelfSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(selfsubjectaccessreviewsResource, "status", selfSubjectAccessReview), &v1.SelfSubjectAccessReview{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(selfsubjectaccessreviewsResource, "status", selfSubjectAccessReview, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SelfSubjectAccessReview), err } @@ -99,7 +104,7 @@ func (c *FakeSelfSubjectAccessReviews) Delete(ctx context.Context, name string, // DeleteCollection deletes a collection of objects. func (c *FakeSelfSubjectAccessReviews) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(selfsubjectaccessreviewsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(selfsubjectaccessreviewsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.SelfSubjectAccessReviewList{}) return err @@ -107,10 +112,11 @@ func (c *FakeSelfSubjectAccessReviews) DeleteCollection(ctx context.Context, opt // Patch applies the patch and returns the patched selfSubjectAccessReview. func (c *FakeSelfSubjectAccessReviews) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SelfSubjectAccessReview, err error) { + emptyResult := &v1.SelfSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(selfsubjectaccessreviewsResource, name, pt, data, subresources...), &v1.SelfSubjectAccessReview{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(selfsubjectaccessreviewsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SelfSubjectAccessReview), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_sharedsecret.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_sharedsecret.go index 9f1031d..7f93614 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_sharedsecret.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_sharedsecret.go @@ -25,22 +25,24 @@ var sharedsecretsKind = v1.SchemeGroupVersion.WithKind("SharedSecret") // Get takes name of the sharedSecret, and returns the corresponding sharedSecret object, and an error if there is any. func (c *FakeSharedSecrets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SharedSecret, err error) { + emptyResult := &v1.SharedSecret{} obj, err := c.Fake. - Invokes(testing.NewGetAction(sharedsecretsResource, c.ns, name), &v1.SharedSecret{}) + Invokes(testing.NewGetActionWithOptions(sharedsecretsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SharedSecret), err } // List takes label and field selectors, and returns the list of SharedSecrets that match those selectors. func (c *FakeSharedSecrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SharedSecretList, err error) { + emptyResult := &v1.SharedSecretList{} obj, err := c.Fake. - Invokes(testing.NewListAction(sharedsecretsResource, sharedsecretsKind, c.ns, opts), &v1.SharedSecretList{}) + Invokes(testing.NewListActionWithOptions(sharedsecretsResource, sharedsecretsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,40 +61,43 @@ func (c *FakeSharedSecrets) List(ctx context.Context, opts metav1.ListOptions) ( // Watch returns a watch.Interface that watches the requested sharedSecrets. func (c *FakeSharedSecrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(sharedsecretsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(sharedsecretsResource, c.ns, opts)) } // Create takes the representation of a sharedSecret and creates it. Returns the server's representation of the sharedSecret, and an error, if there is any. func (c *FakeSharedSecrets) Create(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.CreateOptions) (result *v1.SharedSecret, err error) { + emptyResult := &v1.SharedSecret{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(sharedsecretsResource, c.ns, sharedSecret), &v1.SharedSecret{}) + Invokes(testing.NewCreateActionWithOptions(sharedsecretsResource, c.ns, sharedSecret, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SharedSecret), err } // Update takes the representation of a sharedSecret and updates it. Returns the server's representation of the sharedSecret, and an error, if there is any. func (c *FakeSharedSecrets) Update(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (result *v1.SharedSecret, err error) { + emptyResult := &v1.SharedSecret{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(sharedsecretsResource, c.ns, sharedSecret), &v1.SharedSecret{}) + Invokes(testing.NewUpdateActionWithOptions(sharedsecretsResource, c.ns, sharedSecret, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SharedSecret), 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 *FakeSharedSecrets) UpdateStatus(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (*v1.SharedSecret, error) { +func (c *FakeSharedSecrets) UpdateStatus(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (result *v1.SharedSecret, err error) { + emptyResult := &v1.SharedSecret{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(sharedsecretsResource, "status", c.ns, sharedSecret), &v1.SharedSecret{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(sharedsecretsResource, "status", c.ns, sharedSecret, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SharedSecret), err } @@ -107,7 +112,7 @@ func (c *FakeSharedSecrets) Delete(ctx context.Context, name string, opts metav1 // DeleteCollection deletes a collection of objects. func (c *FakeSharedSecrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(sharedsecretsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(sharedsecretsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.SharedSecretList{}) return err @@ -115,11 +120,12 @@ func (c *FakeSharedSecrets) DeleteCollection(ctx context.Context, opts metav1.De // Patch applies the patch and returns the patched sharedSecret. func (c *FakeSharedSecrets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SharedSecret, err error) { + emptyResult := &v1.SharedSecret{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(sharedsecretsResource, c.ns, name, pt, data, subresources...), &v1.SharedSecret{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(sharedsecretsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SharedSecret), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_spaceinstance.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_spaceinstance.go index a46e1e1..a225f7b 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_spaceinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_spaceinstance.go @@ -25,22 +25,24 @@ var spaceinstancesKind = v1.SchemeGroupVersion.WithKind("SpaceInstance") // Get takes name of the spaceInstance, and returns the corresponding spaceInstance object, and an error if there is any. func (c *FakeSpaceInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SpaceInstance, err error) { + emptyResult := &v1.SpaceInstance{} obj, err := c.Fake. - Invokes(testing.NewGetAction(spaceinstancesResource, c.ns, name), &v1.SpaceInstance{}) + Invokes(testing.NewGetActionWithOptions(spaceinstancesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceInstance), err } // List takes label and field selectors, and returns the list of SpaceInstances that match those selectors. func (c *FakeSpaceInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SpaceInstanceList, err error) { + emptyResult := &v1.SpaceInstanceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(spaceinstancesResource, spaceinstancesKind, c.ns, opts), &v1.SpaceInstanceList{}) + Invokes(testing.NewListActionWithOptions(spaceinstancesResource, spaceinstancesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,28 +61,30 @@ func (c *FakeSpaceInstances) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested spaceInstances. func (c *FakeSpaceInstances) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(spaceinstancesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(spaceinstancesResource, c.ns, opts)) } // Create takes the representation of a spaceInstance and creates it. Returns the server's representation of the spaceInstance, and an error, if there is any. func (c *FakeSpaceInstances) Create(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.CreateOptions) (result *v1.SpaceInstance, err error) { + emptyResult := &v1.SpaceInstance{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(spaceinstancesResource, c.ns, spaceInstance), &v1.SpaceInstance{}) + Invokes(testing.NewCreateActionWithOptions(spaceinstancesResource, c.ns, spaceInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceInstance), err } // Update takes the representation of a spaceInstance and updates it. Returns the server's representation of the spaceInstance, and an error, if there is any. func (c *FakeSpaceInstances) Update(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.UpdateOptions) (result *v1.SpaceInstance, err error) { + emptyResult := &v1.SpaceInstance{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(spaceinstancesResource, c.ns, spaceInstance), &v1.SpaceInstance{}) + Invokes(testing.NewUpdateActionWithOptions(spaceinstancesResource, c.ns, spaceInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceInstance), err } @@ -95,7 +99,7 @@ func (c *FakeSpaceInstances) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeSpaceInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(spaceinstancesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(spaceinstancesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.SpaceInstanceList{}) return err @@ -103,11 +107,12 @@ func (c *FakeSpaceInstances) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched spaceInstance. func (c *FakeSpaceInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SpaceInstance, err error) { + emptyResult := &v1.SpaceInstance{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(spaceinstancesResource, c.ns, name, pt, data, subresources...), &v1.SpaceInstance{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(spaceinstancesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceInstance), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_spacetemplate.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_spacetemplate.go index fe43c2b..f47f586 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_spacetemplate.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_spacetemplate.go @@ -24,20 +24,22 @@ var spacetemplatesKind = v1.SchemeGroupVersion.WithKind("SpaceTemplate") // Get takes name of the spaceTemplate, and returns the corresponding spaceTemplate object, and an error if there is any. func (c *FakeSpaceTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SpaceTemplate, err error) { + emptyResult := &v1.SpaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(spacetemplatesResource, name), &v1.SpaceTemplate{}) + Invokes(testing.NewRootGetActionWithOptions(spacetemplatesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceTemplate), err } // List takes label and field selectors, and returns the list of SpaceTemplates that match those selectors. func (c *FakeSpaceTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SpaceTemplateList, err error) { + emptyResult := &v1.SpaceTemplateList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(spacetemplatesResource, spacetemplatesKind, opts), &v1.SpaceTemplateList{}) + Invokes(testing.NewRootListActionWithOptions(spacetemplatesResource, spacetemplatesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeSpaceTemplates) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested spaceTemplates. func (c *FakeSpaceTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(spacetemplatesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(spacetemplatesResource, opts)) } // Create takes the representation of a spaceTemplate and creates it. Returns the server's representation of the spaceTemplate, and an error, if there is any. func (c *FakeSpaceTemplates) Create(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.CreateOptions) (result *v1.SpaceTemplate, err error) { + emptyResult := &v1.SpaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(spacetemplatesResource, spaceTemplate), &v1.SpaceTemplate{}) + Invokes(testing.NewRootCreateActionWithOptions(spacetemplatesResource, spaceTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceTemplate), err } // Update takes the representation of a spaceTemplate and updates it. Returns the server's representation of the spaceTemplate, and an error, if there is any. func (c *FakeSpaceTemplates) Update(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (result *v1.SpaceTemplate, err error) { + emptyResult := &v1.SpaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(spacetemplatesResource, spaceTemplate), &v1.SpaceTemplate{}) + Invokes(testing.NewRootUpdateActionWithOptions(spacetemplatesResource, spaceTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceTemplate), 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 *FakeSpaceTemplates) UpdateStatus(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (*v1.SpaceTemplate, error) { +func (c *FakeSpaceTemplates) UpdateStatus(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (result *v1.SpaceTemplate, err error) { + emptyResult := &v1.SpaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(spacetemplatesResource, "status", spaceTemplate), &v1.SpaceTemplate{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(spacetemplatesResource, "status", spaceTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceTemplate), err } @@ -99,7 +104,7 @@ func (c *FakeSpaceTemplates) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeSpaceTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(spacetemplatesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(spacetemplatesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.SpaceTemplateList{}) return err @@ -107,10 +112,11 @@ func (c *FakeSpaceTemplates) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched spaceTemplate. func (c *FakeSpaceTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SpaceTemplate, err error) { + emptyResult := &v1.SpaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(spacetemplatesResource, name, pt, data, subresources...), &v1.SpaceTemplate{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(spacetemplatesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceTemplate), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_subjectaccessreview.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_subjectaccessreview.go index 65f8f3f..d60682b 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_subjectaccessreview.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_subjectaccessreview.go @@ -24,20 +24,22 @@ var subjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("SubjectAccessRevi // Get takes name of the subjectAccessReview, and returns the corresponding subjectAccessReview object, and an error if there is any. func (c *FakeSubjectAccessReviews) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SubjectAccessReview, err error) { + emptyResult := &v1.SubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(subjectaccessreviewsResource, name), &v1.SubjectAccessReview{}) + Invokes(testing.NewRootGetActionWithOptions(subjectaccessreviewsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SubjectAccessReview), err } // List takes label and field selectors, and returns the list of SubjectAccessReviews that match those selectors. func (c *FakeSubjectAccessReviews) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SubjectAccessReviewList, err error) { + emptyResult := &v1.SubjectAccessReviewList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(subjectaccessreviewsResource, subjectaccessreviewsKind, opts), &v1.SubjectAccessReviewList{}) + Invokes(testing.NewRootListActionWithOptions(subjectaccessreviewsResource, subjectaccessreviewsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeSubjectAccessReviews) List(ctx context.Context, opts metav1.ListOpt // Watch returns a watch.Interface that watches the requested subjectAccessReviews. func (c *FakeSubjectAccessReviews) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(subjectaccessreviewsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(subjectaccessreviewsResource, opts)) } // Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (result *v1.SubjectAccessReview, err error) { + emptyResult := &v1.SubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), &v1.SubjectAccessReview{}) + Invokes(testing.NewRootCreateActionWithOptions(subjectaccessreviewsResource, subjectAccessReview, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SubjectAccessReview), err } // Update takes the representation of a subjectAccessReview and updates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. func (c *FakeSubjectAccessReviews) Update(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.UpdateOptions) (result *v1.SubjectAccessReview, err error) { + emptyResult := &v1.SubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(subjectaccessreviewsResource, subjectAccessReview), &v1.SubjectAccessReview{}) + Invokes(testing.NewRootUpdateActionWithOptions(subjectaccessreviewsResource, subjectAccessReview, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SubjectAccessReview), 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 *FakeSubjectAccessReviews) UpdateStatus(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.UpdateOptions) (*v1.SubjectAccessReview, error) { +func (c *FakeSubjectAccessReviews) UpdateStatus(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.UpdateOptions) (result *v1.SubjectAccessReview, err error) { + emptyResult := &v1.SubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(subjectaccessreviewsResource, "status", subjectAccessReview), &v1.SubjectAccessReview{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(subjectaccessreviewsResource, "status", subjectAccessReview, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SubjectAccessReview), err } @@ -99,7 +104,7 @@ func (c *FakeSubjectAccessReviews) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeSubjectAccessReviews) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(subjectaccessreviewsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(subjectaccessreviewsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.SubjectAccessReviewList{}) return err @@ -107,10 +112,11 @@ func (c *FakeSubjectAccessReviews) DeleteCollection(ctx context.Context, opts me // Patch applies the patch and returns the patched subjectAccessReview. func (c *FakeSubjectAccessReviews) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SubjectAccessReview, err error) { + emptyResult := &v1.SubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(subjectaccessreviewsResource, name, pt, data, subresources...), &v1.SubjectAccessReview{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(subjectaccessreviewsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SubjectAccessReview), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_task.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_task.go index 3422bc7..2be15b2 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_task.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_task.go @@ -24,20 +24,22 @@ var tasksKind = v1.SchemeGroupVersion.WithKind("Task") // Get takes name of the task, and returns the corresponding task object, and an error if there is any. func (c *FakeTasks) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Task, err error) { + emptyResult := &v1.Task{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(tasksResource, name), &v1.Task{}) + Invokes(testing.NewRootGetActionWithOptions(tasksResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Task), err } // List takes label and field selectors, and returns the list of Tasks that match those selectors. func (c *FakeTasks) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TaskList, err error) { + emptyResult := &v1.TaskList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(tasksResource, tasksKind, opts), &v1.TaskList{}) + Invokes(testing.NewRootListActionWithOptions(tasksResource, tasksKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeTasks) List(ctx context.Context, opts metav1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested tasks. func (c *FakeTasks) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(tasksResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(tasksResource, opts)) } // Create takes the representation of a task and creates it. Returns the server's representation of the task, and an error, if there is any. func (c *FakeTasks) Create(ctx context.Context, task *v1.Task, opts metav1.CreateOptions) (result *v1.Task, err error) { + emptyResult := &v1.Task{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(tasksResource, task), &v1.Task{}) + Invokes(testing.NewRootCreateActionWithOptions(tasksResource, task, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Task), err } // Update takes the representation of a task and updates it. Returns the server's representation of the task, and an error, if there is any. func (c *FakeTasks) Update(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (result *v1.Task, err error) { + emptyResult := &v1.Task{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(tasksResource, task), &v1.Task{}) + Invokes(testing.NewRootUpdateActionWithOptions(tasksResource, task, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Task), 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 *FakeTasks) UpdateStatus(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (*v1.Task, error) { +func (c *FakeTasks) UpdateStatus(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (result *v1.Task, err error) { + emptyResult := &v1.Task{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(tasksResource, "status", task), &v1.Task{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(tasksResource, "status", task, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Task), err } @@ -99,7 +104,7 @@ func (c *FakeTasks) Delete(ctx context.Context, name string, opts metav1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeTasks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(tasksResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(tasksResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.TaskList{}) return err @@ -107,10 +112,11 @@ func (c *FakeTasks) DeleteCollection(ctx context.Context, opts metav1.DeleteOpti // Patch applies the patch and returns the patched task. func (c *FakeTasks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Task, err error) { + emptyResult := &v1.Task{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(tasksResource, name, pt, data, subresources...), &v1.Task{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(tasksResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Task), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_team.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_team.go index e727a4e..bd14d85 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_team.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_team.go @@ -24,20 +24,22 @@ var teamsKind = v1.SchemeGroupVersion.WithKind("Team") // Get takes name of the team, and returns the corresponding team object, and an error if there is any. func (c *FakeTeams) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Team, err error) { + emptyResult := &v1.Team{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(teamsResource, name), &v1.Team{}) + Invokes(testing.NewRootGetActionWithOptions(teamsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Team), err } // List takes label and field selectors, and returns the list of Teams that match those selectors. func (c *FakeTeams) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TeamList, err error) { + emptyResult := &v1.TeamList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(teamsResource, teamsKind, opts), &v1.TeamList{}) + Invokes(testing.NewRootListActionWithOptions(teamsResource, teamsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeTeams) List(ctx context.Context, opts metav1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested teams. func (c *FakeTeams) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(teamsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(teamsResource, opts)) } // Create takes the representation of a team and creates it. Returns the server's representation of the team, and an error, if there is any. func (c *FakeTeams) Create(ctx context.Context, team *v1.Team, opts metav1.CreateOptions) (result *v1.Team, err error) { + emptyResult := &v1.Team{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(teamsResource, team), &v1.Team{}) + Invokes(testing.NewRootCreateActionWithOptions(teamsResource, team, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Team), err } // Update takes the representation of a team and updates it. Returns the server's representation of the team, and an error, if there is any. func (c *FakeTeams) Update(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (result *v1.Team, err error) { + emptyResult := &v1.Team{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(teamsResource, team), &v1.Team{}) + Invokes(testing.NewRootUpdateActionWithOptions(teamsResource, team, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Team), 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 *FakeTeams) UpdateStatus(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (*v1.Team, error) { +func (c *FakeTeams) UpdateStatus(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (result *v1.Team, err error) { + emptyResult := &v1.Team{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(teamsResource, "status", team), &v1.Team{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(teamsResource, "status", team, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Team), err } @@ -99,7 +104,7 @@ func (c *FakeTeams) Delete(ctx context.Context, name string, opts metav1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeTeams) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(teamsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(teamsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.TeamList{}) return err @@ -107,30 +112,33 @@ func (c *FakeTeams) DeleteCollection(ctx context.Context, opts metav1.DeleteOpti // Patch applies the patch and returns the patched team. func (c *FakeTeams) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Team, err error) { + emptyResult := &v1.Team{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(teamsResource, name, pt, data, subresources...), &v1.Team{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(teamsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Team), err } // ListClusters takes name of the team, and returns the corresponding teamClusters object, and an error if there is any. func (c *FakeTeams) ListClusters(ctx context.Context, teamName string, options metav1.GetOptions) (result *v1.TeamClusters, err error) { + emptyResult := &v1.TeamClusters{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(teamsResource, "clusters", teamName), &v1.TeamClusters{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(teamsResource, "clusters", teamName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TeamClusters), err } // ListAccessKeys takes name of the team, and returns the corresponding teamAccessKeys object, and an error if there is any. func (c *FakeTeams) ListAccessKeys(ctx context.Context, teamName string, options metav1.GetOptions) (result *v1.TeamAccessKeys, err error) { + emptyResult := &v1.TeamAccessKeys{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(teamsResource, "accesskeys", teamName), &v1.TeamAccessKeys{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(teamsResource, "accesskeys", teamName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TeamAccessKeys), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_translatevclusterresourcename.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_translatevclusterresourcename.go index f2cc26f..57f1c96 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_translatevclusterresourcename.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_translatevclusterresourcename.go @@ -24,20 +24,22 @@ var translatevclusterresourcenamesKind = v1.SchemeGroupVersion.WithKind("Transla // Get takes name of the translateVClusterResourceName, and returns the corresponding translateVClusterResourceName object, and an error if there is any. func (c *FakeTranslateVClusterResourceNames) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TranslateVClusterResourceName, err error) { + emptyResult := &v1.TranslateVClusterResourceName{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(translatevclusterresourcenamesResource, name), &v1.TranslateVClusterResourceName{}) + Invokes(testing.NewRootGetActionWithOptions(translatevclusterresourcenamesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TranslateVClusterResourceName), err } // List takes label and field selectors, and returns the list of TranslateVClusterResourceNames that match those selectors. func (c *FakeTranslateVClusterResourceNames) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TranslateVClusterResourceNameList, err error) { + emptyResult := &v1.TranslateVClusterResourceNameList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(translatevclusterresourcenamesResource, translatevclusterresourcenamesKind, opts), &v1.TranslateVClusterResourceNameList{}) + Invokes(testing.NewRootListActionWithOptions(translatevclusterresourcenamesResource, translatevclusterresourcenamesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeTranslateVClusterResourceNames) List(ctx context.Context, opts meta // Watch returns a watch.Interface that watches the requested translateVClusterResourceNames. func (c *FakeTranslateVClusterResourceNames) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(translatevclusterresourcenamesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(translatevclusterresourcenamesResource, opts)) } // Create takes the representation of a translateVClusterResourceName and creates it. Returns the server's representation of the translateVClusterResourceName, and an error, if there is any. func (c *FakeTranslateVClusterResourceNames) Create(ctx context.Context, translateVClusterResourceName *v1.TranslateVClusterResourceName, opts metav1.CreateOptions) (result *v1.TranslateVClusterResourceName, err error) { + emptyResult := &v1.TranslateVClusterResourceName{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(translatevclusterresourcenamesResource, translateVClusterResourceName), &v1.TranslateVClusterResourceName{}) + Invokes(testing.NewRootCreateActionWithOptions(translatevclusterresourcenamesResource, translateVClusterResourceName, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TranslateVClusterResourceName), err } // Update takes the representation of a translateVClusterResourceName and updates it. Returns the server's representation of the translateVClusterResourceName, and an error, if there is any. func (c *FakeTranslateVClusterResourceNames) Update(ctx context.Context, translateVClusterResourceName *v1.TranslateVClusterResourceName, opts metav1.UpdateOptions) (result *v1.TranslateVClusterResourceName, err error) { + emptyResult := &v1.TranslateVClusterResourceName{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(translatevclusterresourcenamesResource, translateVClusterResourceName), &v1.TranslateVClusterResourceName{}) + Invokes(testing.NewRootUpdateActionWithOptions(translatevclusterresourcenamesResource, translateVClusterResourceName, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TranslateVClusterResourceName), 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 *FakeTranslateVClusterResourceNames) UpdateStatus(ctx context.Context, translateVClusterResourceName *v1.TranslateVClusterResourceName, opts metav1.UpdateOptions) (*v1.TranslateVClusterResourceName, error) { +func (c *FakeTranslateVClusterResourceNames) UpdateStatus(ctx context.Context, translateVClusterResourceName *v1.TranslateVClusterResourceName, opts metav1.UpdateOptions) (result *v1.TranslateVClusterResourceName, err error) { + emptyResult := &v1.TranslateVClusterResourceName{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(translatevclusterresourcenamesResource, "status", translateVClusterResourceName), &v1.TranslateVClusterResourceName{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(translatevclusterresourcenamesResource, "status", translateVClusterResourceName, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TranslateVClusterResourceName), err } @@ -99,7 +104,7 @@ func (c *FakeTranslateVClusterResourceNames) Delete(ctx context.Context, name st // DeleteCollection deletes a collection of objects. func (c *FakeTranslateVClusterResourceNames) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(translatevclusterresourcenamesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(translatevclusterresourcenamesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.TranslateVClusterResourceNameList{}) return err @@ -107,10 +112,11 @@ func (c *FakeTranslateVClusterResourceNames) DeleteCollection(ctx context.Contex // Patch applies the patch and returns the patched translateVClusterResourceName. func (c *FakeTranslateVClusterResourceNames) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TranslateVClusterResourceName, err error) { + emptyResult := &v1.TranslateVClusterResourceName{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(translatevclusterresourcenamesResource, name, pt, data, subresources...), &v1.TranslateVClusterResourceName{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(translatevclusterresourcenamesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TranslateVClusterResourceName), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_user.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_user.go index 39a50ae..97003ee 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_user.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_user.go @@ -24,20 +24,22 @@ var usersKind = v1.SchemeGroupVersion.WithKind("User") // Get takes name of the user, and returns the corresponding user object, and an error if there is any. func (c *FakeUsers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.User, err error) { + emptyResult := &v1.User{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(usersResource, name), &v1.User{}) + Invokes(testing.NewRootGetActionWithOptions(usersResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.User), err } // List takes label and field selectors, and returns the list of Users that match those selectors. func (c *FakeUsers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.UserList, err error) { + emptyResult := &v1.UserList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(usersResource, usersKind, opts), &v1.UserList{}) + Invokes(testing.NewRootListActionWithOptions(usersResource, usersKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeUsers) List(ctx context.Context, opts metav1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested users. func (c *FakeUsers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(usersResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(usersResource, opts)) } // Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. func (c *FakeUsers) Create(ctx context.Context, user *v1.User, opts metav1.CreateOptions) (result *v1.User, err error) { + emptyResult := &v1.User{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(usersResource, user), &v1.User{}) + Invokes(testing.NewRootCreateActionWithOptions(usersResource, user, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.User), err } // Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. func (c *FakeUsers) Update(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (result *v1.User, err error) { + emptyResult := &v1.User{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(usersResource, user), &v1.User{}) + Invokes(testing.NewRootUpdateActionWithOptions(usersResource, user, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.User), 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 *FakeUsers) UpdateStatus(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (*v1.User, error) { +func (c *FakeUsers) UpdateStatus(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (result *v1.User, err error) { + emptyResult := &v1.User{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(usersResource, "status", user), &v1.User{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(usersResource, "status", user, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.User), err } @@ -99,7 +104,7 @@ func (c *FakeUsers) Delete(ctx context.Context, name string, opts metav1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeUsers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(usersResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(usersResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.UserList{}) return err @@ -107,40 +112,44 @@ func (c *FakeUsers) DeleteCollection(ctx context.Context, opts metav1.DeleteOpti // Patch applies the patch and returns the patched user. func (c *FakeUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.User, err error) { + emptyResult := &v1.User{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(usersResource, name, pt, data, subresources...), &v1.User{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(usersResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.User), err } // GetProfile takes name of the user, and returns the corresponding userProfile object, and an error if there is any. func (c *FakeUsers) GetProfile(ctx context.Context, userName string, options metav1.GetOptions) (result *v1.UserProfile, err error) { + emptyResult := &v1.UserProfile{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(usersResource, "profile", userName), &v1.UserProfile{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(usersResource, "profile", userName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.UserProfile), err } // ListClusters takes name of the user, and returns the corresponding userClusters object, and an error if there is any. func (c *FakeUsers) ListClusters(ctx context.Context, userName string, options metav1.GetOptions) (result *v1.UserClusters, err error) { + emptyResult := &v1.UserClusters{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(usersResource, "clusters", userName), &v1.UserClusters{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(usersResource, "clusters", userName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.UserClusters), err } // ListAccessKeys takes name of the user, and returns the corresponding userAccessKeys object, and an error if there is any. func (c *FakeUsers) ListAccessKeys(ctx context.Context, userName string, options metav1.GetOptions) (result *v1.UserAccessKeys, err error) { + emptyResult := &v1.UserAccessKeys{} obj, err := c.Fake. - Invokes(testing.NewRootGetSubresourceAction(usersResource, "accesskeys", userName), &v1.UserAccessKeys{}) + Invokes(testing.NewRootGetSubresourceActionWithOptions(usersResource, "accesskeys", userName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.UserAccessKeys), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go index 1b74006..56239ae 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go @@ -25,22 +25,24 @@ var virtualclusterinstancesKind = v1.SchemeGroupVersion.WithKind("VirtualCluster // Get takes name of the virtualClusterInstance, and returns the corresponding virtualClusterInstance object, and an error if there is any. func (c *FakeVirtualClusterInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualClusterInstance, err error) { + emptyResult := &v1.VirtualClusterInstance{} obj, err := c.Fake. - Invokes(testing.NewGetAction(virtualclusterinstancesResource, c.ns, name), &v1.VirtualClusterInstance{}) + Invokes(testing.NewGetActionWithOptions(virtualclusterinstancesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterInstance), err } // List takes label and field selectors, and returns the list of VirtualClusterInstances that match those selectors. func (c *FakeVirtualClusterInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualClusterInstanceList, err error) { + emptyResult := &v1.VirtualClusterInstanceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(virtualclusterinstancesResource, virtualclusterinstancesKind, c.ns, opts), &v1.VirtualClusterInstanceList{}) + Invokes(testing.NewListActionWithOptions(virtualclusterinstancesResource, virtualclusterinstancesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,28 +61,30 @@ func (c *FakeVirtualClusterInstances) List(ctx context.Context, opts metav1.List // Watch returns a watch.Interface that watches the requested virtualClusterInstances. func (c *FakeVirtualClusterInstances) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(virtualclusterinstancesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(virtualclusterinstancesResource, c.ns, opts)) } // Create takes the representation of a virtualClusterInstance and creates it. Returns the server's representation of the virtualClusterInstance, and an error, if there is any. func (c *FakeVirtualClusterInstances) Create(ctx context.Context, virtualClusterInstance *v1.VirtualClusterInstance, opts metav1.CreateOptions) (result *v1.VirtualClusterInstance, err error) { + emptyResult := &v1.VirtualClusterInstance{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(virtualclusterinstancesResource, c.ns, virtualClusterInstance), &v1.VirtualClusterInstance{}) + Invokes(testing.NewCreateActionWithOptions(virtualclusterinstancesResource, c.ns, virtualClusterInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterInstance), err } // Update takes the representation of a virtualClusterInstance and updates it. Returns the server's representation of the virtualClusterInstance, and an error, if there is any. func (c *FakeVirtualClusterInstances) Update(ctx context.Context, virtualClusterInstance *v1.VirtualClusterInstance, opts metav1.UpdateOptions) (result *v1.VirtualClusterInstance, err error) { + emptyResult := &v1.VirtualClusterInstance{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(virtualclusterinstancesResource, c.ns, virtualClusterInstance), &v1.VirtualClusterInstance{}) + Invokes(testing.NewUpdateActionWithOptions(virtualclusterinstancesResource, c.ns, virtualClusterInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterInstance), err } @@ -95,7 +99,7 @@ func (c *FakeVirtualClusterInstances) Delete(ctx context.Context, name string, o // DeleteCollection deletes a collection of objects. func (c *FakeVirtualClusterInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(virtualclusterinstancesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(virtualclusterinstancesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.VirtualClusterInstanceList{}) return err @@ -103,33 +107,36 @@ func (c *FakeVirtualClusterInstances) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched virtualClusterInstance. func (c *FakeVirtualClusterInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualClusterInstance, err error) { + emptyResult := &v1.VirtualClusterInstance{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualclusterinstancesResource, c.ns, name, pt, data, subresources...), &v1.VirtualClusterInstance{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(virtualclusterinstancesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterInstance), err } // GetKubeConfig takes the representation of a virtualClusterInstanceKubeConfig and creates it. Returns the server's representation of the virtualClusterInstanceKubeConfig, and an error, if there is any. func (c *FakeVirtualClusterInstances) GetKubeConfig(ctx context.Context, virtualClusterInstanceName string, virtualClusterInstanceKubeConfig *v1.VirtualClusterInstanceKubeConfig, opts metav1.CreateOptions) (result *v1.VirtualClusterInstanceKubeConfig, err error) { + emptyResult := &v1.VirtualClusterInstanceKubeConfig{} obj, err := c.Fake. - Invokes(testing.NewCreateSubresourceAction(virtualclusterinstancesResource, virtualClusterInstanceName, "kubeconfig", c.ns, virtualClusterInstanceKubeConfig), &v1.VirtualClusterInstanceKubeConfig{}) + Invokes(testing.NewCreateSubresourceActionWithOptions(virtualclusterinstancesResource, virtualClusterInstanceName, "kubeconfig", c.ns, virtualClusterInstanceKubeConfig, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterInstanceKubeConfig), err } // GetAccessKey takes name of the virtualClusterInstance, and returns the corresponding virtualClusterAccessKey object, and an error if there is any. func (c *FakeVirtualClusterInstances) GetAccessKey(ctx context.Context, virtualClusterInstanceName string, options metav1.GetOptions) (result *v1.VirtualClusterAccessKey, err error) { + emptyResult := &v1.VirtualClusterAccessKey{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(virtualclusterinstancesResource, c.ns, "accesskey", virtualClusterInstanceName), &v1.VirtualClusterAccessKey{}) + Invokes(testing.NewGetSubresourceActionWithOptions(virtualclusterinstancesResource, c.ns, "accesskey", virtualClusterInstanceName, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterAccessKey), err } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclustertemplate.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclustertemplate.go index 40b20f6..81c37eb 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclustertemplate.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclustertemplate.go @@ -24,20 +24,22 @@ var virtualclustertemplatesKind = v1.SchemeGroupVersion.WithKind("VirtualCluster // Get takes name of the virtualClusterTemplate, and returns the corresponding virtualClusterTemplate object, and an error if there is any. func (c *FakeVirtualClusterTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualClusterTemplate, err error) { + emptyResult := &v1.VirtualClusterTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(virtualclustertemplatesResource, name), &v1.VirtualClusterTemplate{}) + Invokes(testing.NewRootGetActionWithOptions(virtualclustertemplatesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterTemplate), err } // List takes label and field selectors, and returns the list of VirtualClusterTemplates that match those selectors. func (c *FakeVirtualClusterTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualClusterTemplateList, err error) { + emptyResult := &v1.VirtualClusterTemplateList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(virtualclustertemplatesResource, virtualclustertemplatesKind, opts), &v1.VirtualClusterTemplateList{}) + Invokes(testing.NewRootListActionWithOptions(virtualclustertemplatesResource, virtualclustertemplatesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeVirtualClusterTemplates) List(ctx context.Context, opts metav1.List // Watch returns a watch.Interface that watches the requested virtualClusterTemplates. func (c *FakeVirtualClusterTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(virtualclustertemplatesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(virtualclustertemplatesResource, opts)) } // Create takes the representation of a virtualClusterTemplate and creates it. Returns the server's representation of the virtualClusterTemplate, and an error, if there is any. func (c *FakeVirtualClusterTemplates) Create(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.CreateOptions) (result *v1.VirtualClusterTemplate, err error) { + emptyResult := &v1.VirtualClusterTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(virtualclustertemplatesResource, virtualClusterTemplate), &v1.VirtualClusterTemplate{}) + Invokes(testing.NewRootCreateActionWithOptions(virtualclustertemplatesResource, virtualClusterTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterTemplate), err } // Update takes the representation of a virtualClusterTemplate and updates it. Returns the server's representation of the virtualClusterTemplate, and an error, if there is any. func (c *FakeVirtualClusterTemplates) Update(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (result *v1.VirtualClusterTemplate, err error) { + emptyResult := &v1.VirtualClusterTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(virtualclustertemplatesResource, virtualClusterTemplate), &v1.VirtualClusterTemplate{}) + Invokes(testing.NewRootUpdateActionWithOptions(virtualclustertemplatesResource, virtualClusterTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterTemplate), 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 *FakeVirtualClusterTemplates) UpdateStatus(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (*v1.VirtualClusterTemplate, error) { +func (c *FakeVirtualClusterTemplates) UpdateStatus(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (result *v1.VirtualClusterTemplate, err error) { + emptyResult := &v1.VirtualClusterTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(virtualclustertemplatesResource, "status", virtualClusterTemplate), &v1.VirtualClusterTemplate{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(virtualclustertemplatesResource, "status", virtualClusterTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterTemplate), err } @@ -99,7 +104,7 @@ func (c *FakeVirtualClusterTemplates) Delete(ctx context.Context, name string, o // DeleteCollection deletes a collection of objects. func (c *FakeVirtualClusterTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(virtualclustertemplatesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(virtualclustertemplatesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.VirtualClusterTemplateList{}) return err @@ -107,10 +112,11 @@ func (c *FakeVirtualClusterTemplates) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched virtualClusterTemplate. func (c *FakeVirtualClusterTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualClusterTemplate, err error) { + emptyResult := &v1.VirtualClusterTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(virtualclustertemplatesResource, name, pt, data, subresources...), &v1.VirtualClusterTemplate{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(virtualclustertemplatesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterTemplate), err } diff --git a/pkg/clientset/versioned/typed/management/v1/feature.go b/pkg/clientset/versioned/typed/management/v1/feature.go index 1f3db5b..feaf4a8 100644 --- a/pkg/clientset/versioned/typed/management/v1/feature.go +++ b/pkg/clientset/versioned/typed/management/v1/feature.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // FeaturesGetter has a method to return a FeatureInterface. @@ -24,6 +23,7 @@ type FeaturesGetter interface { type FeatureInterface interface { Create(ctx context.Context, feature *v1.Feature, opts metav1.CreateOptions) (*v1.Feature, error) Update(ctx context.Context, feature *v1.Feature, opts metav1.UpdateOptions) (*v1.Feature, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, feature *v1.Feature, opts metav1.UpdateOptions) (*v1.Feature, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type FeatureInterface interface { // features implements FeatureInterface type features struct { - client rest.Interface + *gentype.ClientWithList[*v1.Feature, *v1.FeatureList] } // newFeatures returns a Features func newFeatures(c *ManagementV1Client) *features { return &features{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Feature, *v1.FeatureList]( + "features", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Feature { return &v1.Feature{} }, + func() *v1.FeatureList { return &v1.FeatureList{} }), } } - -// Get takes name of the feature, and returns the corresponding feature object, and an error if there is any. -func (c *features) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Feature, err error) { - result = &v1.Feature{} - err = c.client.Get(). - Resource("features"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Features that match those selectors. -func (c *features) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FeatureList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.FeatureList{} - err = c.client.Get(). - Resource("features"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested features. -func (c *features) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("features"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a feature and creates it. Returns the server's representation of the feature, and an error, if there is any. -func (c *features) Create(ctx context.Context, feature *v1.Feature, opts metav1.CreateOptions) (result *v1.Feature, err error) { - result = &v1.Feature{} - err = c.client.Post(). - Resource("features"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(feature). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a feature and updates it. Returns the server's representation of the feature, and an error, if there is any. -func (c *features) Update(ctx context.Context, feature *v1.Feature, opts metav1.UpdateOptions) (result *v1.Feature, err error) { - result = &v1.Feature{} - err = c.client.Put(). - Resource("features"). - Name(feature.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(feature). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *features) UpdateStatus(ctx context.Context, feature *v1.Feature, opts metav1.UpdateOptions) (result *v1.Feature, err error) { - result = &v1.Feature{} - err = c.client.Put(). - Resource("features"). - Name(feature.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(feature). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the feature and deletes it. Returns an error if one occurs. -func (c *features) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("features"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *features) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("features"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched feature. -func (c *features) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Feature, err error) { - result = &v1.Feature{} - err = c.client.Patch(pt). - Resource("features"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/ingressauthtoken.go b/pkg/clientset/versioned/typed/management/v1/ingressauthtoken.go index 6e1ff63..44ed84a 100644 --- a/pkg/clientset/versioned/typed/management/v1/ingressauthtoken.go +++ b/pkg/clientset/versioned/typed/management/v1/ingressauthtoken.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // IngressAuthTokensGetter has a method to return a IngressAuthTokenInterface. @@ -24,6 +23,7 @@ type IngressAuthTokensGetter interface { type IngressAuthTokenInterface interface { Create(ctx context.Context, ingressAuthToken *v1.IngressAuthToken, opts metav1.CreateOptions) (*v1.IngressAuthToken, error) Update(ctx context.Context, ingressAuthToken *v1.IngressAuthToken, opts metav1.UpdateOptions) (*v1.IngressAuthToken, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, ingressAuthToken *v1.IngressAuthToken, opts metav1.UpdateOptions) (*v1.IngressAuthToken, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type IngressAuthTokenInterface interface { // ingressAuthTokens implements IngressAuthTokenInterface type ingressAuthTokens struct { - client rest.Interface + *gentype.ClientWithList[*v1.IngressAuthToken, *v1.IngressAuthTokenList] } // newIngressAuthTokens returns a IngressAuthTokens func newIngressAuthTokens(c *ManagementV1Client) *ingressAuthTokens { return &ingressAuthTokens{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.IngressAuthToken, *v1.IngressAuthTokenList]( + "ingressauthtokens", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.IngressAuthToken { return &v1.IngressAuthToken{} }, + func() *v1.IngressAuthTokenList { return &v1.IngressAuthTokenList{} }), } } - -// Get takes name of the ingressAuthToken, and returns the corresponding ingressAuthToken object, and an error if there is any. -func (c *ingressAuthTokens) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IngressAuthToken, err error) { - result = &v1.IngressAuthToken{} - err = c.client.Get(). - Resource("ingressauthtokens"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of IngressAuthTokens that match those selectors. -func (c *ingressAuthTokens) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressAuthTokenList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.IngressAuthTokenList{} - err = c.client.Get(). - Resource("ingressauthtokens"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested ingressAuthTokens. -func (c *ingressAuthTokens) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("ingressauthtokens"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a ingressAuthToken and creates it. Returns the server's representation of the ingressAuthToken, and an error, if there is any. -func (c *ingressAuthTokens) Create(ctx context.Context, ingressAuthToken *v1.IngressAuthToken, opts metav1.CreateOptions) (result *v1.IngressAuthToken, err error) { - result = &v1.IngressAuthToken{} - err = c.client.Post(). - Resource("ingressauthtokens"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingressAuthToken). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a ingressAuthToken and updates it. Returns the server's representation of the ingressAuthToken, and an error, if there is any. -func (c *ingressAuthTokens) Update(ctx context.Context, ingressAuthToken *v1.IngressAuthToken, opts metav1.UpdateOptions) (result *v1.IngressAuthToken, err error) { - result = &v1.IngressAuthToken{} - err = c.client.Put(). - Resource("ingressauthtokens"). - Name(ingressAuthToken.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingressAuthToken). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *ingressAuthTokens) UpdateStatus(ctx context.Context, ingressAuthToken *v1.IngressAuthToken, opts metav1.UpdateOptions) (result *v1.IngressAuthToken, err error) { - result = &v1.IngressAuthToken{} - err = c.client.Put(). - Resource("ingressauthtokens"). - Name(ingressAuthToken.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingressAuthToken). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the ingressAuthToken and deletes it. Returns an error if one occurs. -func (c *ingressAuthTokens) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("ingressauthtokens"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *ingressAuthTokens) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("ingressauthtokens"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched ingressAuthToken. -func (c *ingressAuthTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IngressAuthToken, err error) { - result = &v1.IngressAuthToken{} - err = c.client.Patch(pt). - Resource("ingressauthtokens"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/license.go b/pkg/clientset/versioned/typed/management/v1/license.go index 2821862..b4268ed 100644 --- a/pkg/clientset/versioned/typed/management/v1/license.go +++ b/pkg/clientset/versioned/typed/management/v1/license.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // LicensesGetter has a method to return a LicenseInterface. @@ -24,6 +23,7 @@ type LicensesGetter interface { type LicenseInterface interface { Create(ctx context.Context, license *v1.License, opts metav1.CreateOptions) (*v1.License, error) Update(ctx context.Context, license *v1.License, opts metav1.UpdateOptions) (*v1.License, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, license *v1.License, opts metav1.UpdateOptions) (*v1.License, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -38,141 +38,26 @@ type LicenseInterface interface { // licenses implements LicenseInterface type licenses struct { - client rest.Interface + *gentype.ClientWithList[*v1.License, *v1.LicenseList] } // newLicenses returns a Licenses func newLicenses(c *ManagementV1Client) *licenses { return &licenses{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.License, *v1.LicenseList]( + "licenses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.License { return &v1.License{} }, + func() *v1.LicenseList { return &v1.LicenseList{} }), } } -// Get takes name of the license, and returns the corresponding license object, and an error if there is any. -func (c *licenses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.License, err error) { - result = &v1.License{} - err = c.client.Get(). - Resource("licenses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Licenses that match those selectors. -func (c *licenses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LicenseList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.LicenseList{} - err = c.client.Get(). - Resource("licenses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested licenses. -func (c *licenses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("licenses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a license and creates it. Returns the server's representation of the license, and an error, if there is any. -func (c *licenses) Create(ctx context.Context, license *v1.License, opts metav1.CreateOptions) (result *v1.License, err error) { - result = &v1.License{} - err = c.client.Post(). - Resource("licenses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(license). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a license and updates it. Returns the server's representation of the license, and an error, if there is any. -func (c *licenses) Update(ctx context.Context, license *v1.License, opts metav1.UpdateOptions) (result *v1.License, err error) { - result = &v1.License{} - err = c.client.Put(). - Resource("licenses"). - Name(license.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(license). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *licenses) UpdateStatus(ctx context.Context, license *v1.License, opts metav1.UpdateOptions) (result *v1.License, err error) { - result = &v1.License{} - err = c.client.Put(). - Resource("licenses"). - Name(license.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(license). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the license and deletes it. Returns an error if one occurs. -func (c *licenses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("licenses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *licenses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("licenses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched license. -func (c *licenses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.License, err error) { - result = &v1.License{} - err = c.client.Patch(pt). - Resource("licenses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // LicenseRequest takes the representation of a licenseRequest and creates it. Returns the server's representation of the licenseRequest, and an error, if there is any. func (c *licenses) LicenseRequest(ctx context.Context, licenseName string, licenseRequest *v1.LicenseRequest, opts metav1.CreateOptions) (result *v1.LicenseRequest, err error) { result = &v1.LicenseRequest{} - err = c.client.Post(). + err = c.GetClient().Post(). Resource("licenses"). Name(licenseName). SubResource("request"). diff --git a/pkg/clientset/versioned/typed/management/v1/licensetoken.go b/pkg/clientset/versioned/typed/management/v1/licensetoken.go index 3c8c728..1c5a572 100644 --- a/pkg/clientset/versioned/typed/management/v1/licensetoken.go +++ b/pkg/clientset/versioned/typed/management/v1/licensetoken.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // LicenseTokensGetter has a method to return a LicenseTokenInterface. @@ -24,6 +23,7 @@ type LicenseTokensGetter interface { type LicenseTokenInterface interface { Create(ctx context.Context, licenseToken *v1.LicenseToken, opts metav1.CreateOptions) (*v1.LicenseToken, error) Update(ctx context.Context, licenseToken *v1.LicenseToken, opts metav1.UpdateOptions) (*v1.LicenseToken, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, licenseToken *v1.LicenseToken, opts metav1.UpdateOptions) (*v1.LicenseToken, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type LicenseTokenInterface interface { // licenseTokens implements LicenseTokenInterface type licenseTokens struct { - client rest.Interface + *gentype.ClientWithList[*v1.LicenseToken, *v1.LicenseTokenList] } // newLicenseTokens returns a LicenseTokens func newLicenseTokens(c *ManagementV1Client) *licenseTokens { return &licenseTokens{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.LicenseToken, *v1.LicenseTokenList]( + "licensetokens", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.LicenseToken { return &v1.LicenseToken{} }, + func() *v1.LicenseTokenList { return &v1.LicenseTokenList{} }), } } - -// Get takes name of the licenseToken, and returns the corresponding licenseToken object, and an error if there is any. -func (c *licenseTokens) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LicenseToken, err error) { - result = &v1.LicenseToken{} - err = c.client.Get(). - Resource("licensetokens"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of LicenseTokens that match those selectors. -func (c *licenseTokens) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LicenseTokenList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.LicenseTokenList{} - err = c.client.Get(). - Resource("licensetokens"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested licenseTokens. -func (c *licenseTokens) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("licensetokens"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a licenseToken and creates it. Returns the server's representation of the licenseToken, and an error, if there is any. -func (c *licenseTokens) Create(ctx context.Context, licenseToken *v1.LicenseToken, opts metav1.CreateOptions) (result *v1.LicenseToken, err error) { - result = &v1.LicenseToken{} - err = c.client.Post(). - Resource("licensetokens"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(licenseToken). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a licenseToken and updates it. Returns the server's representation of the licenseToken, and an error, if there is any. -func (c *licenseTokens) Update(ctx context.Context, licenseToken *v1.LicenseToken, opts metav1.UpdateOptions) (result *v1.LicenseToken, err error) { - result = &v1.LicenseToken{} - err = c.client.Put(). - Resource("licensetokens"). - Name(licenseToken.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(licenseToken). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *licenseTokens) UpdateStatus(ctx context.Context, licenseToken *v1.LicenseToken, opts metav1.UpdateOptions) (result *v1.LicenseToken, err error) { - result = &v1.LicenseToken{} - err = c.client.Put(). - Resource("licensetokens"). - Name(licenseToken.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(licenseToken). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the licenseToken and deletes it. Returns an error if one occurs. -func (c *licenseTokens) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("licensetokens"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *licenseTokens) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("licensetokens"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched licenseToken. -func (c *licenseTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LicenseToken, err error) { - result = &v1.LicenseToken{} - err = c.client.Patch(pt). - Resource("licensetokens"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/loftupgrade.go b/pkg/clientset/versioned/typed/management/v1/loftupgrade.go index e29e7ea..3f54314 100644 --- a/pkg/clientset/versioned/typed/management/v1/loftupgrade.go +++ b/pkg/clientset/versioned/typed/management/v1/loftupgrade.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // LoftUpgradesGetter has a method to return a LoftUpgradeInterface. @@ -24,6 +23,7 @@ type LoftUpgradesGetter interface { type LoftUpgradeInterface interface { Create(ctx context.Context, loftUpgrade *v1.LoftUpgrade, opts metav1.CreateOptions) (*v1.LoftUpgrade, error) Update(ctx context.Context, loftUpgrade *v1.LoftUpgrade, opts metav1.UpdateOptions) (*v1.LoftUpgrade, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, loftUpgrade *v1.LoftUpgrade, opts metav1.UpdateOptions) (*v1.LoftUpgrade, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type LoftUpgradeInterface interface { // loftUpgrades implements LoftUpgradeInterface type loftUpgrades struct { - client rest.Interface + *gentype.ClientWithList[*v1.LoftUpgrade, *v1.LoftUpgradeList] } // newLoftUpgrades returns a LoftUpgrades func newLoftUpgrades(c *ManagementV1Client) *loftUpgrades { return &loftUpgrades{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.LoftUpgrade, *v1.LoftUpgradeList]( + "loftupgrades", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.LoftUpgrade { return &v1.LoftUpgrade{} }, + func() *v1.LoftUpgradeList { return &v1.LoftUpgradeList{} }), } } - -// Get takes name of the loftUpgrade, and returns the corresponding loftUpgrade object, and an error if there is any. -func (c *loftUpgrades) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LoftUpgrade, err error) { - result = &v1.LoftUpgrade{} - err = c.client.Get(). - Resource("loftupgrades"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of LoftUpgrades that match those selectors. -func (c *loftUpgrades) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LoftUpgradeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.LoftUpgradeList{} - err = c.client.Get(). - Resource("loftupgrades"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested loftUpgrades. -func (c *loftUpgrades) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("loftupgrades"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a loftUpgrade and creates it. Returns the server's representation of the loftUpgrade, and an error, if there is any. -func (c *loftUpgrades) Create(ctx context.Context, loftUpgrade *v1.LoftUpgrade, opts metav1.CreateOptions) (result *v1.LoftUpgrade, err error) { - result = &v1.LoftUpgrade{} - err = c.client.Post(). - Resource("loftupgrades"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(loftUpgrade). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a loftUpgrade and updates it. Returns the server's representation of the loftUpgrade, and an error, if there is any. -func (c *loftUpgrades) Update(ctx context.Context, loftUpgrade *v1.LoftUpgrade, opts metav1.UpdateOptions) (result *v1.LoftUpgrade, err error) { - result = &v1.LoftUpgrade{} - err = c.client.Put(). - Resource("loftupgrades"). - Name(loftUpgrade.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(loftUpgrade). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *loftUpgrades) UpdateStatus(ctx context.Context, loftUpgrade *v1.LoftUpgrade, opts metav1.UpdateOptions) (result *v1.LoftUpgrade, err error) { - result = &v1.LoftUpgrade{} - err = c.client.Put(). - Resource("loftupgrades"). - Name(loftUpgrade.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(loftUpgrade). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the loftUpgrade and deletes it. Returns an error if one occurs. -func (c *loftUpgrades) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("loftupgrades"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *loftUpgrades) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("loftupgrades"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched loftUpgrade. -func (c *loftUpgrades) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LoftUpgrade, err error) { - result = &v1.LoftUpgrade{} - err = c.client.Patch(pt). - Resource("loftupgrades"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/oidcclient.go b/pkg/clientset/versioned/typed/management/v1/oidcclient.go index 260ffa4..5cf9151 100644 --- a/pkg/clientset/versioned/typed/management/v1/oidcclient.go +++ b/pkg/clientset/versioned/typed/management/v1/oidcclient.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // OIDCClientsGetter has a method to return a OIDCClientInterface. @@ -24,6 +23,7 @@ type OIDCClientsGetter interface { type OIDCClientInterface interface { Create(ctx context.Context, oIDCClient *v1.OIDCClient, opts metav1.CreateOptions) (*v1.OIDCClient, error) Update(ctx context.Context, oIDCClient *v1.OIDCClient, opts metav1.UpdateOptions) (*v1.OIDCClient, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, oIDCClient *v1.OIDCClient, opts metav1.UpdateOptions) (*v1.OIDCClient, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type OIDCClientInterface interface { // oIDCClients implements OIDCClientInterface type oIDCClients struct { - client rest.Interface + *gentype.ClientWithList[*v1.OIDCClient, *v1.OIDCClientList] } // newOIDCClients returns a OIDCClients func newOIDCClients(c *ManagementV1Client) *oIDCClients { return &oIDCClients{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.OIDCClient, *v1.OIDCClientList]( + "oidcclients", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.OIDCClient { return &v1.OIDCClient{} }, + func() *v1.OIDCClientList { return &v1.OIDCClientList{} }), } } - -// Get takes name of the oIDCClient, and returns the corresponding oIDCClient object, and an error if there is any. -func (c *oIDCClients) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OIDCClient, err error) { - result = &v1.OIDCClient{} - err = c.client.Get(). - Resource("oidcclients"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of OIDCClients that match those selectors. -func (c *oIDCClients) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OIDCClientList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.OIDCClientList{} - err = c.client.Get(). - Resource("oidcclients"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested oIDCClients. -func (c *oIDCClients) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("oidcclients"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a oIDCClient and creates it. Returns the server's representation of the oIDCClient, and an error, if there is any. -func (c *oIDCClients) Create(ctx context.Context, oIDCClient *v1.OIDCClient, opts metav1.CreateOptions) (result *v1.OIDCClient, err error) { - result = &v1.OIDCClient{} - err = c.client.Post(). - Resource("oidcclients"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(oIDCClient). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a oIDCClient and updates it. Returns the server's representation of the oIDCClient, and an error, if there is any. -func (c *oIDCClients) Update(ctx context.Context, oIDCClient *v1.OIDCClient, opts metav1.UpdateOptions) (result *v1.OIDCClient, err error) { - result = &v1.OIDCClient{} - err = c.client.Put(). - Resource("oidcclients"). - Name(oIDCClient.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(oIDCClient). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *oIDCClients) UpdateStatus(ctx context.Context, oIDCClient *v1.OIDCClient, opts metav1.UpdateOptions) (result *v1.OIDCClient, err error) { - result = &v1.OIDCClient{} - err = c.client.Put(). - Resource("oidcclients"). - Name(oIDCClient.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(oIDCClient). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the oIDCClient and deletes it. Returns an error if one occurs. -func (c *oIDCClients) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("oidcclients"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *oIDCClients) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("oidcclients"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched oIDCClient. -func (c *oIDCClients) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OIDCClient, err error) { - result = &v1.OIDCClient{} - err = c.client.Patch(pt). - Resource("oidcclients"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/ownedaccesskey.go b/pkg/clientset/versioned/typed/management/v1/ownedaccesskey.go index 987452d..9544c3c 100644 --- a/pkg/clientset/versioned/typed/management/v1/ownedaccesskey.go +++ b/pkg/clientset/versioned/typed/management/v1/ownedaccesskey.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // OwnedAccessKeysGetter has a method to return a OwnedAccessKeyInterface. @@ -24,6 +23,7 @@ type OwnedAccessKeysGetter interface { type OwnedAccessKeyInterface interface { Create(ctx context.Context, ownedAccessKey *v1.OwnedAccessKey, opts metav1.CreateOptions) (*v1.OwnedAccessKey, error) Update(ctx context.Context, ownedAccessKey *v1.OwnedAccessKey, opts metav1.UpdateOptions) (*v1.OwnedAccessKey, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, ownedAccessKey *v1.OwnedAccessKey, opts metav1.UpdateOptions) (*v1.OwnedAccessKey, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type OwnedAccessKeyInterface interface { // ownedAccessKeys implements OwnedAccessKeyInterface type ownedAccessKeys struct { - client rest.Interface + *gentype.ClientWithList[*v1.OwnedAccessKey, *v1.OwnedAccessKeyList] } // newOwnedAccessKeys returns a OwnedAccessKeys func newOwnedAccessKeys(c *ManagementV1Client) *ownedAccessKeys { return &ownedAccessKeys{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.OwnedAccessKey, *v1.OwnedAccessKeyList]( + "ownedaccesskeys", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.OwnedAccessKey { return &v1.OwnedAccessKey{} }, + func() *v1.OwnedAccessKeyList { return &v1.OwnedAccessKeyList{} }), } } - -// Get takes name of the ownedAccessKey, and returns the corresponding ownedAccessKey object, and an error if there is any. -func (c *ownedAccessKeys) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.OwnedAccessKey, err error) { - result = &v1.OwnedAccessKey{} - err = c.client.Get(). - Resource("ownedaccesskeys"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of OwnedAccessKeys that match those selectors. -func (c *ownedAccessKeys) List(ctx context.Context, opts metav1.ListOptions) (result *v1.OwnedAccessKeyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.OwnedAccessKeyList{} - err = c.client.Get(). - Resource("ownedaccesskeys"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested ownedAccessKeys. -func (c *ownedAccessKeys) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("ownedaccesskeys"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a ownedAccessKey and creates it. Returns the server's representation of the ownedAccessKey, and an error, if there is any. -func (c *ownedAccessKeys) Create(ctx context.Context, ownedAccessKey *v1.OwnedAccessKey, opts metav1.CreateOptions) (result *v1.OwnedAccessKey, err error) { - result = &v1.OwnedAccessKey{} - err = c.client.Post(). - Resource("ownedaccesskeys"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ownedAccessKey). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a ownedAccessKey and updates it. Returns the server's representation of the ownedAccessKey, and an error, if there is any. -func (c *ownedAccessKeys) Update(ctx context.Context, ownedAccessKey *v1.OwnedAccessKey, opts metav1.UpdateOptions) (result *v1.OwnedAccessKey, err error) { - result = &v1.OwnedAccessKey{} - err = c.client.Put(). - Resource("ownedaccesskeys"). - Name(ownedAccessKey.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ownedAccessKey). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *ownedAccessKeys) UpdateStatus(ctx context.Context, ownedAccessKey *v1.OwnedAccessKey, opts metav1.UpdateOptions) (result *v1.OwnedAccessKey, err error) { - result = &v1.OwnedAccessKey{} - err = c.client.Put(). - Resource("ownedaccesskeys"). - Name(ownedAccessKey.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ownedAccessKey). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the ownedAccessKey and deletes it. Returns an error if one occurs. -func (c *ownedAccessKeys) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("ownedaccesskeys"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *ownedAccessKeys) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("ownedaccesskeys"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched ownedAccessKey. -func (c *ownedAccessKeys) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.OwnedAccessKey, err error) { - result = &v1.OwnedAccessKey{} - err = c.client.Patch(pt). - Resource("ownedaccesskeys"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/project.go b/pkg/clientset/versioned/typed/management/v1/project.go index ad706de..1c0e65e 100644 --- a/pkg/clientset/versioned/typed/management/v1/project.go +++ b/pkg/clientset/versioned/typed/management/v1/project.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ProjectsGetter has a method to return a ProjectInterface. @@ -24,6 +23,7 @@ type ProjectsGetter interface { type ProjectInterface interface { Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (*v1.Project, error) Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (*v1.Project, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (*v1.Project, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -44,141 +44,26 @@ type ProjectInterface interface { // projects implements ProjectInterface type projects struct { - client rest.Interface + *gentype.ClientWithList[*v1.Project, *v1.ProjectList] } // newProjects returns a Projects func newProjects(c *ManagementV1Client) *projects { return &projects{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Project, *v1.ProjectList]( + "projects", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Project { return &v1.Project{} }, + func() *v1.ProjectList { return &v1.ProjectList{} }), } } -// Get takes name of the project, and returns the corresponding project object, and an error if there is any. -func (c *projects) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Project, err error) { - result = &v1.Project{} - err = c.client.Get(). - Resource("projects"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Projects that match those selectors. -func (c *projects) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ProjectList{} - err = c.client.Get(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested projects. -func (c *projects) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. -func (c *projects) Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (result *v1.Project, err error) { - result = &v1.Project{} - err = c.client.Post(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(project). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. -func (c *projects) Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) { - result = &v1.Project{} - err = c.client.Put(). - Resource("projects"). - Name(project.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(project). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *projects) UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) { - result = &v1.Project{} - err = c.client.Put(). - Resource("projects"). - Name(project.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(project). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the project and deletes it. Returns an error if one occurs. -func (c *projects) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("projects"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *projects) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("projects"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched project. -func (c *projects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Project, err error) { - result = &v1.Project{} - err = c.client.Patch(pt). - Resource("projects"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // ListMembers takes name of the project, and returns the corresponding v1.ProjectMembers object, and an error if there is any. func (c *projects) ListMembers(ctx context.Context, projectName string, options metav1.GetOptions) (result *v1.ProjectMembers, err error) { result = &v1.ProjectMembers{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("projects"). Name(projectName). SubResource("members"). @@ -191,7 +76,7 @@ func (c *projects) ListMembers(ctx context.Context, projectName string, options // ListTemplates takes name of the project, and returns the corresponding v1.ProjectTemplates object, and an error if there is any. func (c *projects) ListTemplates(ctx context.Context, projectName string, options metav1.GetOptions) (result *v1.ProjectTemplates, err error) { result = &v1.ProjectTemplates{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("projects"). Name(projectName). SubResource("templates"). @@ -204,7 +89,7 @@ func (c *projects) ListTemplates(ctx context.Context, projectName string, option // ListRunners takes name of the project, and returns the corresponding v1.ProjectRunners object, and an error if there is any. func (c *projects) ListRunners(ctx context.Context, projectName string, options metav1.GetOptions) (result *v1.ProjectRunners, err error) { result = &v1.ProjectRunners{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("projects"). Name(projectName). SubResource("runners"). @@ -217,7 +102,7 @@ func (c *projects) ListRunners(ctx context.Context, projectName string, options // ListClusters takes name of the project, and returns the corresponding v1.ProjectClusters object, and an error if there is any. func (c *projects) ListClusters(ctx context.Context, projectName string, options metav1.GetOptions) (result *v1.ProjectClusters, err error) { result = &v1.ProjectClusters{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("projects"). Name(projectName). SubResource("clusters"). @@ -230,7 +115,7 @@ func (c *projects) ListClusters(ctx context.Context, projectName string, options // MigrateVirtualClusterInstance takes the representation of a projectMigrateVirtualClusterInstance and creates it. Returns the server's representation of the projectMigrateVirtualClusterInstance, and an error, if there is any. func (c *projects) MigrateVirtualClusterInstance(ctx context.Context, projectName string, projectMigrateVirtualClusterInstance *v1.ProjectMigrateVirtualClusterInstance, opts metav1.CreateOptions) (result *v1.ProjectMigrateVirtualClusterInstance, err error) { result = &v1.ProjectMigrateVirtualClusterInstance{} - err = c.client.Post(). + err = c.GetClient().Post(). Resource("projects"). Name(projectName). SubResource("migratevirtualclusterinstance"). @@ -244,7 +129,7 @@ func (c *projects) MigrateVirtualClusterInstance(ctx context.Context, projectNam // ImportSpace takes the representation of a projectImportSpace and creates it. Returns the server's representation of the projectImportSpace, and an error, if there is any. func (c *projects) ImportSpace(ctx context.Context, projectName string, projectImportSpace *v1.ProjectImportSpace, opts metav1.CreateOptions) (result *v1.ProjectImportSpace, err error) { result = &v1.ProjectImportSpace{} - err = c.client.Post(). + err = c.GetClient().Post(). Resource("projects"). Name(projectName). SubResource("importspace"). @@ -258,7 +143,7 @@ func (c *projects) ImportSpace(ctx context.Context, projectName string, projectI // MigrateSpaceInstance takes the representation of a projectMigrateSpaceInstance and creates it. Returns the server's representation of the projectMigrateSpaceInstance, and an error, if there is any. func (c *projects) MigrateSpaceInstance(ctx context.Context, projectName string, projectMigrateSpaceInstance *v1.ProjectMigrateSpaceInstance, opts metav1.CreateOptions) (result *v1.ProjectMigrateSpaceInstance, err error) { result = &v1.ProjectMigrateSpaceInstance{} - err = c.client.Post(). + err = c.GetClient().Post(). Resource("projects"). Name(projectName). SubResource("migratespaceinstance"). diff --git a/pkg/clientset/versioned/typed/management/v1/projectsecret.go b/pkg/clientset/versioned/typed/management/v1/projectsecret.go index ef3c898..6033e7f 100644 --- a/pkg/clientset/versioned/typed/management/v1/projectsecret.go +++ b/pkg/clientset/versioned/typed/management/v1/projectsecret.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ProjectSecretsGetter has a method to return a ProjectSecretInterface. @@ -35,128 +34,18 @@ type ProjectSecretInterface interface { // projectSecrets implements ProjectSecretInterface type projectSecrets struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.ProjectSecret, *v1.ProjectSecretList] } // newProjectSecrets returns a ProjectSecrets func newProjectSecrets(c *ManagementV1Client, namespace string) *projectSecrets { return &projectSecrets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.ProjectSecret, *v1.ProjectSecretList]( + "projectsecrets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.ProjectSecret { return &v1.ProjectSecret{} }, + func() *v1.ProjectSecretList { return &v1.ProjectSecretList{} }), } } - -// Get takes name of the projectSecret, and returns the corresponding projectSecret object, and an error if there is any. -func (c *projectSecrets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ProjectSecret, err error) { - result = &v1.ProjectSecret{} - err = c.client.Get(). - Namespace(c.ns). - Resource("projectsecrets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ProjectSecrets that match those selectors. -func (c *projectSecrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectSecretList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ProjectSecretList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("projectsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested projectSecrets. -func (c *projectSecrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("projectsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a projectSecret and creates it. Returns the server's representation of the projectSecret, and an error, if there is any. -func (c *projectSecrets) Create(ctx context.Context, projectSecret *v1.ProjectSecret, opts metav1.CreateOptions) (result *v1.ProjectSecret, err error) { - result = &v1.ProjectSecret{} - err = c.client.Post(). - Namespace(c.ns). - Resource("projectsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(projectSecret). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a projectSecret and updates it. Returns the server's representation of the projectSecret, and an error, if there is any. -func (c *projectSecrets) Update(ctx context.Context, projectSecret *v1.ProjectSecret, opts metav1.UpdateOptions) (result *v1.ProjectSecret, err error) { - result = &v1.ProjectSecret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("projectsecrets"). - Name(projectSecret.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(projectSecret). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the projectSecret and deletes it. Returns an error if one occurs. -func (c *projectSecrets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("projectsecrets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *projectSecrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("projectsecrets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched projectSecret. -func (c *projectSecrets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ProjectSecret, err error) { - result = &v1.ProjectSecret{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("projectsecrets"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/redirecttoken.go b/pkg/clientset/versioned/typed/management/v1/redirecttoken.go index 124b8f0..7b58308 100644 --- a/pkg/clientset/versioned/typed/management/v1/redirecttoken.go +++ b/pkg/clientset/versioned/typed/management/v1/redirecttoken.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // RedirectTokensGetter has a method to return a RedirectTokenInterface. @@ -24,6 +23,7 @@ type RedirectTokensGetter interface { type RedirectTokenInterface interface { Create(ctx context.Context, redirectToken *v1.RedirectToken, opts metav1.CreateOptions) (*v1.RedirectToken, error) Update(ctx context.Context, redirectToken *v1.RedirectToken, opts metav1.UpdateOptions) (*v1.RedirectToken, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, redirectToken *v1.RedirectToken, opts metav1.UpdateOptions) (*v1.RedirectToken, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type RedirectTokenInterface interface { // redirectTokens implements RedirectTokenInterface type redirectTokens struct { - client rest.Interface + *gentype.ClientWithList[*v1.RedirectToken, *v1.RedirectTokenList] } // newRedirectTokens returns a RedirectTokens func newRedirectTokens(c *ManagementV1Client) *redirectTokens { return &redirectTokens{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.RedirectToken, *v1.RedirectTokenList]( + "redirecttokens", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.RedirectToken { return &v1.RedirectToken{} }, + func() *v1.RedirectTokenList { return &v1.RedirectTokenList{} }), } } - -// Get takes name of the redirectToken, and returns the corresponding redirectToken object, and an error if there is any. -func (c *redirectTokens) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RedirectToken, err error) { - result = &v1.RedirectToken{} - err = c.client.Get(). - Resource("redirecttokens"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RedirectTokens that match those selectors. -func (c *redirectTokens) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RedirectTokenList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RedirectTokenList{} - err = c.client.Get(). - Resource("redirecttokens"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested redirectTokens. -func (c *redirectTokens) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("redirecttokens"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a redirectToken and creates it. Returns the server's representation of the redirectToken, and an error, if there is any. -func (c *redirectTokens) Create(ctx context.Context, redirectToken *v1.RedirectToken, opts metav1.CreateOptions) (result *v1.RedirectToken, err error) { - result = &v1.RedirectToken{} - err = c.client.Post(). - Resource("redirecttokens"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(redirectToken). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a redirectToken and updates it. Returns the server's representation of the redirectToken, and an error, if there is any. -func (c *redirectTokens) Update(ctx context.Context, redirectToken *v1.RedirectToken, opts metav1.UpdateOptions) (result *v1.RedirectToken, err error) { - result = &v1.RedirectToken{} - err = c.client.Put(). - Resource("redirecttokens"). - Name(redirectToken.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(redirectToken). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *redirectTokens) UpdateStatus(ctx context.Context, redirectToken *v1.RedirectToken, opts metav1.UpdateOptions) (result *v1.RedirectToken, err error) { - result = &v1.RedirectToken{} - err = c.client.Put(). - Resource("redirecttokens"). - Name(redirectToken.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(redirectToken). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the redirectToken and deletes it. Returns an error if one occurs. -func (c *redirectTokens) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("redirecttokens"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *redirectTokens) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("redirecttokens"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched redirectToken. -func (c *redirectTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RedirectToken, err error) { - result = &v1.RedirectToken{} - err = c.client.Patch(pt). - Resource("redirecttokens"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/registervirtualcluster.go b/pkg/clientset/versioned/typed/management/v1/registervirtualcluster.go index 294864c..437b0dc 100644 --- a/pkg/clientset/versioned/typed/management/v1/registervirtualcluster.go +++ b/pkg/clientset/versioned/typed/management/v1/registervirtualcluster.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // RegisterVirtualClustersGetter has a method to return a RegisterVirtualClusterInterface. @@ -24,6 +23,7 @@ type RegisterVirtualClustersGetter interface { type RegisterVirtualClusterInterface interface { Create(ctx context.Context, registerVirtualCluster *v1.RegisterVirtualCluster, opts metav1.CreateOptions) (*v1.RegisterVirtualCluster, error) Update(ctx context.Context, registerVirtualCluster *v1.RegisterVirtualCluster, opts metav1.UpdateOptions) (*v1.RegisterVirtualCluster, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, registerVirtualCluster *v1.RegisterVirtualCluster, opts metav1.UpdateOptions) (*v1.RegisterVirtualCluster, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type RegisterVirtualClusterInterface interface { // registerVirtualClusters implements RegisterVirtualClusterInterface type registerVirtualClusters struct { - client rest.Interface + *gentype.ClientWithList[*v1.RegisterVirtualCluster, *v1.RegisterVirtualClusterList] } // newRegisterVirtualClusters returns a RegisterVirtualClusters func newRegisterVirtualClusters(c *ManagementV1Client) *registerVirtualClusters { return ®isterVirtualClusters{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.RegisterVirtualCluster, *v1.RegisterVirtualClusterList]( + "registervirtualclusters", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.RegisterVirtualCluster { return &v1.RegisterVirtualCluster{} }, + func() *v1.RegisterVirtualClusterList { return &v1.RegisterVirtualClusterList{} }), } } - -// Get takes name of the registerVirtualCluster, and returns the corresponding registerVirtualCluster object, and an error if there is any. -func (c *registerVirtualClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RegisterVirtualCluster, err error) { - result = &v1.RegisterVirtualCluster{} - err = c.client.Get(). - Resource("registervirtualclusters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RegisterVirtualClusters that match those selectors. -func (c *registerVirtualClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RegisterVirtualClusterList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RegisterVirtualClusterList{} - err = c.client.Get(). - Resource("registervirtualclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested registerVirtualClusters. -func (c *registerVirtualClusters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("registervirtualclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a registerVirtualCluster and creates it. Returns the server's representation of the registerVirtualCluster, and an error, if there is any. -func (c *registerVirtualClusters) Create(ctx context.Context, registerVirtualCluster *v1.RegisterVirtualCluster, opts metav1.CreateOptions) (result *v1.RegisterVirtualCluster, err error) { - result = &v1.RegisterVirtualCluster{} - err = c.client.Post(). - Resource("registervirtualclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(registerVirtualCluster). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a registerVirtualCluster and updates it. Returns the server's representation of the registerVirtualCluster, and an error, if there is any. -func (c *registerVirtualClusters) Update(ctx context.Context, registerVirtualCluster *v1.RegisterVirtualCluster, opts metav1.UpdateOptions) (result *v1.RegisterVirtualCluster, err error) { - result = &v1.RegisterVirtualCluster{} - err = c.client.Put(). - Resource("registervirtualclusters"). - Name(registerVirtualCluster.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(registerVirtualCluster). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *registerVirtualClusters) UpdateStatus(ctx context.Context, registerVirtualCluster *v1.RegisterVirtualCluster, opts metav1.UpdateOptions) (result *v1.RegisterVirtualCluster, err error) { - result = &v1.RegisterVirtualCluster{} - err = c.client.Put(). - Resource("registervirtualclusters"). - Name(registerVirtualCluster.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(registerVirtualCluster). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the registerVirtualCluster and deletes it. Returns an error if one occurs. -func (c *registerVirtualClusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("registervirtualclusters"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *registerVirtualClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("registervirtualclusters"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched registerVirtualCluster. -func (c *registerVirtualClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RegisterVirtualCluster, err error) { - result = &v1.RegisterVirtualCluster{} - err = c.client.Patch(pt). - Resource("registervirtualclusters"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/resetaccesskey.go b/pkg/clientset/versioned/typed/management/v1/resetaccesskey.go index 277ffb1..2179352 100644 --- a/pkg/clientset/versioned/typed/management/v1/resetaccesskey.go +++ b/pkg/clientset/versioned/typed/management/v1/resetaccesskey.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ResetAccessKeysGetter has a method to return a ResetAccessKeyInterface. @@ -24,6 +23,7 @@ type ResetAccessKeysGetter interface { type ResetAccessKeyInterface interface { Create(ctx context.Context, resetAccessKey *v1.ResetAccessKey, opts metav1.CreateOptions) (*v1.ResetAccessKey, error) Update(ctx context.Context, resetAccessKey *v1.ResetAccessKey, opts metav1.UpdateOptions) (*v1.ResetAccessKey, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, resetAccessKey *v1.ResetAccessKey, opts metav1.UpdateOptions) (*v1.ResetAccessKey, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type ResetAccessKeyInterface interface { // resetAccessKeys implements ResetAccessKeyInterface type resetAccessKeys struct { - client rest.Interface + *gentype.ClientWithList[*v1.ResetAccessKey, *v1.ResetAccessKeyList] } // newResetAccessKeys returns a ResetAccessKeys func newResetAccessKeys(c *ManagementV1Client) *resetAccessKeys { return &resetAccessKeys{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.ResetAccessKey, *v1.ResetAccessKeyList]( + "resetaccesskeys", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ResetAccessKey { return &v1.ResetAccessKey{} }, + func() *v1.ResetAccessKeyList { return &v1.ResetAccessKeyList{} }), } } - -// Get takes name of the resetAccessKey, and returns the corresponding resetAccessKey object, and an error if there is any. -func (c *resetAccessKeys) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ResetAccessKey, err error) { - result = &v1.ResetAccessKey{} - err = c.client.Get(). - Resource("resetaccesskeys"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResetAccessKeys that match those selectors. -func (c *resetAccessKeys) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ResetAccessKeyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ResetAccessKeyList{} - err = c.client.Get(). - Resource("resetaccesskeys"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested resetAccessKeys. -func (c *resetAccessKeys) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("resetaccesskeys"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a resetAccessKey and creates it. Returns the server's representation of the resetAccessKey, and an error, if there is any. -func (c *resetAccessKeys) Create(ctx context.Context, resetAccessKey *v1.ResetAccessKey, opts metav1.CreateOptions) (result *v1.ResetAccessKey, err error) { - result = &v1.ResetAccessKey{} - err = c.client.Post(). - Resource("resetaccesskeys"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resetAccessKey). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a resetAccessKey and updates it. Returns the server's representation of the resetAccessKey, and an error, if there is any. -func (c *resetAccessKeys) Update(ctx context.Context, resetAccessKey *v1.ResetAccessKey, opts metav1.UpdateOptions) (result *v1.ResetAccessKey, err error) { - result = &v1.ResetAccessKey{} - err = c.client.Put(). - Resource("resetaccesskeys"). - Name(resetAccessKey.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resetAccessKey). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *resetAccessKeys) UpdateStatus(ctx context.Context, resetAccessKey *v1.ResetAccessKey, opts metav1.UpdateOptions) (result *v1.ResetAccessKey, err error) { - result = &v1.ResetAccessKey{} - err = c.client.Put(). - Resource("resetaccesskeys"). - Name(resetAccessKey.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resetAccessKey). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the resetAccessKey and deletes it. Returns an error if one occurs. -func (c *resetAccessKeys) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("resetaccesskeys"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *resetAccessKeys) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("resetaccesskeys"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched resetAccessKey. -func (c *resetAccessKeys) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResetAccessKey, err error) { - result = &v1.ResetAccessKey{} - err = c.client.Patch(pt). - Resource("resetaccesskeys"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/runner.go b/pkg/clientset/versioned/typed/management/v1/runner.go index e526490..92ccf93 100644 --- a/pkg/clientset/versioned/typed/management/v1/runner.go +++ b/pkg/clientset/versioned/typed/management/v1/runner.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // RunnersGetter has a method to return a RunnerInterface. @@ -24,6 +23,7 @@ type RunnersGetter interface { type RunnerInterface interface { Create(ctx context.Context, runner *v1.Runner, opts metav1.CreateOptions) (*v1.Runner, error) Update(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (*v1.Runner, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (*v1.Runner, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -39,141 +39,26 @@ type RunnerInterface interface { // runners implements RunnerInterface type runners struct { - client rest.Interface + *gentype.ClientWithList[*v1.Runner, *v1.RunnerList] } // newRunners returns a Runners func newRunners(c *ManagementV1Client) *runners { return &runners{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Runner, *v1.RunnerList]( + "runners", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Runner { return &v1.Runner{} }, + func() *v1.RunnerList { return &v1.RunnerList{} }), } } -// Get takes name of the runner, and returns the corresponding runner object, and an error if there is any. -func (c *runners) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Runner, err error) { - result = &v1.Runner{} - err = c.client.Get(). - Resource("runners"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Runners that match those selectors. -func (c *runners) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RunnerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RunnerList{} - err = c.client.Get(). - Resource("runners"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested runners. -func (c *runners) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("runners"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a runner and creates it. Returns the server's representation of the runner, and an error, if there is any. -func (c *runners) Create(ctx context.Context, runner *v1.Runner, opts metav1.CreateOptions) (result *v1.Runner, err error) { - result = &v1.Runner{} - err = c.client.Post(). - Resource("runners"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(runner). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a runner and updates it. Returns the server's representation of the runner, and an error, if there is any. -func (c *runners) Update(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (result *v1.Runner, err error) { - result = &v1.Runner{} - err = c.client.Put(). - Resource("runners"). - Name(runner.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(runner). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *runners) UpdateStatus(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (result *v1.Runner, err error) { - result = &v1.Runner{} - err = c.client.Put(). - Resource("runners"). - Name(runner.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(runner). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the runner and deletes it. Returns an error if one occurs. -func (c *runners) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("runners"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *runners) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("runners"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched runner. -func (c *runners) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Runner, err error) { - result = &v1.Runner{} - err = c.client.Patch(pt). - Resource("runners"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // GetConfig takes name of the runner, and returns the corresponding v1.RunnerConfig object, and an error if there is any. func (c *runners) GetConfig(ctx context.Context, runnerName string, options metav1.GetOptions) (result *v1.RunnerConfig, err error) { result = &v1.RunnerConfig{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("runners"). Name(runnerName). SubResource("config"). @@ -186,7 +71,7 @@ func (c *runners) GetConfig(ctx context.Context, runnerName string, options meta // GetAccessKey takes name of the runner, and returns the corresponding v1.RunnerAccessKey object, and an error if there is any. func (c *runners) GetAccessKey(ctx context.Context, runnerName string, options metav1.GetOptions) (result *v1.RunnerAccessKey, err error) { result = &v1.RunnerAccessKey{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("runners"). Name(runnerName). SubResource("accesskey"). diff --git a/pkg/clientset/versioned/typed/management/v1/self.go b/pkg/clientset/versioned/typed/management/v1/self.go index e1ecd9b..7c86501 100644 --- a/pkg/clientset/versioned/typed/management/v1/self.go +++ b/pkg/clientset/versioned/typed/management/v1/self.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // SelvesGetter has a method to return a SelfInterface. @@ -24,6 +23,7 @@ type SelvesGetter interface { type SelfInterface interface { Create(ctx context.Context, self *v1.Self, opts metav1.CreateOptions) (*v1.Self, error) Update(ctx context.Context, self *v1.Self, opts metav1.UpdateOptions) (*v1.Self, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, self *v1.Self, opts metav1.UpdateOptions) (*v1.Self, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type SelfInterface interface { // selves implements SelfInterface type selves struct { - client rest.Interface + *gentype.ClientWithList[*v1.Self, *v1.SelfList] } // newSelves returns a Selves func newSelves(c *ManagementV1Client) *selves { return &selves{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Self, *v1.SelfList]( + "selves", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Self { return &v1.Self{} }, + func() *v1.SelfList { return &v1.SelfList{} }), } } - -// Get takes name of the self, and returns the corresponding self object, and an error if there is any. -func (c *selves) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Self, err error) { - result = &v1.Self{} - err = c.client.Get(). - Resource("selves"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Selves that match those selectors. -func (c *selves) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SelfList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SelfList{} - err = c.client.Get(). - Resource("selves"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested selves. -func (c *selves) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("selves"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a self and creates it. Returns the server's representation of the self, and an error, if there is any. -func (c *selves) Create(ctx context.Context, self *v1.Self, opts metav1.CreateOptions) (result *v1.Self, err error) { - result = &v1.Self{} - err = c.client.Post(). - Resource("selves"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(self). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a self and updates it. Returns the server's representation of the self, and an error, if there is any. -func (c *selves) Update(ctx context.Context, self *v1.Self, opts metav1.UpdateOptions) (result *v1.Self, err error) { - result = &v1.Self{} - err = c.client.Put(). - Resource("selves"). - Name(self.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(self). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *selves) UpdateStatus(ctx context.Context, self *v1.Self, opts metav1.UpdateOptions) (result *v1.Self, err error) { - result = &v1.Self{} - err = c.client.Put(). - Resource("selves"). - Name(self.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(self). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the self and deletes it. Returns an error if one occurs. -func (c *selves) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("selves"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *selves) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("selves"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched self. -func (c *selves) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Self, err error) { - result = &v1.Self{} - err = c.client.Patch(pt). - Resource("selves"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/selfsubjectaccessreview.go b/pkg/clientset/versioned/typed/management/v1/selfsubjectaccessreview.go index 1ce38ad..73da860 100644 --- a/pkg/clientset/versioned/typed/management/v1/selfsubjectaccessreview.go +++ b/pkg/clientset/versioned/typed/management/v1/selfsubjectaccessreview.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // SelfSubjectAccessReviewsGetter has a method to return a SelfSubjectAccessReviewInterface. @@ -24,6 +23,7 @@ type SelfSubjectAccessReviewsGetter interface { type SelfSubjectAccessReviewInterface interface { Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (*v1.SelfSubjectAccessReview, error) Update(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.UpdateOptions) (*v1.SelfSubjectAccessReview, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.UpdateOptions) (*v1.SelfSubjectAccessReview, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type SelfSubjectAccessReviewInterface interface { // selfSubjectAccessReviews implements SelfSubjectAccessReviewInterface type selfSubjectAccessReviews struct { - client rest.Interface + *gentype.ClientWithList[*v1.SelfSubjectAccessReview, *v1.SelfSubjectAccessReviewList] } // newSelfSubjectAccessReviews returns a SelfSubjectAccessReviews func newSelfSubjectAccessReviews(c *ManagementV1Client) *selfSubjectAccessReviews { return &selfSubjectAccessReviews{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.SelfSubjectAccessReview, *v1.SelfSubjectAccessReviewList]( + "selfsubjectaccessreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.SelfSubjectAccessReview { return &v1.SelfSubjectAccessReview{} }, + func() *v1.SelfSubjectAccessReviewList { return &v1.SelfSubjectAccessReviewList{} }), } } - -// Get takes name of the selfSubjectAccessReview, and returns the corresponding selfSubjectAccessReview object, and an error if there is any. -func (c *selfSubjectAccessReviews) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SelfSubjectAccessReview, err error) { - result = &v1.SelfSubjectAccessReview{} - err = c.client.Get(). - Resource("selfsubjectaccessreviews"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SelfSubjectAccessReviews that match those selectors. -func (c *selfSubjectAccessReviews) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SelfSubjectAccessReviewList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SelfSubjectAccessReviewList{} - err = c.client.Get(). - Resource("selfsubjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested selfSubjectAccessReviews. -func (c *selfSubjectAccessReviews) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("selfsubjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. -func (c *selfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (result *v1.SelfSubjectAccessReview, err error) { - result = &v1.SelfSubjectAccessReview{} - err = c.client.Post(). - Resource("selfsubjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(selfSubjectAccessReview). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a selfSubjectAccessReview and updates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. -func (c *selfSubjectAccessReviews) Update(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.UpdateOptions) (result *v1.SelfSubjectAccessReview, err error) { - result = &v1.SelfSubjectAccessReview{} - err = c.client.Put(). - Resource("selfsubjectaccessreviews"). - Name(selfSubjectAccessReview.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(selfSubjectAccessReview). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *selfSubjectAccessReviews) UpdateStatus(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.UpdateOptions) (result *v1.SelfSubjectAccessReview, err error) { - result = &v1.SelfSubjectAccessReview{} - err = c.client.Put(). - Resource("selfsubjectaccessreviews"). - Name(selfSubjectAccessReview.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(selfSubjectAccessReview). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the selfSubjectAccessReview and deletes it. Returns an error if one occurs. -func (c *selfSubjectAccessReviews) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("selfsubjectaccessreviews"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *selfSubjectAccessReviews) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("selfsubjectaccessreviews"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched selfSubjectAccessReview. -func (c *selfSubjectAccessReviews) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SelfSubjectAccessReview, err error) { - result = &v1.SelfSubjectAccessReview{} - err = c.client.Patch(pt). - Resource("selfsubjectaccessreviews"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/sharedsecret.go b/pkg/clientset/versioned/typed/management/v1/sharedsecret.go index 914b254..e8e4574 100644 --- a/pkg/clientset/versioned/typed/management/v1/sharedsecret.go +++ b/pkg/clientset/versioned/typed/management/v1/sharedsecret.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // SharedSecretsGetter has a method to return a SharedSecretInterface. @@ -24,6 +23,7 @@ type SharedSecretsGetter interface { type SharedSecretInterface interface { Create(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.CreateOptions) (*v1.SharedSecret, error) Update(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (*v1.SharedSecret, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (*v1.SharedSecret, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,144 +36,18 @@ type SharedSecretInterface interface { // sharedSecrets implements SharedSecretInterface type sharedSecrets struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.SharedSecret, *v1.SharedSecretList] } // newSharedSecrets returns a SharedSecrets func newSharedSecrets(c *ManagementV1Client, namespace string) *sharedSecrets { return &sharedSecrets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.SharedSecret, *v1.SharedSecretList]( + "sharedsecrets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.SharedSecret { return &v1.SharedSecret{} }, + func() *v1.SharedSecretList { return &v1.SharedSecretList{} }), } } - -// Get takes name of the sharedSecret, and returns the corresponding sharedSecret object, and an error if there is any. -func (c *sharedSecrets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SharedSecret, err error) { - result = &v1.SharedSecret{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sharedsecrets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SharedSecrets that match those selectors. -func (c *sharedSecrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SharedSecretList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SharedSecretList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sharedsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested sharedSecrets. -func (c *sharedSecrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("sharedsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a sharedSecret and creates it. Returns the server's representation of the sharedSecret, and an error, if there is any. -func (c *sharedSecrets) Create(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.CreateOptions) (result *v1.SharedSecret, err error) { - result = &v1.SharedSecret{} - err = c.client.Post(). - Namespace(c.ns). - Resource("sharedsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(sharedSecret). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a sharedSecret and updates it. Returns the server's representation of the sharedSecret, and an error, if there is any. -func (c *sharedSecrets) Update(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (result *v1.SharedSecret, err error) { - result = &v1.SharedSecret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sharedsecrets"). - Name(sharedSecret.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(sharedSecret). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *sharedSecrets) UpdateStatus(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (result *v1.SharedSecret, err error) { - result = &v1.SharedSecret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sharedsecrets"). - Name(sharedSecret.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(sharedSecret). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the sharedSecret and deletes it. Returns an error if one occurs. -func (c *sharedSecrets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sharedsecrets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *sharedSecrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("sharedsecrets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched sharedSecret. -func (c *sharedSecrets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SharedSecret, err error) { - result = &v1.SharedSecret{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("sharedsecrets"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/spaceinstance.go b/pkg/clientset/versioned/typed/management/v1/spaceinstance.go index 68f226d..35a92f3 100644 --- a/pkg/clientset/versioned/typed/management/v1/spaceinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/spaceinstance.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // SpaceInstancesGetter has a method to return a SpaceInstanceInterface. @@ -35,128 +34,18 @@ type SpaceInstanceInterface interface { // spaceInstances implements SpaceInstanceInterface type spaceInstances struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.SpaceInstance, *v1.SpaceInstanceList] } // newSpaceInstances returns a SpaceInstances func newSpaceInstances(c *ManagementV1Client, namespace string) *spaceInstances { return &spaceInstances{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.SpaceInstance, *v1.SpaceInstanceList]( + "spaceinstances", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.SpaceInstance { return &v1.SpaceInstance{} }, + func() *v1.SpaceInstanceList { return &v1.SpaceInstanceList{} }), } } - -// Get takes name of the spaceInstance, and returns the corresponding spaceInstance object, and an error if there is any. -func (c *spaceInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SpaceInstance, err error) { - result = &v1.SpaceInstance{} - err = c.client.Get(). - Namespace(c.ns). - Resource("spaceinstances"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SpaceInstances that match those selectors. -func (c *spaceInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SpaceInstanceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SpaceInstanceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("spaceinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested spaceInstances. -func (c *spaceInstances) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("spaceinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a spaceInstance and creates it. Returns the server's representation of the spaceInstance, and an error, if there is any. -func (c *spaceInstances) Create(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.CreateOptions) (result *v1.SpaceInstance, err error) { - result = &v1.SpaceInstance{} - err = c.client.Post(). - Namespace(c.ns). - Resource("spaceinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(spaceInstance). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a spaceInstance and updates it. Returns the server's representation of the spaceInstance, and an error, if there is any. -func (c *spaceInstances) Update(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.UpdateOptions) (result *v1.SpaceInstance, err error) { - result = &v1.SpaceInstance{} - err = c.client.Put(). - Namespace(c.ns). - Resource("spaceinstances"). - Name(spaceInstance.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(spaceInstance). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the spaceInstance and deletes it. Returns an error if one occurs. -func (c *spaceInstances) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("spaceinstances"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *spaceInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("spaceinstances"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched spaceInstance. -func (c *spaceInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SpaceInstance, err error) { - result = &v1.SpaceInstance{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("spaceinstances"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/spacetemplate.go b/pkg/clientset/versioned/typed/management/v1/spacetemplate.go index 4fcf0d9..caa05f6 100644 --- a/pkg/clientset/versioned/typed/management/v1/spacetemplate.go +++ b/pkg/clientset/versioned/typed/management/v1/spacetemplate.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // SpaceTemplatesGetter has a method to return a SpaceTemplateInterface. @@ -24,6 +23,7 @@ type SpaceTemplatesGetter interface { type SpaceTemplateInterface interface { Create(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.CreateOptions) (*v1.SpaceTemplate, error) Update(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (*v1.SpaceTemplate, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (*v1.SpaceTemplate, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type SpaceTemplateInterface interface { // spaceTemplates implements SpaceTemplateInterface type spaceTemplates struct { - client rest.Interface + *gentype.ClientWithList[*v1.SpaceTemplate, *v1.SpaceTemplateList] } // newSpaceTemplates returns a SpaceTemplates func newSpaceTemplates(c *ManagementV1Client) *spaceTemplates { return &spaceTemplates{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.SpaceTemplate, *v1.SpaceTemplateList]( + "spacetemplates", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.SpaceTemplate { return &v1.SpaceTemplate{} }, + func() *v1.SpaceTemplateList { return &v1.SpaceTemplateList{} }), } } - -// Get takes name of the spaceTemplate, and returns the corresponding spaceTemplate object, and an error if there is any. -func (c *spaceTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SpaceTemplate, err error) { - result = &v1.SpaceTemplate{} - err = c.client.Get(). - Resource("spacetemplates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SpaceTemplates that match those selectors. -func (c *spaceTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SpaceTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SpaceTemplateList{} - err = c.client.Get(). - Resource("spacetemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested spaceTemplates. -func (c *spaceTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("spacetemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a spaceTemplate and creates it. Returns the server's representation of the spaceTemplate, and an error, if there is any. -func (c *spaceTemplates) Create(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.CreateOptions) (result *v1.SpaceTemplate, err error) { - result = &v1.SpaceTemplate{} - err = c.client.Post(). - Resource("spacetemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(spaceTemplate). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a spaceTemplate and updates it. Returns the server's representation of the spaceTemplate, and an error, if there is any. -func (c *spaceTemplates) Update(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (result *v1.SpaceTemplate, err error) { - result = &v1.SpaceTemplate{} - err = c.client.Put(). - Resource("spacetemplates"). - Name(spaceTemplate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(spaceTemplate). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *spaceTemplates) UpdateStatus(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (result *v1.SpaceTemplate, err error) { - result = &v1.SpaceTemplate{} - err = c.client.Put(). - Resource("spacetemplates"). - Name(spaceTemplate.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(spaceTemplate). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the spaceTemplate and deletes it. Returns an error if one occurs. -func (c *spaceTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("spacetemplates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *spaceTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("spacetemplates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched spaceTemplate. -func (c *spaceTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SpaceTemplate, err error) { - result = &v1.SpaceTemplate{} - err = c.client.Patch(pt). - Resource("spacetemplates"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/subjectaccessreview.go b/pkg/clientset/versioned/typed/management/v1/subjectaccessreview.go index 33ebf52..f2581c6 100644 --- a/pkg/clientset/versioned/typed/management/v1/subjectaccessreview.go +++ b/pkg/clientset/versioned/typed/management/v1/subjectaccessreview.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // SubjectAccessReviewsGetter has a method to return a SubjectAccessReviewInterface. @@ -24,6 +23,7 @@ type SubjectAccessReviewsGetter interface { type SubjectAccessReviewInterface interface { Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (*v1.SubjectAccessReview, error) Update(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.UpdateOptions) (*v1.SubjectAccessReview, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.UpdateOptions) (*v1.SubjectAccessReview, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type SubjectAccessReviewInterface interface { // subjectAccessReviews implements SubjectAccessReviewInterface type subjectAccessReviews struct { - client rest.Interface + *gentype.ClientWithList[*v1.SubjectAccessReview, *v1.SubjectAccessReviewList] } // newSubjectAccessReviews returns a SubjectAccessReviews func newSubjectAccessReviews(c *ManagementV1Client) *subjectAccessReviews { return &subjectAccessReviews{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.SubjectAccessReview, *v1.SubjectAccessReviewList]( + "subjectaccessreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.SubjectAccessReview { return &v1.SubjectAccessReview{} }, + func() *v1.SubjectAccessReviewList { return &v1.SubjectAccessReviewList{} }), } } - -// Get takes name of the subjectAccessReview, and returns the corresponding subjectAccessReview object, and an error if there is any. -func (c *subjectAccessReviews) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SubjectAccessReview, err error) { - result = &v1.SubjectAccessReview{} - err = c.client.Get(). - Resource("subjectaccessreviews"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SubjectAccessReviews that match those selectors. -func (c *subjectAccessReviews) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SubjectAccessReviewList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SubjectAccessReviewList{} - err = c.client.Get(). - Resource("subjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested subjectAccessReviews. -func (c *subjectAccessReviews) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("subjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. -func (c *subjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (result *v1.SubjectAccessReview, err error) { - result = &v1.SubjectAccessReview{} - err = c.client.Post(). - Resource("subjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(subjectAccessReview). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a subjectAccessReview and updates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. -func (c *subjectAccessReviews) Update(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.UpdateOptions) (result *v1.SubjectAccessReview, err error) { - result = &v1.SubjectAccessReview{} - err = c.client.Put(). - Resource("subjectaccessreviews"). - Name(subjectAccessReview.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(subjectAccessReview). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *subjectAccessReviews) UpdateStatus(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.UpdateOptions) (result *v1.SubjectAccessReview, err error) { - result = &v1.SubjectAccessReview{} - err = c.client.Put(). - Resource("subjectaccessreviews"). - Name(subjectAccessReview.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(subjectAccessReview). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the subjectAccessReview and deletes it. Returns an error if one occurs. -func (c *subjectAccessReviews) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("subjectaccessreviews"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *subjectAccessReviews) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("subjectaccessreviews"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched subjectAccessReview. -func (c *subjectAccessReviews) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SubjectAccessReview, err error) { - result = &v1.SubjectAccessReview{} - err = c.client.Patch(pt). - Resource("subjectaccessreviews"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/task.go b/pkg/clientset/versioned/typed/management/v1/task.go index fb7cc22..183fa6d 100644 --- a/pkg/clientset/versioned/typed/management/v1/task.go +++ b/pkg/clientset/versioned/typed/management/v1/task.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // TasksGetter has a method to return a TaskInterface. @@ -24,6 +23,7 @@ type TasksGetter interface { type TaskInterface interface { Create(ctx context.Context, task *v1.Task, opts metav1.CreateOptions) (*v1.Task, error) Update(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (*v1.Task, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (*v1.Task, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type TaskInterface interface { // tasks implements TaskInterface type tasks struct { - client rest.Interface + *gentype.ClientWithList[*v1.Task, *v1.TaskList] } // newTasks returns a Tasks func newTasks(c *ManagementV1Client) *tasks { return &tasks{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Task, *v1.TaskList]( + "tasks", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Task { return &v1.Task{} }, + func() *v1.TaskList { return &v1.TaskList{} }), } } - -// Get takes name of the task, and returns the corresponding task object, and an error if there is any. -func (c *tasks) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Task, err error) { - result = &v1.Task{} - err = c.client.Get(). - Resource("tasks"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Tasks that match those selectors. -func (c *tasks) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TaskList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.TaskList{} - err = c.client.Get(). - Resource("tasks"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested tasks. -func (c *tasks) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("tasks"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a task and creates it. Returns the server's representation of the task, and an error, if there is any. -func (c *tasks) Create(ctx context.Context, task *v1.Task, opts metav1.CreateOptions) (result *v1.Task, err error) { - result = &v1.Task{} - err = c.client.Post(). - Resource("tasks"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(task). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a task and updates it. Returns the server's representation of the task, and an error, if there is any. -func (c *tasks) Update(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (result *v1.Task, err error) { - result = &v1.Task{} - err = c.client.Put(). - Resource("tasks"). - Name(task.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(task). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *tasks) UpdateStatus(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (result *v1.Task, err error) { - result = &v1.Task{} - err = c.client.Put(). - Resource("tasks"). - Name(task.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(task). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the task and deletes it. Returns an error if one occurs. -func (c *tasks) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("tasks"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *tasks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("tasks"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched task. -func (c *tasks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Task, err error) { - result = &v1.Task{} - err = c.client.Patch(pt). - Resource("tasks"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/team.go b/pkg/clientset/versioned/typed/management/v1/team.go index a7dbaf7..f3a2c6e 100644 --- a/pkg/clientset/versioned/typed/management/v1/team.go +++ b/pkg/clientset/versioned/typed/management/v1/team.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // TeamsGetter has a method to return a TeamInterface. @@ -24,6 +23,7 @@ type TeamsGetter interface { type TeamInterface interface { Create(ctx context.Context, team *v1.Team, opts metav1.CreateOptions) (*v1.Team, error) Update(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (*v1.Team, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (*v1.Team, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -39,141 +39,26 @@ type TeamInterface interface { // teams implements TeamInterface type teams struct { - client rest.Interface + *gentype.ClientWithList[*v1.Team, *v1.TeamList] } // newTeams returns a Teams func newTeams(c *ManagementV1Client) *teams { return &teams{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Team, *v1.TeamList]( + "teams", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Team { return &v1.Team{} }, + func() *v1.TeamList { return &v1.TeamList{} }), } } -// Get takes name of the team, and returns the corresponding team object, and an error if there is any. -func (c *teams) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Team, err error) { - result = &v1.Team{} - err = c.client.Get(). - Resource("teams"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Teams that match those selectors. -func (c *teams) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TeamList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.TeamList{} - err = c.client.Get(). - Resource("teams"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested teams. -func (c *teams) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("teams"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a team and creates it. Returns the server's representation of the team, and an error, if there is any. -func (c *teams) Create(ctx context.Context, team *v1.Team, opts metav1.CreateOptions) (result *v1.Team, err error) { - result = &v1.Team{} - err = c.client.Post(). - Resource("teams"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(team). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a team and updates it. Returns the server's representation of the team, and an error, if there is any. -func (c *teams) Update(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (result *v1.Team, err error) { - result = &v1.Team{} - err = c.client.Put(). - Resource("teams"). - Name(team.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(team). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *teams) UpdateStatus(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (result *v1.Team, err error) { - result = &v1.Team{} - err = c.client.Put(). - Resource("teams"). - Name(team.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(team). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the team and deletes it. Returns an error if one occurs. -func (c *teams) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("teams"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *teams) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("teams"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched team. -func (c *teams) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Team, err error) { - result = &v1.Team{} - err = c.client.Patch(pt). - Resource("teams"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // ListClusters takes name of the team, and returns the corresponding v1.TeamClusters object, and an error if there is any. func (c *teams) ListClusters(ctx context.Context, teamName string, options metav1.GetOptions) (result *v1.TeamClusters, err error) { result = &v1.TeamClusters{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("teams"). Name(teamName). SubResource("clusters"). @@ -186,7 +71,7 @@ func (c *teams) ListClusters(ctx context.Context, teamName string, options metav // ListAccessKeys takes name of the team, and returns the corresponding v1.TeamAccessKeys object, and an error if there is any. func (c *teams) ListAccessKeys(ctx context.Context, teamName string, options metav1.GetOptions) (result *v1.TeamAccessKeys, err error) { result = &v1.TeamAccessKeys{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("teams"). Name(teamName). SubResource("accesskeys"). diff --git a/pkg/clientset/versioned/typed/management/v1/translatevclusterresourcename.go b/pkg/clientset/versioned/typed/management/v1/translatevclusterresourcename.go index 1ebfe23..1c2d89b 100644 --- a/pkg/clientset/versioned/typed/management/v1/translatevclusterresourcename.go +++ b/pkg/clientset/versioned/typed/management/v1/translatevclusterresourcename.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // TranslateVClusterResourceNamesGetter has a method to return a TranslateVClusterResourceNameInterface. @@ -24,6 +23,7 @@ type TranslateVClusterResourceNamesGetter interface { type TranslateVClusterResourceNameInterface interface { Create(ctx context.Context, translateVClusterResourceName *v1.TranslateVClusterResourceName, opts metav1.CreateOptions) (*v1.TranslateVClusterResourceName, error) Update(ctx context.Context, translateVClusterResourceName *v1.TranslateVClusterResourceName, opts metav1.UpdateOptions) (*v1.TranslateVClusterResourceName, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, translateVClusterResourceName *v1.TranslateVClusterResourceName, opts metav1.UpdateOptions) (*v1.TranslateVClusterResourceName, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type TranslateVClusterResourceNameInterface interface { // translateVClusterResourceNames implements TranslateVClusterResourceNameInterface type translateVClusterResourceNames struct { - client rest.Interface + *gentype.ClientWithList[*v1.TranslateVClusterResourceName, *v1.TranslateVClusterResourceNameList] } // newTranslateVClusterResourceNames returns a TranslateVClusterResourceNames func newTranslateVClusterResourceNames(c *ManagementV1Client) *translateVClusterResourceNames { return &translateVClusterResourceNames{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.TranslateVClusterResourceName, *v1.TranslateVClusterResourceNameList]( + "translatevclusterresourcenames", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.TranslateVClusterResourceName { return &v1.TranslateVClusterResourceName{} }, + func() *v1.TranslateVClusterResourceNameList { return &v1.TranslateVClusterResourceNameList{} }), } } - -// Get takes name of the translateVClusterResourceName, and returns the corresponding translateVClusterResourceName object, and an error if there is any. -func (c *translateVClusterResourceNames) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TranslateVClusterResourceName, err error) { - result = &v1.TranslateVClusterResourceName{} - err = c.client.Get(). - Resource("translatevclusterresourcenames"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of TranslateVClusterResourceNames that match those selectors. -func (c *translateVClusterResourceNames) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TranslateVClusterResourceNameList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.TranslateVClusterResourceNameList{} - err = c.client.Get(). - Resource("translatevclusterresourcenames"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested translateVClusterResourceNames. -func (c *translateVClusterResourceNames) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("translatevclusterresourcenames"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a translateVClusterResourceName and creates it. Returns the server's representation of the translateVClusterResourceName, and an error, if there is any. -func (c *translateVClusterResourceNames) Create(ctx context.Context, translateVClusterResourceName *v1.TranslateVClusterResourceName, opts metav1.CreateOptions) (result *v1.TranslateVClusterResourceName, err error) { - result = &v1.TranslateVClusterResourceName{} - err = c.client.Post(). - Resource("translatevclusterresourcenames"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(translateVClusterResourceName). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a translateVClusterResourceName and updates it. Returns the server's representation of the translateVClusterResourceName, and an error, if there is any. -func (c *translateVClusterResourceNames) Update(ctx context.Context, translateVClusterResourceName *v1.TranslateVClusterResourceName, opts metav1.UpdateOptions) (result *v1.TranslateVClusterResourceName, err error) { - result = &v1.TranslateVClusterResourceName{} - err = c.client.Put(). - Resource("translatevclusterresourcenames"). - Name(translateVClusterResourceName.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(translateVClusterResourceName). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *translateVClusterResourceNames) UpdateStatus(ctx context.Context, translateVClusterResourceName *v1.TranslateVClusterResourceName, opts metav1.UpdateOptions) (result *v1.TranslateVClusterResourceName, err error) { - result = &v1.TranslateVClusterResourceName{} - err = c.client.Put(). - Resource("translatevclusterresourcenames"). - Name(translateVClusterResourceName.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(translateVClusterResourceName). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the translateVClusterResourceName and deletes it. Returns an error if one occurs. -func (c *translateVClusterResourceNames) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("translatevclusterresourcenames"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *translateVClusterResourceNames) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("translatevclusterresourcenames"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched translateVClusterResourceName. -func (c *translateVClusterResourceNames) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TranslateVClusterResourceName, err error) { - result = &v1.TranslateVClusterResourceName{} - err = c.client.Patch(pt). - Resource("translatevclusterresourcenames"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/management/v1/user.go b/pkg/clientset/versioned/typed/management/v1/user.go index 19ec0b6..b381fa9 100644 --- a/pkg/clientset/versioned/typed/management/v1/user.go +++ b/pkg/clientset/versioned/typed/management/v1/user.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // UsersGetter has a method to return a UserInterface. @@ -24,6 +23,7 @@ type UsersGetter interface { type UserInterface interface { Create(ctx context.Context, user *v1.User, opts metav1.CreateOptions) (*v1.User, error) Update(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (*v1.User, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (*v1.User, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -40,141 +40,26 @@ type UserInterface interface { // users implements UserInterface type users struct { - client rest.Interface + *gentype.ClientWithList[*v1.User, *v1.UserList] } // newUsers returns a Users func newUsers(c *ManagementV1Client) *users { return &users{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.User, *v1.UserList]( + "users", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.User { return &v1.User{} }, + func() *v1.UserList { return &v1.UserList{} }), } } -// Get takes name of the user, and returns the corresponding user object, and an error if there is any. -func (c *users) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.User, err error) { - result = &v1.User{} - err = c.client.Get(). - Resource("users"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Users that match those selectors. -func (c *users) List(ctx context.Context, opts metav1.ListOptions) (result *v1.UserList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.UserList{} - err = c.client.Get(). - Resource("users"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested users. -func (c *users) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("users"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. -func (c *users) Create(ctx context.Context, user *v1.User, opts metav1.CreateOptions) (result *v1.User, err error) { - result = &v1.User{} - err = c.client.Post(). - Resource("users"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(user). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. -func (c *users) Update(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (result *v1.User, err error) { - result = &v1.User{} - err = c.client.Put(). - Resource("users"). - Name(user.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(user). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *users) UpdateStatus(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (result *v1.User, err error) { - result = &v1.User{} - err = c.client.Put(). - Resource("users"). - Name(user.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(user). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the user and deletes it. Returns an error if one occurs. -func (c *users) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("users"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *users) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("users"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched user. -func (c *users) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.User, err error) { - result = &v1.User{} - err = c.client.Patch(pt). - Resource("users"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // GetProfile takes name of the user, and returns the corresponding v1.UserProfile object, and an error if there is any. func (c *users) GetProfile(ctx context.Context, userName string, options metav1.GetOptions) (result *v1.UserProfile, err error) { result = &v1.UserProfile{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("users"). Name(userName). SubResource("profile"). @@ -187,7 +72,7 @@ func (c *users) GetProfile(ctx context.Context, userName string, options metav1. // ListClusters takes name of the user, and returns the corresponding v1.UserClusters object, and an error if there is any. func (c *users) ListClusters(ctx context.Context, userName string, options metav1.GetOptions) (result *v1.UserClusters, err error) { result = &v1.UserClusters{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("users"). Name(userName). SubResource("clusters"). @@ -200,7 +85,7 @@ func (c *users) ListClusters(ctx context.Context, userName string, options metav // ListAccessKeys takes name of the user, and returns the corresponding v1.UserAccessKeys object, and an error if there is any. func (c *users) ListAccessKeys(ctx context.Context, userName string, options metav1.GetOptions) (result *v1.UserAccessKeys, err error) { result = &v1.UserAccessKeys{} - err = c.client.Get(). + err = c.GetClient().Get(). Resource("users"). Name(userName). SubResource("accesskeys"). diff --git a/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go b/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go index 06e7a80..e8fef8a 100644 --- a/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // VirtualClusterInstancesGetter has a method to return a VirtualClusterInstanceInterface. @@ -38,137 +37,27 @@ type VirtualClusterInstanceInterface interface { // virtualClusterInstances implements VirtualClusterInstanceInterface type virtualClusterInstances struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.VirtualClusterInstance, *v1.VirtualClusterInstanceList] } // newVirtualClusterInstances returns a VirtualClusterInstances func newVirtualClusterInstances(c *ManagementV1Client, namespace string) *virtualClusterInstances { return &virtualClusterInstances{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.VirtualClusterInstance, *v1.VirtualClusterInstanceList]( + "virtualclusterinstances", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.VirtualClusterInstance { return &v1.VirtualClusterInstance{} }, + func() *v1.VirtualClusterInstanceList { return &v1.VirtualClusterInstanceList{} }), } } -// Get takes name of the virtualClusterInstance, and returns the corresponding virtualClusterInstance object, and an error if there is any. -func (c *virtualClusterInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualClusterInstance, err error) { - result = &v1.VirtualClusterInstance{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualClusterInstances that match those selectors. -func (c *virtualClusterInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualClusterInstanceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.VirtualClusterInstanceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualClusterInstances. -func (c *virtualClusterInstances) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualClusterInstance and creates it. Returns the server's representation of the virtualClusterInstance, and an error, if there is any. -func (c *virtualClusterInstances) Create(ctx context.Context, virtualClusterInstance *v1.VirtualClusterInstance, opts metav1.CreateOptions) (result *v1.VirtualClusterInstance, err error) { - result = &v1.VirtualClusterInstance{} - err = c.client.Post(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualClusterInstance). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualClusterInstance and updates it. Returns the server's representation of the virtualClusterInstance, and an error, if there is any. -func (c *virtualClusterInstances) Update(ctx context.Context, virtualClusterInstance *v1.VirtualClusterInstance, opts metav1.UpdateOptions) (result *v1.VirtualClusterInstance, err error) { - result = &v1.VirtualClusterInstance{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - Name(virtualClusterInstance.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualClusterInstance). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualClusterInstance and deletes it. Returns an error if one occurs. -func (c *virtualClusterInstances) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualClusterInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualClusterInstance. -func (c *virtualClusterInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualClusterInstance, err error) { - result = &v1.VirtualClusterInstance{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("virtualclusterinstances"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // GetKubeConfig takes the representation of a virtualClusterInstanceKubeConfig and creates it. Returns the server's representation of the virtualClusterInstanceKubeConfig, and an error, if there is any. func (c *virtualClusterInstances) GetKubeConfig(ctx context.Context, virtualClusterInstanceName string, virtualClusterInstanceKubeConfig *v1.VirtualClusterInstanceKubeConfig, opts metav1.CreateOptions) (result *v1.VirtualClusterInstanceKubeConfig, err error) { result = &v1.VirtualClusterInstanceKubeConfig{} - err = c.client.Post(). - Namespace(c.ns). + err = c.GetClient().Post(). + Namespace(c.GetNamespace()). Resource("virtualclusterinstances"). Name(virtualClusterInstanceName). SubResource("kubeconfig"). @@ -182,8 +71,8 @@ func (c *virtualClusterInstances) GetKubeConfig(ctx context.Context, virtualClus // GetAccessKey takes name of the virtualClusterInstance, and returns the corresponding v1.VirtualClusterAccessKey object, and an error if there is any. func (c *virtualClusterInstances) GetAccessKey(ctx context.Context, virtualClusterInstanceName string, options metav1.GetOptions) (result *v1.VirtualClusterAccessKey, err error) { result = &v1.VirtualClusterAccessKey{} - err = c.client.Get(). - Namespace(c.ns). + err = c.GetClient().Get(). + Namespace(c.GetNamespace()). Resource("virtualclusterinstances"). Name(virtualClusterInstanceName). SubResource("accesskey"). diff --git a/pkg/clientset/versioned/typed/management/v1/virtualclustertemplate.go b/pkg/clientset/versioned/typed/management/v1/virtualclustertemplate.go index 08f3670..6f861cc 100644 --- a/pkg/clientset/versioned/typed/management/v1/virtualclustertemplate.go +++ b/pkg/clientset/versioned/typed/management/v1/virtualclustertemplate.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // VirtualClusterTemplatesGetter has a method to return a VirtualClusterTemplateInterface. @@ -24,6 +23,7 @@ type VirtualClusterTemplatesGetter interface { type VirtualClusterTemplateInterface interface { Create(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.CreateOptions) (*v1.VirtualClusterTemplate, error) Update(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (*v1.VirtualClusterTemplate, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (*v1.VirtualClusterTemplate, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type VirtualClusterTemplateInterface interface { // virtualClusterTemplates implements VirtualClusterTemplateInterface type virtualClusterTemplates struct { - client rest.Interface + *gentype.ClientWithList[*v1.VirtualClusterTemplate, *v1.VirtualClusterTemplateList] } // newVirtualClusterTemplates returns a VirtualClusterTemplates func newVirtualClusterTemplates(c *ManagementV1Client) *virtualClusterTemplates { return &virtualClusterTemplates{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.VirtualClusterTemplate, *v1.VirtualClusterTemplateList]( + "virtualclustertemplates", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.VirtualClusterTemplate { return &v1.VirtualClusterTemplate{} }, + func() *v1.VirtualClusterTemplateList { return &v1.VirtualClusterTemplateList{} }), } } - -// Get takes name of the virtualClusterTemplate, and returns the corresponding virtualClusterTemplate object, and an error if there is any. -func (c *virtualClusterTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualClusterTemplate, err error) { - result = &v1.VirtualClusterTemplate{} - err = c.client.Get(). - Resource("virtualclustertemplates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualClusterTemplates that match those selectors. -func (c *virtualClusterTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualClusterTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.VirtualClusterTemplateList{} - err = c.client.Get(). - Resource("virtualclustertemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualClusterTemplates. -func (c *virtualClusterTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("virtualclustertemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualClusterTemplate and creates it. Returns the server's representation of the virtualClusterTemplate, and an error, if there is any. -func (c *virtualClusterTemplates) Create(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.CreateOptions) (result *v1.VirtualClusterTemplate, err error) { - result = &v1.VirtualClusterTemplate{} - err = c.client.Post(). - Resource("virtualclustertemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualClusterTemplate). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualClusterTemplate and updates it. Returns the server's representation of the virtualClusterTemplate, and an error, if there is any. -func (c *virtualClusterTemplates) Update(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (result *v1.VirtualClusterTemplate, err error) { - result = &v1.VirtualClusterTemplate{} - err = c.client.Put(). - Resource("virtualclustertemplates"). - Name(virtualClusterTemplate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualClusterTemplate). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *virtualClusterTemplates) UpdateStatus(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (result *v1.VirtualClusterTemplate, err error) { - result = &v1.VirtualClusterTemplate{} - err = c.client.Put(). - Resource("virtualclustertemplates"). - Name(virtualClusterTemplate.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualClusterTemplate). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualClusterTemplate and deletes it. Returns an error if one occurs. -func (c *virtualClusterTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("virtualclustertemplates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualClusterTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("virtualclustertemplates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualClusterTemplate. -func (c *virtualClusterTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualClusterTemplate, err error) { - result = &v1.VirtualClusterTemplate{} - err = c.client.Patch(pt). - Resource("virtualclustertemplates"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/accesskey.go b/pkg/clientset/versioned/typed/storage/v1/accesskey.go index 4f6a2fe..1a5fb0a 100644 --- a/pkg/clientset/versioned/typed/storage/v1/accesskey.go +++ b/pkg/clientset/versioned/typed/storage/v1/accesskey.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // AccessKeysGetter has a method to return a AccessKeyInterface. @@ -24,6 +23,7 @@ type AccessKeysGetter interface { type AccessKeyInterface interface { Create(ctx context.Context, accessKey *v1.AccessKey, opts metav1.CreateOptions) (*v1.AccessKey, error) Update(ctx context.Context, accessKey *v1.AccessKey, opts metav1.UpdateOptions) (*v1.AccessKey, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, accessKey *v1.AccessKey, opts metav1.UpdateOptions) (*v1.AccessKey, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type AccessKeyInterface interface { // accessKeys implements AccessKeyInterface type accessKeys struct { - client rest.Interface + *gentype.ClientWithList[*v1.AccessKey, *v1.AccessKeyList] } // newAccessKeys returns a AccessKeys func newAccessKeys(c *StorageV1Client) *accessKeys { return &accessKeys{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.AccessKey, *v1.AccessKeyList]( + "accesskeys", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.AccessKey { return &v1.AccessKey{} }, + func() *v1.AccessKeyList { return &v1.AccessKeyList{} }), } } - -// Get takes name of the accessKey, and returns the corresponding accessKey object, and an error if there is any. -func (c *accessKeys) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AccessKey, err error) { - result = &v1.AccessKey{} - err = c.client.Get(). - Resource("accesskeys"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of AccessKeys that match those selectors. -func (c *accessKeys) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AccessKeyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.AccessKeyList{} - err = c.client.Get(). - Resource("accesskeys"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested accessKeys. -func (c *accessKeys) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("accesskeys"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a accessKey and creates it. Returns the server's representation of the accessKey, and an error, if there is any. -func (c *accessKeys) Create(ctx context.Context, accessKey *v1.AccessKey, opts metav1.CreateOptions) (result *v1.AccessKey, err error) { - result = &v1.AccessKey{} - err = c.client.Post(). - Resource("accesskeys"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(accessKey). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a accessKey and updates it. Returns the server's representation of the accessKey, and an error, if there is any. -func (c *accessKeys) Update(ctx context.Context, accessKey *v1.AccessKey, opts metav1.UpdateOptions) (result *v1.AccessKey, err error) { - result = &v1.AccessKey{} - err = c.client.Put(). - Resource("accesskeys"). - Name(accessKey.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(accessKey). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *accessKeys) UpdateStatus(ctx context.Context, accessKey *v1.AccessKey, opts metav1.UpdateOptions) (result *v1.AccessKey, err error) { - result = &v1.AccessKey{} - err = c.client.Put(). - Resource("accesskeys"). - Name(accessKey.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(accessKey). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the accessKey and deletes it. Returns an error if one occurs. -func (c *accessKeys) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("accesskeys"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *accessKeys) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("accesskeys"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched accessKey. -func (c *accessKeys) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AccessKey, err error) { - result = &v1.AccessKey{} - err = c.client.Patch(pt). - Resource("accesskeys"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/app.go b/pkg/clientset/versioned/typed/storage/v1/app.go index fcb5e85..0552673 100644 --- a/pkg/clientset/versioned/typed/storage/v1/app.go +++ b/pkg/clientset/versioned/typed/storage/v1/app.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // AppsGetter has a method to return a AppInterface. @@ -24,6 +23,7 @@ type AppsGetter interface { type AppInterface interface { Create(ctx context.Context, app *v1.App, opts metav1.CreateOptions) (*v1.App, error) Update(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (*v1.App, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (*v1.App, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type AppInterface interface { // apps implements AppInterface type apps struct { - client rest.Interface + *gentype.ClientWithList[*v1.App, *v1.AppList] } // newApps returns a Apps func newApps(c *StorageV1Client) *apps { return &apps{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.App, *v1.AppList]( + "apps", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.App { return &v1.App{} }, + func() *v1.AppList { return &v1.AppList{} }), } } - -// Get takes name of the app, and returns the corresponding app object, and an error if there is any. -func (c *apps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.App, err error) { - result = &v1.App{} - err = c.client.Get(). - Resource("apps"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Apps that match those selectors. -func (c *apps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.AppList{} - err = c.client.Get(). - Resource("apps"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested apps. -func (c *apps) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("apps"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a app and creates it. Returns the server's representation of the app, and an error, if there is any. -func (c *apps) Create(ctx context.Context, app *v1.App, opts metav1.CreateOptions) (result *v1.App, err error) { - result = &v1.App{} - err = c.client.Post(). - Resource("apps"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(app). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a app and updates it. Returns the server's representation of the app, and an error, if there is any. -func (c *apps) Update(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (result *v1.App, err error) { - result = &v1.App{} - err = c.client.Put(). - Resource("apps"). - Name(app.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(app). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *apps) UpdateStatus(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (result *v1.App, err error) { - result = &v1.App{} - err = c.client.Put(). - Resource("apps"). - Name(app.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(app). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the app and deletes it. Returns an error if one occurs. -func (c *apps) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("apps"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *apps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("apps"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched app. -func (c *apps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.App, err error) { - result = &v1.App{} - err = c.client.Patch(pt). - Resource("apps"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/cluster.go b/pkg/clientset/versioned/typed/storage/v1/cluster.go index ad29bc7..337d105 100644 --- a/pkg/clientset/versioned/typed/storage/v1/cluster.go +++ b/pkg/clientset/versioned/typed/storage/v1/cluster.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ClustersGetter has a method to return a ClusterInterface. @@ -24,6 +23,7 @@ type ClustersGetter interface { type ClusterInterface interface { Create(ctx context.Context, cluster *v1.Cluster, opts metav1.CreateOptions) (*v1.Cluster, error) Update(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (*v1.Cluster, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (*v1.Cluster, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type ClusterInterface interface { // clusters implements ClusterInterface type clusters struct { - client rest.Interface + *gentype.ClientWithList[*v1.Cluster, *v1.ClusterList] } // newClusters returns a Clusters func newClusters(c *StorageV1Client) *clusters { return &clusters{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Cluster, *v1.ClusterList]( + "clusters", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Cluster { return &v1.Cluster{} }, + func() *v1.ClusterList { return &v1.ClusterList{} }), } } - -// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. -func (c *clusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Cluster, err error) { - result = &v1.Cluster{} - err = c.client.Get(). - Resource("clusters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Clusters that match those selectors. -func (c *clusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterList{} - err = c.client.Get(). - Resource("clusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusters. -func (c *clusters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("clusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *clusters) Create(ctx context.Context, cluster *v1.Cluster, opts metav1.CreateOptions) (result *v1.Cluster, err error) { - result = &v1.Cluster{} - err = c.client.Post(). - Resource("clusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cluster). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *clusters) Update(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (result *v1.Cluster, err error) { - result = &v1.Cluster{} - err = c.client.Put(). - Resource("clusters"). - Name(cluster.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cluster). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *clusters) UpdateStatus(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (result *v1.Cluster, err error) { - result = &v1.Cluster{} - err = c.client.Put(). - Resource("clusters"). - Name(cluster.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cluster). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cluster and deletes it. Returns an error if one occurs. -func (c *clusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusters"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clusters"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cluster. -func (c *clusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Cluster, err error) { - result = &v1.Cluster{} - err = c.client.Patch(pt). - Resource("clusters"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/clusteraccess.go b/pkg/clientset/versioned/typed/storage/v1/clusteraccess.go index db98a9e..f12601c 100644 --- a/pkg/clientset/versioned/typed/storage/v1/clusteraccess.go +++ b/pkg/clientset/versioned/typed/storage/v1/clusteraccess.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ClusterAccessesGetter has a method to return a ClusterAccessInterface. @@ -24,6 +23,7 @@ type ClusterAccessesGetter interface { type ClusterAccessInterface interface { Create(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.CreateOptions) (*v1.ClusterAccess, error) Update(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (*v1.ClusterAccess, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (*v1.ClusterAccess, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type ClusterAccessInterface interface { // clusterAccesses implements ClusterAccessInterface type clusterAccesses struct { - client rest.Interface + *gentype.ClientWithList[*v1.ClusterAccess, *v1.ClusterAccessList] } // newClusterAccesses returns a ClusterAccesses func newClusterAccesses(c *StorageV1Client) *clusterAccesses { return &clusterAccesses{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.ClusterAccess, *v1.ClusterAccessList]( + "clusteraccesses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ClusterAccess { return &v1.ClusterAccess{} }, + func() *v1.ClusterAccessList { return &v1.ClusterAccessList{} }), } } - -// Get takes name of the clusterAccess, and returns the corresponding clusterAccess object, and an error if there is any. -func (c *clusterAccesses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterAccess, err error) { - result = &v1.ClusterAccess{} - err = c.client.Get(). - Resource("clusteraccesses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterAccesses that match those selectors. -func (c *clusterAccesses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterAccessList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterAccessList{} - err = c.client.Get(). - Resource("clusteraccesses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterAccesses. -func (c *clusterAccesses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("clusteraccesses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterAccess and creates it. Returns the server's representation of the clusterAccess, and an error, if there is any. -func (c *clusterAccesses) Create(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.CreateOptions) (result *v1.ClusterAccess, err error) { - result = &v1.ClusterAccess{} - err = c.client.Post(). - Resource("clusteraccesses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterAccess). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterAccess and updates it. Returns the server's representation of the clusterAccess, and an error, if there is any. -func (c *clusterAccesses) Update(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (result *v1.ClusterAccess, err error) { - result = &v1.ClusterAccess{} - err = c.client.Put(). - Resource("clusteraccesses"). - Name(clusterAccess.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterAccess). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *clusterAccesses) UpdateStatus(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (result *v1.ClusterAccess, err error) { - result = &v1.ClusterAccess{} - err = c.client.Put(). - Resource("clusteraccesses"). - Name(clusterAccess.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterAccess). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterAccess and deletes it. Returns an error if one occurs. -func (c *clusterAccesses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusteraccesses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterAccesses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clusteraccesses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterAccess. -func (c *clusterAccesses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterAccess, err error) { - result = &v1.ClusterAccess{} - err = c.client.Patch(pt). - Resource("clusteraccesses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/clusterroletemplate.go b/pkg/clientset/versioned/typed/storage/v1/clusterroletemplate.go index 8491135..584ed11 100644 --- a/pkg/clientset/versioned/typed/storage/v1/clusterroletemplate.go +++ b/pkg/clientset/versioned/typed/storage/v1/clusterroletemplate.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ClusterRoleTemplatesGetter has a method to return a ClusterRoleTemplateInterface. @@ -24,6 +23,7 @@ type ClusterRoleTemplatesGetter interface { type ClusterRoleTemplateInterface interface { Create(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.CreateOptions) (*v1.ClusterRoleTemplate, error) Update(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (*v1.ClusterRoleTemplate, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (*v1.ClusterRoleTemplate, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type ClusterRoleTemplateInterface interface { // clusterRoleTemplates implements ClusterRoleTemplateInterface type clusterRoleTemplates struct { - client rest.Interface + *gentype.ClientWithList[*v1.ClusterRoleTemplate, *v1.ClusterRoleTemplateList] } // newClusterRoleTemplates returns a ClusterRoleTemplates func newClusterRoleTemplates(c *StorageV1Client) *clusterRoleTemplates { return &clusterRoleTemplates{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.ClusterRoleTemplate, *v1.ClusterRoleTemplateList]( + "clusterroletemplates", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ClusterRoleTemplate { return &v1.ClusterRoleTemplate{} }, + func() *v1.ClusterRoleTemplateList { return &v1.ClusterRoleTemplateList{} }), } } - -// Get takes name of the clusterRoleTemplate, and returns the corresponding clusterRoleTemplate object, and an error if there is any. -func (c *clusterRoleTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRoleTemplate, err error) { - result = &v1.ClusterRoleTemplate{} - err = c.client.Get(). - Resource("clusterroletemplates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterRoleTemplates that match those selectors. -func (c *clusterRoleTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterRoleTemplateList{} - err = c.client.Get(). - Resource("clusterroletemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterRoleTemplates. -func (c *clusterRoleTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("clusterroletemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterRoleTemplate and creates it. Returns the server's representation of the clusterRoleTemplate, and an error, if there is any. -func (c *clusterRoleTemplates) Create(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.CreateOptions) (result *v1.ClusterRoleTemplate, err error) { - result = &v1.ClusterRoleTemplate{} - err = c.client.Post(). - Resource("clusterroletemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRoleTemplate). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterRoleTemplate and updates it. Returns the server's representation of the clusterRoleTemplate, and an error, if there is any. -func (c *clusterRoleTemplates) Update(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (result *v1.ClusterRoleTemplate, err error) { - result = &v1.ClusterRoleTemplate{} - err = c.client.Put(). - Resource("clusterroletemplates"). - Name(clusterRoleTemplate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRoleTemplate). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *clusterRoleTemplates) UpdateStatus(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (result *v1.ClusterRoleTemplate, err error) { - result = &v1.ClusterRoleTemplate{} - err = c.client.Put(). - Resource("clusterroletemplates"). - Name(clusterRoleTemplate.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRoleTemplate). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterRoleTemplate and deletes it. Returns an error if one occurs. -func (c *clusterRoleTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterroletemplates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterRoleTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clusterroletemplates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterRoleTemplate. -func (c *clusterRoleTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleTemplate, err error) { - result = &v1.ClusterRoleTemplate{} - err = c.client.Patch(pt). - Resource("clusterroletemplates"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/devpodenvironmenttemplate.go b/pkg/clientset/versioned/typed/storage/v1/devpodenvironmenttemplate.go index 776f2b4..4b73b5d 100644 --- a/pkg/clientset/versioned/typed/storage/v1/devpodenvironmenttemplate.go +++ b/pkg/clientset/versioned/typed/storage/v1/devpodenvironmenttemplate.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // DevPodEnvironmentTemplatesGetter has a method to return a DevPodEnvironmentTemplateInterface. @@ -35,118 +34,18 @@ type DevPodEnvironmentTemplateInterface interface { // devPodEnvironmentTemplates implements DevPodEnvironmentTemplateInterface type devPodEnvironmentTemplates struct { - client rest.Interface + *gentype.ClientWithList[*v1.DevPodEnvironmentTemplate, *v1.DevPodEnvironmentTemplateList] } // newDevPodEnvironmentTemplates returns a DevPodEnvironmentTemplates func newDevPodEnvironmentTemplates(c *StorageV1Client) *devPodEnvironmentTemplates { return &devPodEnvironmentTemplates{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.DevPodEnvironmentTemplate, *v1.DevPodEnvironmentTemplateList]( + "devpodenvironmenttemplates", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.DevPodEnvironmentTemplate { return &v1.DevPodEnvironmentTemplate{} }, + func() *v1.DevPodEnvironmentTemplateList { return &v1.DevPodEnvironmentTemplateList{} }), } } - -// Get takes name of the devPodEnvironmentTemplate, and returns the corresponding devPodEnvironmentTemplate object, and an error if there is any. -func (c *devPodEnvironmentTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodEnvironmentTemplate, err error) { - result = &v1.DevPodEnvironmentTemplate{} - err = c.client.Get(). - Resource("devpodenvironmenttemplates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DevPodEnvironmentTemplates that match those selectors. -func (c *devPodEnvironmentTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodEnvironmentTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DevPodEnvironmentTemplateList{} - err = c.client.Get(). - Resource("devpodenvironmenttemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested devPodEnvironmentTemplates. -func (c *devPodEnvironmentTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("devpodenvironmenttemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a devPodEnvironmentTemplate and creates it. Returns the server's representation of the devPodEnvironmentTemplate, and an error, if there is any. -func (c *devPodEnvironmentTemplates) Create(ctx context.Context, devPodEnvironmentTemplate *v1.DevPodEnvironmentTemplate, opts metav1.CreateOptions) (result *v1.DevPodEnvironmentTemplate, err error) { - result = &v1.DevPodEnvironmentTemplate{} - err = c.client.Post(). - Resource("devpodenvironmenttemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodEnvironmentTemplate). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a devPodEnvironmentTemplate and updates it. Returns the server's representation of the devPodEnvironmentTemplate, and an error, if there is any. -func (c *devPodEnvironmentTemplates) Update(ctx context.Context, devPodEnvironmentTemplate *v1.DevPodEnvironmentTemplate, opts metav1.UpdateOptions) (result *v1.DevPodEnvironmentTemplate, err error) { - result = &v1.DevPodEnvironmentTemplate{} - err = c.client.Put(). - Resource("devpodenvironmenttemplates"). - Name(devPodEnvironmentTemplate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodEnvironmentTemplate). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the devPodEnvironmentTemplate and deletes it. Returns an error if one occurs. -func (c *devPodEnvironmentTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("devpodenvironmenttemplates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *devPodEnvironmentTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("devpodenvironmenttemplates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched devPodEnvironmentTemplate. -func (c *devPodEnvironmentTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodEnvironmentTemplate, err error) { - result = &v1.DevPodEnvironmentTemplate{} - err = c.client.Patch(pt). - Resource("devpodenvironmenttemplates"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/devpodworkspaceinstance.go b/pkg/clientset/versioned/typed/storage/v1/devpodworkspaceinstance.go index 6a5019d..61aef3a 100644 --- a/pkg/clientset/versioned/typed/storage/v1/devpodworkspaceinstance.go +++ b/pkg/clientset/versioned/typed/storage/v1/devpodworkspaceinstance.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // DevPodWorkspaceInstancesGetter has a method to return a DevPodWorkspaceInstanceInterface. @@ -35,128 +34,18 @@ type DevPodWorkspaceInstanceInterface interface { // devPodWorkspaceInstances implements DevPodWorkspaceInstanceInterface type devPodWorkspaceInstances struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.DevPodWorkspaceInstance, *v1.DevPodWorkspaceInstanceList] } // newDevPodWorkspaceInstances returns a DevPodWorkspaceInstances func newDevPodWorkspaceInstances(c *StorageV1Client, namespace string) *devPodWorkspaceInstances { return &devPodWorkspaceInstances{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.DevPodWorkspaceInstance, *v1.DevPodWorkspaceInstanceList]( + "devpodworkspaceinstances", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.DevPodWorkspaceInstance { return &v1.DevPodWorkspaceInstance{} }, + func() *v1.DevPodWorkspaceInstanceList { return &v1.DevPodWorkspaceInstanceList{} }), } } - -// Get takes name of the devPodWorkspaceInstance, and returns the corresponding devPodWorkspaceInstance object, and an error if there is any. -func (c *devPodWorkspaceInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodWorkspaceInstance, err error) { - result = &v1.DevPodWorkspaceInstance{} - err = c.client.Get(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DevPodWorkspaceInstances that match those selectors. -func (c *devPodWorkspaceInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodWorkspaceInstanceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DevPodWorkspaceInstanceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested devPodWorkspaceInstances. -func (c *devPodWorkspaceInstances) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a devPodWorkspaceInstance and creates it. Returns the server's representation of the devPodWorkspaceInstance, and an error, if there is any. -func (c *devPodWorkspaceInstances) Create(ctx context.Context, devPodWorkspaceInstance *v1.DevPodWorkspaceInstance, opts metav1.CreateOptions) (result *v1.DevPodWorkspaceInstance, err error) { - result = &v1.DevPodWorkspaceInstance{} - err = c.client.Post(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodWorkspaceInstance). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a devPodWorkspaceInstance and updates it. Returns the server's representation of the devPodWorkspaceInstance, and an error, if there is any. -func (c *devPodWorkspaceInstances) Update(ctx context.Context, devPodWorkspaceInstance *v1.DevPodWorkspaceInstance, opts metav1.UpdateOptions) (result *v1.DevPodWorkspaceInstance, err error) { - result = &v1.DevPodWorkspaceInstance{} - err = c.client.Put(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - Name(devPodWorkspaceInstance.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodWorkspaceInstance). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the devPodWorkspaceInstance and deletes it. Returns an error if one occurs. -func (c *devPodWorkspaceInstances) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *devPodWorkspaceInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched devPodWorkspaceInstance. -func (c *devPodWorkspaceInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspaceInstance, err error) { - result = &v1.DevPodWorkspaceInstance{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("devpodworkspaceinstances"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/devpodworkspacetemplate.go b/pkg/clientset/versioned/typed/storage/v1/devpodworkspacetemplate.go index 0495b19..2cc63af 100644 --- a/pkg/clientset/versioned/typed/storage/v1/devpodworkspacetemplate.go +++ b/pkg/clientset/versioned/typed/storage/v1/devpodworkspacetemplate.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // DevPodWorkspaceTemplatesGetter has a method to return a DevPodWorkspaceTemplateInterface. @@ -24,6 +23,7 @@ type DevPodWorkspaceTemplatesGetter interface { type DevPodWorkspaceTemplateInterface interface { Create(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.CreateOptions) (*v1.DevPodWorkspaceTemplate, error) Update(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (*v1.DevPodWorkspaceTemplate, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (*v1.DevPodWorkspaceTemplate, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type DevPodWorkspaceTemplateInterface interface { // devPodWorkspaceTemplates implements DevPodWorkspaceTemplateInterface type devPodWorkspaceTemplates struct { - client rest.Interface + *gentype.ClientWithList[*v1.DevPodWorkspaceTemplate, *v1.DevPodWorkspaceTemplateList] } // newDevPodWorkspaceTemplates returns a DevPodWorkspaceTemplates func newDevPodWorkspaceTemplates(c *StorageV1Client) *devPodWorkspaceTemplates { return &devPodWorkspaceTemplates{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.DevPodWorkspaceTemplate, *v1.DevPodWorkspaceTemplateList]( + "devpodworkspacetemplates", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.DevPodWorkspaceTemplate { return &v1.DevPodWorkspaceTemplate{} }, + func() *v1.DevPodWorkspaceTemplateList { return &v1.DevPodWorkspaceTemplateList{} }), } } - -// Get takes name of the devPodWorkspaceTemplate, and returns the corresponding devPodWorkspaceTemplate object, and an error if there is any. -func (c *devPodWorkspaceTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodWorkspaceTemplate, err error) { - result = &v1.DevPodWorkspaceTemplate{} - err = c.client.Get(). - Resource("devpodworkspacetemplates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DevPodWorkspaceTemplates that match those selectors. -func (c *devPodWorkspaceTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodWorkspaceTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DevPodWorkspaceTemplateList{} - err = c.client.Get(). - Resource("devpodworkspacetemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested devPodWorkspaceTemplates. -func (c *devPodWorkspaceTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("devpodworkspacetemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a devPodWorkspaceTemplate and creates it. Returns the server's representation of the devPodWorkspaceTemplate, and an error, if there is any. -func (c *devPodWorkspaceTemplates) Create(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.CreateOptions) (result *v1.DevPodWorkspaceTemplate, err error) { - result = &v1.DevPodWorkspaceTemplate{} - err = c.client.Post(). - Resource("devpodworkspacetemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodWorkspaceTemplate). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a devPodWorkspaceTemplate and updates it. Returns the server's representation of the devPodWorkspaceTemplate, and an error, if there is any. -func (c *devPodWorkspaceTemplates) Update(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (result *v1.DevPodWorkspaceTemplate, err error) { - result = &v1.DevPodWorkspaceTemplate{} - err = c.client.Put(). - Resource("devpodworkspacetemplates"). - Name(devPodWorkspaceTemplate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodWorkspaceTemplate). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *devPodWorkspaceTemplates) UpdateStatus(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (result *v1.DevPodWorkspaceTemplate, err error) { - result = &v1.DevPodWorkspaceTemplate{} - err = c.client.Put(). - Resource("devpodworkspacetemplates"). - Name(devPodWorkspaceTemplate.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(devPodWorkspaceTemplate). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the devPodWorkspaceTemplate and deletes it. Returns an error if one occurs. -func (c *devPodWorkspaceTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("devpodworkspacetemplates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *devPodWorkspaceTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("devpodworkspacetemplates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched devPodWorkspaceTemplate. -func (c *devPodWorkspaceTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspaceTemplate, err error) { - result = &v1.DevPodWorkspaceTemplate{} - err = c.client.Patch(pt). - Resource("devpodworkspacetemplates"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_accesskey.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_accesskey.go index c7b792e..cb5a5d5 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_accesskey.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_accesskey.go @@ -24,20 +24,22 @@ var accesskeysKind = v1.SchemeGroupVersion.WithKind("AccessKey") // Get takes name of the accessKey, and returns the corresponding accessKey object, and an error if there is any. func (c *FakeAccessKeys) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AccessKey, err error) { + emptyResult := &v1.AccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(accesskeysResource, name), &v1.AccessKey{}) + Invokes(testing.NewRootGetActionWithOptions(accesskeysResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.AccessKey), err } // List takes label and field selectors, and returns the list of AccessKeys that match those selectors. func (c *FakeAccessKeys) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AccessKeyList, err error) { + emptyResult := &v1.AccessKeyList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(accesskeysResource, accesskeysKind, opts), &v1.AccessKeyList{}) + Invokes(testing.NewRootListActionWithOptions(accesskeysResource, accesskeysKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeAccessKeys) List(ctx context.Context, opts metav1.ListOptions) (res // Watch returns a watch.Interface that watches the requested accessKeys. func (c *FakeAccessKeys) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(accesskeysResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(accesskeysResource, opts)) } // Create takes the representation of a accessKey and creates it. Returns the server's representation of the accessKey, and an error, if there is any. func (c *FakeAccessKeys) Create(ctx context.Context, accessKey *v1.AccessKey, opts metav1.CreateOptions) (result *v1.AccessKey, err error) { + emptyResult := &v1.AccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(accesskeysResource, accessKey), &v1.AccessKey{}) + Invokes(testing.NewRootCreateActionWithOptions(accesskeysResource, accessKey, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.AccessKey), err } // Update takes the representation of a accessKey and updates it. Returns the server's representation of the accessKey, and an error, if there is any. func (c *FakeAccessKeys) Update(ctx context.Context, accessKey *v1.AccessKey, opts metav1.UpdateOptions) (result *v1.AccessKey, err error) { + emptyResult := &v1.AccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(accesskeysResource, accessKey), &v1.AccessKey{}) + Invokes(testing.NewRootUpdateActionWithOptions(accesskeysResource, accessKey, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.AccessKey), 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 *FakeAccessKeys) UpdateStatus(ctx context.Context, accessKey *v1.AccessKey, opts metav1.UpdateOptions) (*v1.AccessKey, error) { +func (c *FakeAccessKeys) UpdateStatus(ctx context.Context, accessKey *v1.AccessKey, opts metav1.UpdateOptions) (result *v1.AccessKey, err error) { + emptyResult := &v1.AccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(accesskeysResource, "status", accessKey), &v1.AccessKey{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(accesskeysResource, "status", accessKey, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.AccessKey), err } @@ -99,7 +104,7 @@ func (c *FakeAccessKeys) Delete(ctx context.Context, name string, opts metav1.De // DeleteCollection deletes a collection of objects. func (c *FakeAccessKeys) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(accesskeysResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(accesskeysResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.AccessKeyList{}) return err @@ -107,10 +112,11 @@ func (c *FakeAccessKeys) DeleteCollection(ctx context.Context, opts metav1.Delet // Patch applies the patch and returns the patched accessKey. func (c *FakeAccessKeys) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AccessKey, err error) { + emptyResult := &v1.AccessKey{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(accesskeysResource, name, pt, data, subresources...), &v1.AccessKey{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(accesskeysResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.AccessKey), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_app.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_app.go index 5a06c76..b7fe58f 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_app.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_app.go @@ -24,20 +24,22 @@ var appsKind = v1.SchemeGroupVersion.WithKind("App") // Get takes name of the app, and returns the corresponding app object, and an error if there is any. func (c *FakeApps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.App, err error) { + emptyResult := &v1.App{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(appsResource, name), &v1.App{}) + Invokes(testing.NewRootGetActionWithOptions(appsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.App), err } // List takes label and field selectors, and returns the list of Apps that match those selectors. func (c *FakeApps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppList, err error) { + emptyResult := &v1.AppList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(appsResource, appsKind, opts), &v1.AppList{}) + Invokes(testing.NewRootListActionWithOptions(appsResource, appsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeApps) List(ctx context.Context, opts metav1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested apps. func (c *FakeApps) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(appsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(appsResource, opts)) } // Create takes the representation of a app and creates it. Returns the server's representation of the app, and an error, if there is any. func (c *FakeApps) Create(ctx context.Context, app *v1.App, opts metav1.CreateOptions) (result *v1.App, err error) { + emptyResult := &v1.App{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(appsResource, app), &v1.App{}) + Invokes(testing.NewRootCreateActionWithOptions(appsResource, app, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.App), err } // Update takes the representation of a app and updates it. Returns the server's representation of the app, and an error, if there is any. func (c *FakeApps) Update(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (result *v1.App, err error) { + emptyResult := &v1.App{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(appsResource, app), &v1.App{}) + Invokes(testing.NewRootUpdateActionWithOptions(appsResource, app, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.App), 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 *FakeApps) UpdateStatus(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (*v1.App, error) { +func (c *FakeApps) UpdateStatus(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (result *v1.App, err error) { + emptyResult := &v1.App{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(appsResource, "status", app), &v1.App{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(appsResource, "status", app, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.App), err } @@ -99,7 +104,7 @@ func (c *FakeApps) Delete(ctx context.Context, name string, opts metav1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakeApps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(appsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(appsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.AppList{}) return err @@ -107,10 +112,11 @@ func (c *FakeApps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptio // Patch applies the patch and returns the patched app. func (c *FakeApps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.App, err error) { + emptyResult := &v1.App{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(appsResource, name, pt, data, subresources...), &v1.App{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(appsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.App), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_cluster.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_cluster.go index 6e5a0cc..db367f6 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_cluster.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_cluster.go @@ -24,20 +24,22 @@ var clustersKind = v1.SchemeGroupVersion.WithKind("Cluster") // Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. func (c *FakeClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Cluster, err error) { + emptyResult := &v1.Cluster{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clustersResource, name), &v1.Cluster{}) + Invokes(testing.NewRootGetActionWithOptions(clustersResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Cluster), err } // List takes label and field selectors, and returns the list of Clusters that match those selectors. func (c *FakeClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterList, err error) { + emptyResult := &v1.ClusterList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clustersResource, clustersKind, opts), &v1.ClusterList{}) + Invokes(testing.NewRootListActionWithOptions(clustersResource, clustersKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeClusters) List(ctx context.Context, opts metav1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested clusters. func (c *FakeClusters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clustersResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clustersResource, opts)) } // Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. func (c *FakeClusters) Create(ctx context.Context, cluster *v1.Cluster, opts metav1.CreateOptions) (result *v1.Cluster, err error) { + emptyResult := &v1.Cluster{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clustersResource, cluster), &v1.Cluster{}) + Invokes(testing.NewRootCreateActionWithOptions(clustersResource, cluster, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Cluster), err } // Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. func (c *FakeClusters) Update(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (result *v1.Cluster, err error) { + emptyResult := &v1.Cluster{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clustersResource, cluster), &v1.Cluster{}) + Invokes(testing.NewRootUpdateActionWithOptions(clustersResource, cluster, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Cluster), 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 *FakeClusters) UpdateStatus(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (*v1.Cluster, error) { +func (c *FakeClusters) UpdateStatus(ctx context.Context, cluster *v1.Cluster, opts metav1.UpdateOptions) (result *v1.Cluster, err error) { + emptyResult := &v1.Cluster{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &v1.Cluster{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(clustersResource, "status", cluster, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Cluster), err } @@ -99,7 +104,7 @@ func (c *FakeClusters) Delete(ctx context.Context, name string, opts metav1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clustersResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clustersResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ClusterList{}) return err @@ -107,10 +112,11 @@ func (c *FakeClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteO // Patch applies the patch and returns the patched cluster. func (c *FakeClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Cluster, err error) { + emptyResult := &v1.Cluster{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustersResource, name, pt, data, subresources...), &v1.Cluster{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clustersResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Cluster), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_clusteraccess.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_clusteraccess.go index ef53263..e2ab260 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_clusteraccess.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_clusteraccess.go @@ -24,20 +24,22 @@ var clusteraccessesKind = v1.SchemeGroupVersion.WithKind("ClusterAccess") // Get takes name of the clusterAccess, and returns the corresponding clusterAccess object, and an error if there is any. func (c *FakeClusterAccesses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterAccess, err error) { + emptyResult := &v1.ClusterAccess{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusteraccessesResource, name), &v1.ClusterAccess{}) + Invokes(testing.NewRootGetActionWithOptions(clusteraccessesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterAccess), err } // List takes label and field selectors, and returns the list of ClusterAccesses that match those selectors. func (c *FakeClusterAccesses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterAccessList, err error) { + emptyResult := &v1.ClusterAccessList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusteraccessesResource, clusteraccessesKind, opts), &v1.ClusterAccessList{}) + Invokes(testing.NewRootListActionWithOptions(clusteraccessesResource, clusteraccessesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeClusterAccesses) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested clusterAccesses. func (c *FakeClusterAccesses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusteraccessesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clusteraccessesResource, opts)) } // Create takes the representation of a clusterAccess and creates it. Returns the server's representation of the clusterAccess, and an error, if there is any. func (c *FakeClusterAccesses) Create(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.CreateOptions) (result *v1.ClusterAccess, err error) { + emptyResult := &v1.ClusterAccess{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusteraccessesResource, clusterAccess), &v1.ClusterAccess{}) + Invokes(testing.NewRootCreateActionWithOptions(clusteraccessesResource, clusterAccess, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterAccess), err } // Update takes the representation of a clusterAccess and updates it. Returns the server's representation of the clusterAccess, and an error, if there is any. func (c *FakeClusterAccesses) Update(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (result *v1.ClusterAccess, err error) { + emptyResult := &v1.ClusterAccess{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusteraccessesResource, clusterAccess), &v1.ClusterAccess{}) + Invokes(testing.NewRootUpdateActionWithOptions(clusteraccessesResource, clusterAccess, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterAccess), 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 *FakeClusterAccesses) UpdateStatus(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (*v1.ClusterAccess, error) { +func (c *FakeClusterAccesses) UpdateStatus(ctx context.Context, clusterAccess *v1.ClusterAccess, opts metav1.UpdateOptions) (result *v1.ClusterAccess, err error) { + emptyResult := &v1.ClusterAccess{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clusteraccessesResource, "status", clusterAccess), &v1.ClusterAccess{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(clusteraccessesResource, "status", clusterAccess, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterAccess), err } @@ -99,7 +104,7 @@ func (c *FakeClusterAccesses) Delete(ctx context.Context, name string, opts meta // DeleteCollection deletes a collection of objects. func (c *FakeClusterAccesses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusteraccessesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clusteraccessesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ClusterAccessList{}) return err @@ -107,10 +112,11 @@ func (c *FakeClusterAccesses) DeleteCollection(ctx context.Context, opts metav1. // Patch applies the patch and returns the patched clusterAccess. func (c *FakeClusterAccesses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterAccess, err error) { + emptyResult := &v1.ClusterAccess{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusteraccessesResource, name, pt, data, subresources...), &v1.ClusterAccess{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusteraccessesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterAccess), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_clusterroletemplate.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_clusterroletemplate.go index a0f1ef9..3c20596 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_clusterroletemplate.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_clusterroletemplate.go @@ -24,20 +24,22 @@ var clusterroletemplatesKind = v1.SchemeGroupVersion.WithKind("ClusterRoleTempla // Get takes name of the clusterRoleTemplate, and returns the corresponding clusterRoleTemplate object, and an error if there is any. func (c *FakeClusterRoleTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRoleTemplate, err error) { + emptyResult := &v1.ClusterRoleTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterroletemplatesResource, name), &v1.ClusterRoleTemplate{}) + Invokes(testing.NewRootGetActionWithOptions(clusterroletemplatesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleTemplate), err } // List takes label and field selectors, and returns the list of ClusterRoleTemplates that match those selectors. func (c *FakeClusterRoleTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleTemplateList, err error) { + emptyResult := &v1.ClusterRoleTemplateList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterroletemplatesResource, clusterroletemplatesKind, opts), &v1.ClusterRoleTemplateList{}) + Invokes(testing.NewRootListActionWithOptions(clusterroletemplatesResource, clusterroletemplatesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeClusterRoleTemplates) List(ctx context.Context, opts metav1.ListOpt // Watch returns a watch.Interface that watches the requested clusterRoleTemplates. func (c *FakeClusterRoleTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusterroletemplatesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clusterroletemplatesResource, opts)) } // Create takes the representation of a clusterRoleTemplate and creates it. Returns the server's representation of the clusterRoleTemplate, and an error, if there is any. func (c *FakeClusterRoleTemplates) Create(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.CreateOptions) (result *v1.ClusterRoleTemplate, err error) { + emptyResult := &v1.ClusterRoleTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterroletemplatesResource, clusterRoleTemplate), &v1.ClusterRoleTemplate{}) + Invokes(testing.NewRootCreateActionWithOptions(clusterroletemplatesResource, clusterRoleTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleTemplate), err } // Update takes the representation of a clusterRoleTemplate and updates it. Returns the server's representation of the clusterRoleTemplate, and an error, if there is any. func (c *FakeClusterRoleTemplates) Update(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (result *v1.ClusterRoleTemplate, err error) { + emptyResult := &v1.ClusterRoleTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterroletemplatesResource, clusterRoleTemplate), &v1.ClusterRoleTemplate{}) + Invokes(testing.NewRootUpdateActionWithOptions(clusterroletemplatesResource, clusterRoleTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleTemplate), 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 *FakeClusterRoleTemplates) UpdateStatus(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (*v1.ClusterRoleTemplate, error) { +func (c *FakeClusterRoleTemplates) UpdateStatus(ctx context.Context, clusterRoleTemplate *v1.ClusterRoleTemplate, opts metav1.UpdateOptions) (result *v1.ClusterRoleTemplate, err error) { + emptyResult := &v1.ClusterRoleTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clusterroletemplatesResource, "status", clusterRoleTemplate), &v1.ClusterRoleTemplate{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(clusterroletemplatesResource, "status", clusterRoleTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleTemplate), err } @@ -99,7 +104,7 @@ func (c *FakeClusterRoleTemplates) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoleTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterroletemplatesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clusterroletemplatesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ClusterRoleTemplateList{}) return err @@ -107,10 +112,11 @@ func (c *FakeClusterRoleTemplates) DeleteCollection(ctx context.Context, opts me // Patch applies the patch and returns the patched clusterRoleTemplate. func (c *FakeClusterRoleTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleTemplate, err error) { + emptyResult := &v1.ClusterRoleTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterroletemplatesResource, name, pt, data, subresources...), &v1.ClusterRoleTemplate{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterroletemplatesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleTemplate), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodenvironmenttemplate.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodenvironmenttemplate.go index 68ebb49..544701e 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodenvironmenttemplate.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodenvironmenttemplate.go @@ -24,20 +24,22 @@ var devpodenvironmenttemplatesKind = v1.SchemeGroupVersion.WithKind("DevPodEnvir // Get takes name of the devPodEnvironmentTemplate, and returns the corresponding devPodEnvironmentTemplate object, and an error if there is any. func (c *FakeDevPodEnvironmentTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodEnvironmentTemplate, err error) { + emptyResult := &v1.DevPodEnvironmentTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(devpodenvironmenttemplatesResource, name), &v1.DevPodEnvironmentTemplate{}) + Invokes(testing.NewRootGetActionWithOptions(devpodenvironmenttemplatesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodEnvironmentTemplate), err } // List takes label and field selectors, and returns the list of DevPodEnvironmentTemplates that match those selectors. func (c *FakeDevPodEnvironmentTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodEnvironmentTemplateList, err error) { + emptyResult := &v1.DevPodEnvironmentTemplateList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(devpodenvironmenttemplatesResource, devpodenvironmenttemplatesKind, opts), &v1.DevPodEnvironmentTemplateList{}) + Invokes(testing.NewRootListActionWithOptions(devpodenvironmenttemplatesResource, devpodenvironmenttemplatesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,25 +58,27 @@ func (c *FakeDevPodEnvironmentTemplates) List(ctx context.Context, opts metav1.L // Watch returns a watch.Interface that watches the requested devPodEnvironmentTemplates. func (c *FakeDevPodEnvironmentTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(devpodenvironmenttemplatesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(devpodenvironmenttemplatesResource, opts)) } // Create takes the representation of a devPodEnvironmentTemplate and creates it. Returns the server's representation of the devPodEnvironmentTemplate, and an error, if there is any. func (c *FakeDevPodEnvironmentTemplates) Create(ctx context.Context, devPodEnvironmentTemplate *v1.DevPodEnvironmentTemplate, opts metav1.CreateOptions) (result *v1.DevPodEnvironmentTemplate, err error) { + emptyResult := &v1.DevPodEnvironmentTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(devpodenvironmenttemplatesResource, devPodEnvironmentTemplate), &v1.DevPodEnvironmentTemplate{}) + Invokes(testing.NewRootCreateActionWithOptions(devpodenvironmenttemplatesResource, devPodEnvironmentTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodEnvironmentTemplate), err } // Update takes the representation of a devPodEnvironmentTemplate and updates it. Returns the server's representation of the devPodEnvironmentTemplate, and an error, if there is any. func (c *FakeDevPodEnvironmentTemplates) Update(ctx context.Context, devPodEnvironmentTemplate *v1.DevPodEnvironmentTemplate, opts metav1.UpdateOptions) (result *v1.DevPodEnvironmentTemplate, err error) { + emptyResult := &v1.DevPodEnvironmentTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(devpodenvironmenttemplatesResource, devPodEnvironmentTemplate), &v1.DevPodEnvironmentTemplate{}) + Invokes(testing.NewRootUpdateActionWithOptions(devpodenvironmenttemplatesResource, devPodEnvironmentTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodEnvironmentTemplate), err } @@ -88,7 +92,7 @@ func (c *FakeDevPodEnvironmentTemplates) Delete(ctx context.Context, name string // DeleteCollection deletes a collection of objects. func (c *FakeDevPodEnvironmentTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(devpodenvironmenttemplatesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(devpodenvironmenttemplatesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.DevPodEnvironmentTemplateList{}) return err @@ -96,10 +100,11 @@ func (c *FakeDevPodEnvironmentTemplates) DeleteCollection(ctx context.Context, o // Patch applies the patch and returns the patched devPodEnvironmentTemplate. func (c *FakeDevPodEnvironmentTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodEnvironmentTemplate, err error) { + emptyResult := &v1.DevPodEnvironmentTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(devpodenvironmenttemplatesResource, name, pt, data, subresources...), &v1.DevPodEnvironmentTemplate{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(devpodenvironmenttemplatesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodEnvironmentTemplate), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspaceinstance.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspaceinstance.go index e0f9b83..b840f2c 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspaceinstance.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspaceinstance.go @@ -25,22 +25,24 @@ var devpodworkspaceinstancesKind = v1.SchemeGroupVersion.WithKind("DevPodWorkspa // Get takes name of the devPodWorkspaceInstance, and returns the corresponding devPodWorkspaceInstance object, and an error if there is any. func (c *FakeDevPodWorkspaceInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodWorkspaceInstance, err error) { + emptyResult := &v1.DevPodWorkspaceInstance{} obj, err := c.Fake. - Invokes(testing.NewGetAction(devpodworkspaceinstancesResource, c.ns, name), &v1.DevPodWorkspaceInstance{}) + Invokes(testing.NewGetActionWithOptions(devpodworkspaceinstancesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceInstance), err } // List takes label and field selectors, and returns the list of DevPodWorkspaceInstances that match those selectors. func (c *FakeDevPodWorkspaceInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodWorkspaceInstanceList, err error) { + emptyResult := &v1.DevPodWorkspaceInstanceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(devpodworkspaceinstancesResource, devpodworkspaceinstancesKind, c.ns, opts), &v1.DevPodWorkspaceInstanceList{}) + Invokes(testing.NewListActionWithOptions(devpodworkspaceinstancesResource, devpodworkspaceinstancesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,28 +61,30 @@ func (c *FakeDevPodWorkspaceInstances) List(ctx context.Context, opts metav1.Lis // Watch returns a watch.Interface that watches the requested devPodWorkspaceInstances. func (c *FakeDevPodWorkspaceInstances) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(devpodworkspaceinstancesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(devpodworkspaceinstancesResource, c.ns, opts)) } // Create takes the representation of a devPodWorkspaceInstance and creates it. Returns the server's representation of the devPodWorkspaceInstance, and an error, if there is any. func (c *FakeDevPodWorkspaceInstances) Create(ctx context.Context, devPodWorkspaceInstance *v1.DevPodWorkspaceInstance, opts metav1.CreateOptions) (result *v1.DevPodWorkspaceInstance, err error) { + emptyResult := &v1.DevPodWorkspaceInstance{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(devpodworkspaceinstancesResource, c.ns, devPodWorkspaceInstance), &v1.DevPodWorkspaceInstance{}) + Invokes(testing.NewCreateActionWithOptions(devpodworkspaceinstancesResource, c.ns, devPodWorkspaceInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceInstance), err } // Update takes the representation of a devPodWorkspaceInstance and updates it. Returns the server's representation of the devPodWorkspaceInstance, and an error, if there is any. func (c *FakeDevPodWorkspaceInstances) Update(ctx context.Context, devPodWorkspaceInstance *v1.DevPodWorkspaceInstance, opts metav1.UpdateOptions) (result *v1.DevPodWorkspaceInstance, err error) { + emptyResult := &v1.DevPodWorkspaceInstance{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(devpodworkspaceinstancesResource, c.ns, devPodWorkspaceInstance), &v1.DevPodWorkspaceInstance{}) + Invokes(testing.NewUpdateActionWithOptions(devpodworkspaceinstancesResource, c.ns, devPodWorkspaceInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceInstance), err } @@ -95,7 +99,7 @@ func (c *FakeDevPodWorkspaceInstances) Delete(ctx context.Context, name string, // DeleteCollection deletes a collection of objects. func (c *FakeDevPodWorkspaceInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(devpodworkspaceinstancesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(devpodworkspaceinstancesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.DevPodWorkspaceInstanceList{}) return err @@ -103,11 +107,12 @@ func (c *FakeDevPodWorkspaceInstances) DeleteCollection(ctx context.Context, opt // Patch applies the patch and returns the patched devPodWorkspaceInstance. func (c *FakeDevPodWorkspaceInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspaceInstance, err error) { + emptyResult := &v1.DevPodWorkspaceInstance{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(devpodworkspaceinstancesResource, c.ns, name, pt, data, subresources...), &v1.DevPodWorkspaceInstance{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(devpodworkspaceinstancesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceInstance), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspacetemplate.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspacetemplate.go index 08e97a1..206574c 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspacetemplate.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspacetemplate.go @@ -24,20 +24,22 @@ var devpodworkspacetemplatesKind = v1.SchemeGroupVersion.WithKind("DevPodWorkspa // Get takes name of the devPodWorkspaceTemplate, and returns the corresponding devPodWorkspaceTemplate object, and an error if there is any. func (c *FakeDevPodWorkspaceTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodWorkspaceTemplate, err error) { + emptyResult := &v1.DevPodWorkspaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(devpodworkspacetemplatesResource, name), &v1.DevPodWorkspaceTemplate{}) + Invokes(testing.NewRootGetActionWithOptions(devpodworkspacetemplatesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceTemplate), err } // List takes label and field selectors, and returns the list of DevPodWorkspaceTemplates that match those selectors. func (c *FakeDevPodWorkspaceTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodWorkspaceTemplateList, err error) { + emptyResult := &v1.DevPodWorkspaceTemplateList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(devpodworkspacetemplatesResource, devpodworkspacetemplatesKind, opts), &v1.DevPodWorkspaceTemplateList{}) + Invokes(testing.NewRootListActionWithOptions(devpodworkspacetemplatesResource, devpodworkspacetemplatesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeDevPodWorkspaceTemplates) List(ctx context.Context, opts metav1.Lis // Watch returns a watch.Interface that watches the requested devPodWorkspaceTemplates. func (c *FakeDevPodWorkspaceTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(devpodworkspacetemplatesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(devpodworkspacetemplatesResource, opts)) } // Create takes the representation of a devPodWorkspaceTemplate and creates it. Returns the server's representation of the devPodWorkspaceTemplate, and an error, if there is any. func (c *FakeDevPodWorkspaceTemplates) Create(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.CreateOptions) (result *v1.DevPodWorkspaceTemplate, err error) { + emptyResult := &v1.DevPodWorkspaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(devpodworkspacetemplatesResource, devPodWorkspaceTemplate), &v1.DevPodWorkspaceTemplate{}) + Invokes(testing.NewRootCreateActionWithOptions(devpodworkspacetemplatesResource, devPodWorkspaceTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceTemplate), err } // Update takes the representation of a devPodWorkspaceTemplate and updates it. Returns the server's representation of the devPodWorkspaceTemplate, and an error, if there is any. func (c *FakeDevPodWorkspaceTemplates) Update(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (result *v1.DevPodWorkspaceTemplate, err error) { + emptyResult := &v1.DevPodWorkspaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(devpodworkspacetemplatesResource, devPodWorkspaceTemplate), &v1.DevPodWorkspaceTemplate{}) + Invokes(testing.NewRootUpdateActionWithOptions(devpodworkspacetemplatesResource, devPodWorkspaceTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceTemplate), 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 *FakeDevPodWorkspaceTemplates) UpdateStatus(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (*v1.DevPodWorkspaceTemplate, error) { +func (c *FakeDevPodWorkspaceTemplates) UpdateStatus(ctx context.Context, devPodWorkspaceTemplate *v1.DevPodWorkspaceTemplate, opts metav1.UpdateOptions) (result *v1.DevPodWorkspaceTemplate, err error) { + emptyResult := &v1.DevPodWorkspaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(devpodworkspacetemplatesResource, "status", devPodWorkspaceTemplate), &v1.DevPodWorkspaceTemplate{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(devpodworkspacetemplatesResource, "status", devPodWorkspaceTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceTemplate), err } @@ -99,7 +104,7 @@ func (c *FakeDevPodWorkspaceTemplates) Delete(ctx context.Context, name string, // DeleteCollection deletes a collection of objects. func (c *FakeDevPodWorkspaceTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(devpodworkspacetemplatesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(devpodworkspacetemplatesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.DevPodWorkspaceTemplateList{}) return err @@ -107,10 +112,11 @@ func (c *FakeDevPodWorkspaceTemplates) DeleteCollection(ctx context.Context, opt // Patch applies the patch and returns the patched devPodWorkspaceTemplate. func (c *FakeDevPodWorkspaceTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspaceTemplate, err error) { + emptyResult := &v1.DevPodWorkspaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(devpodworkspacetemplatesResource, name, pt, data, subresources...), &v1.DevPodWorkspaceTemplate{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(devpodworkspacetemplatesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DevPodWorkspaceTemplate), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_networkpeer.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_networkpeer.go index dbb66b0..87737e3 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_networkpeer.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_networkpeer.go @@ -24,20 +24,22 @@ var networkpeersKind = v1.SchemeGroupVersion.WithKind("NetworkPeer") // Get takes name of the networkPeer, and returns the corresponding networkPeer object, and an error if there is any. func (c *FakeNetworkPeers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NetworkPeer, err error) { + emptyResult := &v1.NetworkPeer{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(networkpeersResource, name), &v1.NetworkPeer{}) + Invokes(testing.NewRootGetActionWithOptions(networkpeersResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.NetworkPeer), err } // List takes label and field selectors, and returns the list of NetworkPeers that match those selectors. func (c *FakeNetworkPeers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPeerList, err error) { + emptyResult := &v1.NetworkPeerList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(networkpeersResource, networkpeersKind, opts), &v1.NetworkPeerList{}) + Invokes(testing.NewRootListActionWithOptions(networkpeersResource, networkpeersKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeNetworkPeers) List(ctx context.Context, opts metav1.ListOptions) (r // Watch returns a watch.Interface that watches the requested networkPeers. func (c *FakeNetworkPeers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(networkpeersResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(networkpeersResource, opts)) } // Create takes the representation of a networkPeer and creates it. Returns the server's representation of the networkPeer, and an error, if there is any. func (c *FakeNetworkPeers) Create(ctx context.Context, networkPeer *v1.NetworkPeer, opts metav1.CreateOptions) (result *v1.NetworkPeer, err error) { + emptyResult := &v1.NetworkPeer{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(networkpeersResource, networkPeer), &v1.NetworkPeer{}) + Invokes(testing.NewRootCreateActionWithOptions(networkpeersResource, networkPeer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.NetworkPeer), err } // Update takes the representation of a networkPeer and updates it. Returns the server's representation of the networkPeer, and an error, if there is any. func (c *FakeNetworkPeers) Update(ctx context.Context, networkPeer *v1.NetworkPeer, opts metav1.UpdateOptions) (result *v1.NetworkPeer, err error) { + emptyResult := &v1.NetworkPeer{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(networkpeersResource, networkPeer), &v1.NetworkPeer{}) + Invokes(testing.NewRootUpdateActionWithOptions(networkpeersResource, networkPeer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.NetworkPeer), 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 *FakeNetworkPeers) UpdateStatus(ctx context.Context, networkPeer *v1.NetworkPeer, opts metav1.UpdateOptions) (*v1.NetworkPeer, error) { +func (c *FakeNetworkPeers) UpdateStatus(ctx context.Context, networkPeer *v1.NetworkPeer, opts metav1.UpdateOptions) (result *v1.NetworkPeer, err error) { + emptyResult := &v1.NetworkPeer{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(networkpeersResource, "status", networkPeer), &v1.NetworkPeer{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(networkpeersResource, "status", networkPeer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.NetworkPeer), err } @@ -99,7 +104,7 @@ func (c *FakeNetworkPeers) Delete(ctx context.Context, name string, opts metav1. // DeleteCollection deletes a collection of objects. func (c *FakeNetworkPeers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(networkpeersResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(networkpeersResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.NetworkPeerList{}) return err @@ -107,10 +112,11 @@ func (c *FakeNetworkPeers) DeleteCollection(ctx context.Context, opts metav1.Del // Patch applies the patch and returns the patched networkPeer. func (c *FakeNetworkPeers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPeer, err error) { + emptyResult := &v1.NetworkPeer{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(networkpeersResource, name, pt, data, subresources...), &v1.NetworkPeer{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(networkpeersResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.NetworkPeer), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_project.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_project.go index ecd35b6..252c561 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_project.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_project.go @@ -24,20 +24,22 @@ var projectsKind = v1.SchemeGroupVersion.WithKind("Project") // Get takes name of the project, and returns the corresponding project object, and an error if there is any. func (c *FakeProjects) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Project, err error) { + emptyResult := &v1.Project{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(projectsResource, name), &v1.Project{}) + Invokes(testing.NewRootGetActionWithOptions(projectsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Project), err } // List takes label and field selectors, and returns the list of Projects that match those selectors. func (c *FakeProjects) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectList, err error) { + emptyResult := &v1.ProjectList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(projectsResource, projectsKind, opts), &v1.ProjectList{}) + Invokes(testing.NewRootListActionWithOptions(projectsResource, projectsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeProjects) List(ctx context.Context, opts metav1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested projects. func (c *FakeProjects) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(projectsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(projectsResource, opts)) } // Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. func (c *FakeProjects) Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (result *v1.Project, err error) { + emptyResult := &v1.Project{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(projectsResource, project), &v1.Project{}) + Invokes(testing.NewRootCreateActionWithOptions(projectsResource, project, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Project), err } // Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. func (c *FakeProjects) Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) { + emptyResult := &v1.Project{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(projectsResource, project), &v1.Project{}) + Invokes(testing.NewRootUpdateActionWithOptions(projectsResource, project, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Project), 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 *FakeProjects) UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (*v1.Project, error) { +func (c *FakeProjects) UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) { + emptyResult := &v1.Project{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(projectsResource, "status", project), &v1.Project{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(projectsResource, "status", project, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Project), err } @@ -99,7 +104,7 @@ func (c *FakeProjects) Delete(ctx context.Context, name string, opts metav1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeProjects) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(projectsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(projectsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ProjectList{}) return err @@ -107,10 +112,11 @@ func (c *FakeProjects) DeleteCollection(ctx context.Context, opts metav1.DeleteO // Patch applies the patch and returns the patched project. func (c *FakeProjects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Project, err error) { + emptyResult := &v1.Project{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(projectsResource, name, pt, data, subresources...), &v1.Project{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(projectsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Project), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_runner.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_runner.go index 5e2d0f7..3e1fe5e 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_runner.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_runner.go @@ -24,20 +24,22 @@ var runnersKind = v1.SchemeGroupVersion.WithKind("Runner") // Get takes name of the runner, and returns the corresponding runner object, and an error if there is any. func (c *FakeRunners) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Runner, err error) { + emptyResult := &v1.Runner{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(runnersResource, name), &v1.Runner{}) + Invokes(testing.NewRootGetActionWithOptions(runnersResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Runner), err } // List takes label and field selectors, and returns the list of Runners that match those selectors. func (c *FakeRunners) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RunnerList, err error) { + emptyResult := &v1.RunnerList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(runnersResource, runnersKind, opts), &v1.RunnerList{}) + Invokes(testing.NewRootListActionWithOptions(runnersResource, runnersKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeRunners) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested runners. func (c *FakeRunners) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(runnersResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(runnersResource, opts)) } // Create takes the representation of a runner and creates it. Returns the server's representation of the runner, and an error, if there is any. func (c *FakeRunners) Create(ctx context.Context, runner *v1.Runner, opts metav1.CreateOptions) (result *v1.Runner, err error) { + emptyResult := &v1.Runner{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(runnersResource, runner), &v1.Runner{}) + Invokes(testing.NewRootCreateActionWithOptions(runnersResource, runner, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Runner), err } // Update takes the representation of a runner and updates it. Returns the server's representation of the runner, and an error, if there is any. func (c *FakeRunners) Update(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (result *v1.Runner, err error) { + emptyResult := &v1.Runner{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(runnersResource, runner), &v1.Runner{}) + Invokes(testing.NewRootUpdateActionWithOptions(runnersResource, runner, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Runner), 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 *FakeRunners) UpdateStatus(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (*v1.Runner, error) { +func (c *FakeRunners) UpdateStatus(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (result *v1.Runner, err error) { + emptyResult := &v1.Runner{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(runnersResource, "status", runner), &v1.Runner{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(runnersResource, "status", runner, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Runner), err } @@ -99,7 +104,7 @@ func (c *FakeRunners) Delete(ctx context.Context, name string, opts metav1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeRunners) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(runnersResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(runnersResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RunnerList{}) return err @@ -107,10 +112,11 @@ func (c *FakeRunners) DeleteCollection(ctx context.Context, opts metav1.DeleteOp // Patch applies the patch and returns the patched runner. func (c *FakeRunners) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Runner, err error) { + emptyResult := &v1.Runner{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runnersResource, name, pt, data, subresources...), &v1.Runner{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(runnersResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Runner), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_sharedsecret.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_sharedsecret.go index 1709f39..33211d6 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_sharedsecret.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_sharedsecret.go @@ -25,22 +25,24 @@ var sharedsecretsKind = v1.SchemeGroupVersion.WithKind("SharedSecret") // Get takes name of the sharedSecret, and returns the corresponding sharedSecret object, and an error if there is any. func (c *FakeSharedSecrets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SharedSecret, err error) { + emptyResult := &v1.SharedSecret{} obj, err := c.Fake. - Invokes(testing.NewGetAction(sharedsecretsResource, c.ns, name), &v1.SharedSecret{}) + Invokes(testing.NewGetActionWithOptions(sharedsecretsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SharedSecret), err } // List takes label and field selectors, and returns the list of SharedSecrets that match those selectors. func (c *FakeSharedSecrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SharedSecretList, err error) { + emptyResult := &v1.SharedSecretList{} obj, err := c.Fake. - Invokes(testing.NewListAction(sharedsecretsResource, sharedsecretsKind, c.ns, opts), &v1.SharedSecretList{}) + Invokes(testing.NewListActionWithOptions(sharedsecretsResource, sharedsecretsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,40 +61,43 @@ func (c *FakeSharedSecrets) List(ctx context.Context, opts metav1.ListOptions) ( // Watch returns a watch.Interface that watches the requested sharedSecrets. func (c *FakeSharedSecrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(sharedsecretsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(sharedsecretsResource, c.ns, opts)) } // Create takes the representation of a sharedSecret and creates it. Returns the server's representation of the sharedSecret, and an error, if there is any. func (c *FakeSharedSecrets) Create(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.CreateOptions) (result *v1.SharedSecret, err error) { + emptyResult := &v1.SharedSecret{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(sharedsecretsResource, c.ns, sharedSecret), &v1.SharedSecret{}) + Invokes(testing.NewCreateActionWithOptions(sharedsecretsResource, c.ns, sharedSecret, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SharedSecret), err } // Update takes the representation of a sharedSecret and updates it. Returns the server's representation of the sharedSecret, and an error, if there is any. func (c *FakeSharedSecrets) Update(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (result *v1.SharedSecret, err error) { + emptyResult := &v1.SharedSecret{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(sharedsecretsResource, c.ns, sharedSecret), &v1.SharedSecret{}) + Invokes(testing.NewUpdateActionWithOptions(sharedsecretsResource, c.ns, sharedSecret, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SharedSecret), 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 *FakeSharedSecrets) UpdateStatus(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (*v1.SharedSecret, error) { +func (c *FakeSharedSecrets) UpdateStatus(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (result *v1.SharedSecret, err error) { + emptyResult := &v1.SharedSecret{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(sharedsecretsResource, "status", c.ns, sharedSecret), &v1.SharedSecret{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(sharedsecretsResource, "status", c.ns, sharedSecret, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SharedSecret), err } @@ -107,7 +112,7 @@ func (c *FakeSharedSecrets) Delete(ctx context.Context, name string, opts metav1 // DeleteCollection deletes a collection of objects. func (c *FakeSharedSecrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(sharedsecretsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(sharedsecretsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.SharedSecretList{}) return err @@ -115,11 +120,12 @@ func (c *FakeSharedSecrets) DeleteCollection(ctx context.Context, opts metav1.De // Patch applies the patch and returns the patched sharedSecret. func (c *FakeSharedSecrets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SharedSecret, err error) { + emptyResult := &v1.SharedSecret{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(sharedsecretsResource, c.ns, name, pt, data, subresources...), &v1.SharedSecret{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(sharedsecretsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SharedSecret), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_spaceinstance.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_spaceinstance.go index 4ccf512..8cca32f 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_spaceinstance.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_spaceinstance.go @@ -25,22 +25,24 @@ var spaceinstancesKind = v1.SchemeGroupVersion.WithKind("SpaceInstance") // Get takes name of the spaceInstance, and returns the corresponding spaceInstance object, and an error if there is any. func (c *FakeSpaceInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SpaceInstance, err error) { + emptyResult := &v1.SpaceInstance{} obj, err := c.Fake. - Invokes(testing.NewGetAction(spaceinstancesResource, c.ns, name), &v1.SpaceInstance{}) + Invokes(testing.NewGetActionWithOptions(spaceinstancesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceInstance), err } // List takes label and field selectors, and returns the list of SpaceInstances that match those selectors. func (c *FakeSpaceInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SpaceInstanceList, err error) { + emptyResult := &v1.SpaceInstanceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(spaceinstancesResource, spaceinstancesKind, c.ns, opts), &v1.SpaceInstanceList{}) + Invokes(testing.NewListActionWithOptions(spaceinstancesResource, spaceinstancesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,40 +61,43 @@ func (c *FakeSpaceInstances) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested spaceInstances. func (c *FakeSpaceInstances) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(spaceinstancesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(spaceinstancesResource, c.ns, opts)) } // Create takes the representation of a spaceInstance and creates it. Returns the server's representation of the spaceInstance, and an error, if there is any. func (c *FakeSpaceInstances) Create(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.CreateOptions) (result *v1.SpaceInstance, err error) { + emptyResult := &v1.SpaceInstance{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(spaceinstancesResource, c.ns, spaceInstance), &v1.SpaceInstance{}) + Invokes(testing.NewCreateActionWithOptions(spaceinstancesResource, c.ns, spaceInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceInstance), err } // Update takes the representation of a spaceInstance and updates it. Returns the server's representation of the spaceInstance, and an error, if there is any. func (c *FakeSpaceInstances) Update(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.UpdateOptions) (result *v1.SpaceInstance, err error) { + emptyResult := &v1.SpaceInstance{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(spaceinstancesResource, c.ns, spaceInstance), &v1.SpaceInstance{}) + Invokes(testing.NewUpdateActionWithOptions(spaceinstancesResource, c.ns, spaceInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceInstance), 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 *FakeSpaceInstances) UpdateStatus(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.UpdateOptions) (*v1.SpaceInstance, error) { +func (c *FakeSpaceInstances) UpdateStatus(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.UpdateOptions) (result *v1.SpaceInstance, err error) { + emptyResult := &v1.SpaceInstance{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(spaceinstancesResource, "status", c.ns, spaceInstance), &v1.SpaceInstance{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(spaceinstancesResource, "status", c.ns, spaceInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceInstance), err } @@ -107,7 +112,7 @@ func (c *FakeSpaceInstances) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeSpaceInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(spaceinstancesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(spaceinstancesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.SpaceInstanceList{}) return err @@ -115,11 +120,12 @@ func (c *FakeSpaceInstances) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched spaceInstance. func (c *FakeSpaceInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SpaceInstance, err error) { + emptyResult := &v1.SpaceInstance{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(spaceinstancesResource, c.ns, name, pt, data, subresources...), &v1.SpaceInstance{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(spaceinstancesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceInstance), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_spacetemplate.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_spacetemplate.go index 04927de..fc6e7b2 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_spacetemplate.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_spacetemplate.go @@ -24,20 +24,22 @@ var spacetemplatesKind = v1.SchemeGroupVersion.WithKind("SpaceTemplate") // Get takes name of the spaceTemplate, and returns the corresponding spaceTemplate object, and an error if there is any. func (c *FakeSpaceTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SpaceTemplate, err error) { + emptyResult := &v1.SpaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(spacetemplatesResource, name), &v1.SpaceTemplate{}) + Invokes(testing.NewRootGetActionWithOptions(spacetemplatesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceTemplate), err } // List takes label and field selectors, and returns the list of SpaceTemplates that match those selectors. func (c *FakeSpaceTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SpaceTemplateList, err error) { + emptyResult := &v1.SpaceTemplateList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(spacetemplatesResource, spacetemplatesKind, opts), &v1.SpaceTemplateList{}) + Invokes(testing.NewRootListActionWithOptions(spacetemplatesResource, spacetemplatesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeSpaceTemplates) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested spaceTemplates. func (c *FakeSpaceTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(spacetemplatesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(spacetemplatesResource, opts)) } // Create takes the representation of a spaceTemplate and creates it. Returns the server's representation of the spaceTemplate, and an error, if there is any. func (c *FakeSpaceTemplates) Create(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.CreateOptions) (result *v1.SpaceTemplate, err error) { + emptyResult := &v1.SpaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(spacetemplatesResource, spaceTemplate), &v1.SpaceTemplate{}) + Invokes(testing.NewRootCreateActionWithOptions(spacetemplatesResource, spaceTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceTemplate), err } // Update takes the representation of a spaceTemplate and updates it. Returns the server's representation of the spaceTemplate, and an error, if there is any. func (c *FakeSpaceTemplates) Update(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (result *v1.SpaceTemplate, err error) { + emptyResult := &v1.SpaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(spacetemplatesResource, spaceTemplate), &v1.SpaceTemplate{}) + Invokes(testing.NewRootUpdateActionWithOptions(spacetemplatesResource, spaceTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceTemplate), 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 *FakeSpaceTemplates) UpdateStatus(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (*v1.SpaceTemplate, error) { +func (c *FakeSpaceTemplates) UpdateStatus(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (result *v1.SpaceTemplate, err error) { + emptyResult := &v1.SpaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(spacetemplatesResource, "status", spaceTemplate), &v1.SpaceTemplate{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(spacetemplatesResource, "status", spaceTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceTemplate), err } @@ -99,7 +104,7 @@ func (c *FakeSpaceTemplates) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeSpaceTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(spacetemplatesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(spacetemplatesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.SpaceTemplateList{}) return err @@ -107,10 +112,11 @@ func (c *FakeSpaceTemplates) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched spaceTemplate. func (c *FakeSpaceTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SpaceTemplate, err error) { + emptyResult := &v1.SpaceTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(spacetemplatesResource, name, pt, data, subresources...), &v1.SpaceTemplate{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(spacetemplatesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SpaceTemplate), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_task.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_task.go index 58c385f..7ece484 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_task.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_task.go @@ -24,20 +24,22 @@ var tasksKind = v1.SchemeGroupVersion.WithKind("Task") // Get takes name of the task, and returns the corresponding task object, and an error if there is any. func (c *FakeTasks) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Task, err error) { + emptyResult := &v1.Task{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(tasksResource, name), &v1.Task{}) + Invokes(testing.NewRootGetActionWithOptions(tasksResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Task), err } // List takes label and field selectors, and returns the list of Tasks that match those selectors. func (c *FakeTasks) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TaskList, err error) { + emptyResult := &v1.TaskList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(tasksResource, tasksKind, opts), &v1.TaskList{}) + Invokes(testing.NewRootListActionWithOptions(tasksResource, tasksKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeTasks) List(ctx context.Context, opts metav1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested tasks. func (c *FakeTasks) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(tasksResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(tasksResource, opts)) } // Create takes the representation of a task and creates it. Returns the server's representation of the task, and an error, if there is any. func (c *FakeTasks) Create(ctx context.Context, task *v1.Task, opts metav1.CreateOptions) (result *v1.Task, err error) { + emptyResult := &v1.Task{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(tasksResource, task), &v1.Task{}) + Invokes(testing.NewRootCreateActionWithOptions(tasksResource, task, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Task), err } // Update takes the representation of a task and updates it. Returns the server's representation of the task, and an error, if there is any. func (c *FakeTasks) Update(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (result *v1.Task, err error) { + emptyResult := &v1.Task{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(tasksResource, task), &v1.Task{}) + Invokes(testing.NewRootUpdateActionWithOptions(tasksResource, task, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Task), 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 *FakeTasks) UpdateStatus(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (*v1.Task, error) { +func (c *FakeTasks) UpdateStatus(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (result *v1.Task, err error) { + emptyResult := &v1.Task{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(tasksResource, "status", task), &v1.Task{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(tasksResource, "status", task, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Task), err } @@ -99,7 +104,7 @@ func (c *FakeTasks) Delete(ctx context.Context, name string, opts metav1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeTasks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(tasksResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(tasksResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.TaskList{}) return err @@ -107,10 +112,11 @@ func (c *FakeTasks) DeleteCollection(ctx context.Context, opts metav1.DeleteOpti // Patch applies the patch and returns the patched task. func (c *FakeTasks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Task, err error) { + emptyResult := &v1.Task{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(tasksResource, name, pt, data, subresources...), &v1.Task{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(tasksResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Task), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_team.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_team.go index ae3e53f..9f100a8 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_team.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_team.go @@ -24,20 +24,22 @@ var teamsKind = v1.SchemeGroupVersion.WithKind("Team") // Get takes name of the team, and returns the corresponding team object, and an error if there is any. func (c *FakeTeams) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Team, err error) { + emptyResult := &v1.Team{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(teamsResource, name), &v1.Team{}) + Invokes(testing.NewRootGetActionWithOptions(teamsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Team), err } // List takes label and field selectors, and returns the list of Teams that match those selectors. func (c *FakeTeams) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TeamList, err error) { + emptyResult := &v1.TeamList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(teamsResource, teamsKind, opts), &v1.TeamList{}) + Invokes(testing.NewRootListActionWithOptions(teamsResource, teamsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeTeams) List(ctx context.Context, opts metav1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested teams. func (c *FakeTeams) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(teamsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(teamsResource, opts)) } // Create takes the representation of a team and creates it. Returns the server's representation of the team, and an error, if there is any. func (c *FakeTeams) Create(ctx context.Context, team *v1.Team, opts metav1.CreateOptions) (result *v1.Team, err error) { + emptyResult := &v1.Team{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(teamsResource, team), &v1.Team{}) + Invokes(testing.NewRootCreateActionWithOptions(teamsResource, team, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Team), err } // Update takes the representation of a team and updates it. Returns the server's representation of the team, and an error, if there is any. func (c *FakeTeams) Update(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (result *v1.Team, err error) { + emptyResult := &v1.Team{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(teamsResource, team), &v1.Team{}) + Invokes(testing.NewRootUpdateActionWithOptions(teamsResource, team, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Team), 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 *FakeTeams) UpdateStatus(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (*v1.Team, error) { +func (c *FakeTeams) UpdateStatus(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (result *v1.Team, err error) { + emptyResult := &v1.Team{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(teamsResource, "status", team), &v1.Team{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(teamsResource, "status", team, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Team), err } @@ -99,7 +104,7 @@ func (c *FakeTeams) Delete(ctx context.Context, name string, opts metav1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeTeams) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(teamsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(teamsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.TeamList{}) return err @@ -107,10 +112,11 @@ func (c *FakeTeams) DeleteCollection(ctx context.Context, opts metav1.DeleteOpti // Patch applies the patch and returns the patched team. func (c *FakeTeams) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Team, err error) { + emptyResult := &v1.Team{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(teamsResource, name, pt, data, subresources...), &v1.Team{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(teamsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Team), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_user.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_user.go index cb74660..d783f35 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_user.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_user.go @@ -24,20 +24,22 @@ var usersKind = v1.SchemeGroupVersion.WithKind("User") // Get takes name of the user, and returns the corresponding user object, and an error if there is any. func (c *FakeUsers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.User, err error) { + emptyResult := &v1.User{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(usersResource, name), &v1.User{}) + Invokes(testing.NewRootGetActionWithOptions(usersResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.User), err } // List takes label and field selectors, and returns the list of Users that match those selectors. func (c *FakeUsers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.UserList, err error) { + emptyResult := &v1.UserList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(usersResource, usersKind, opts), &v1.UserList{}) + Invokes(testing.NewRootListActionWithOptions(usersResource, usersKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeUsers) List(ctx context.Context, opts metav1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested users. func (c *FakeUsers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(usersResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(usersResource, opts)) } // Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. func (c *FakeUsers) Create(ctx context.Context, user *v1.User, opts metav1.CreateOptions) (result *v1.User, err error) { + emptyResult := &v1.User{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(usersResource, user), &v1.User{}) + Invokes(testing.NewRootCreateActionWithOptions(usersResource, user, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.User), err } // Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. func (c *FakeUsers) Update(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (result *v1.User, err error) { + emptyResult := &v1.User{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(usersResource, user), &v1.User{}) + Invokes(testing.NewRootUpdateActionWithOptions(usersResource, user, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.User), 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 *FakeUsers) UpdateStatus(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (*v1.User, error) { +func (c *FakeUsers) UpdateStatus(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (result *v1.User, err error) { + emptyResult := &v1.User{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(usersResource, "status", user), &v1.User{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(usersResource, "status", user, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.User), err } @@ -99,7 +104,7 @@ func (c *FakeUsers) Delete(ctx context.Context, name string, opts metav1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeUsers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(usersResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(usersResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.UserList{}) return err @@ -107,10 +112,11 @@ func (c *FakeUsers) DeleteCollection(ctx context.Context, opts metav1.DeleteOpti // Patch applies the patch and returns the patched user. func (c *FakeUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.User, err error) { + emptyResult := &v1.User{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(usersResource, name, pt, data, subresources...), &v1.User{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(usersResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.User), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_virtualclusterinstance.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_virtualclusterinstance.go index 2ba9e50..65e5366 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_virtualclusterinstance.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_virtualclusterinstance.go @@ -25,22 +25,24 @@ var virtualclusterinstancesKind = v1.SchemeGroupVersion.WithKind("VirtualCluster // Get takes name of the virtualClusterInstance, and returns the corresponding virtualClusterInstance object, and an error if there is any. func (c *FakeVirtualClusterInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualClusterInstance, err error) { + emptyResult := &v1.VirtualClusterInstance{} obj, err := c.Fake. - Invokes(testing.NewGetAction(virtualclusterinstancesResource, c.ns, name), &v1.VirtualClusterInstance{}) + Invokes(testing.NewGetActionWithOptions(virtualclusterinstancesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterInstance), err } // List takes label and field selectors, and returns the list of VirtualClusterInstances that match those selectors. func (c *FakeVirtualClusterInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualClusterInstanceList, err error) { + emptyResult := &v1.VirtualClusterInstanceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(virtualclusterinstancesResource, virtualclusterinstancesKind, c.ns, opts), &v1.VirtualClusterInstanceList{}) + Invokes(testing.NewListActionWithOptions(virtualclusterinstancesResource, virtualclusterinstancesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,28 +61,30 @@ func (c *FakeVirtualClusterInstances) List(ctx context.Context, opts metav1.List // Watch returns a watch.Interface that watches the requested virtualClusterInstances. func (c *FakeVirtualClusterInstances) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(virtualclusterinstancesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(virtualclusterinstancesResource, c.ns, opts)) } // Create takes the representation of a virtualClusterInstance and creates it. Returns the server's representation of the virtualClusterInstance, and an error, if there is any. func (c *FakeVirtualClusterInstances) Create(ctx context.Context, virtualClusterInstance *v1.VirtualClusterInstance, opts metav1.CreateOptions) (result *v1.VirtualClusterInstance, err error) { + emptyResult := &v1.VirtualClusterInstance{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(virtualclusterinstancesResource, c.ns, virtualClusterInstance), &v1.VirtualClusterInstance{}) + Invokes(testing.NewCreateActionWithOptions(virtualclusterinstancesResource, c.ns, virtualClusterInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterInstance), err } // Update takes the representation of a virtualClusterInstance and updates it. Returns the server's representation of the virtualClusterInstance, and an error, if there is any. func (c *FakeVirtualClusterInstances) Update(ctx context.Context, virtualClusterInstance *v1.VirtualClusterInstance, opts metav1.UpdateOptions) (result *v1.VirtualClusterInstance, err error) { + emptyResult := &v1.VirtualClusterInstance{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(virtualclusterinstancesResource, c.ns, virtualClusterInstance), &v1.VirtualClusterInstance{}) + Invokes(testing.NewUpdateActionWithOptions(virtualclusterinstancesResource, c.ns, virtualClusterInstance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterInstance), err } @@ -95,7 +99,7 @@ func (c *FakeVirtualClusterInstances) Delete(ctx context.Context, name string, o // DeleteCollection deletes a collection of objects. func (c *FakeVirtualClusterInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(virtualclusterinstancesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(virtualclusterinstancesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.VirtualClusterInstanceList{}) return err @@ -103,11 +107,12 @@ func (c *FakeVirtualClusterInstances) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched virtualClusterInstance. func (c *FakeVirtualClusterInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualClusterInstance, err error) { + emptyResult := &v1.VirtualClusterInstance{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualclusterinstancesResource, c.ns, name, pt, data, subresources...), &v1.VirtualClusterInstance{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(virtualclusterinstancesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterInstance), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_virtualclustertemplate.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_virtualclustertemplate.go index 157e2fc..6a21d11 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_virtualclustertemplate.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_virtualclustertemplate.go @@ -24,20 +24,22 @@ var virtualclustertemplatesKind = v1.SchemeGroupVersion.WithKind("VirtualCluster // Get takes name of the virtualClusterTemplate, and returns the corresponding virtualClusterTemplate object, and an error if there is any. func (c *FakeVirtualClusterTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualClusterTemplate, err error) { + emptyResult := &v1.VirtualClusterTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(virtualclustertemplatesResource, name), &v1.VirtualClusterTemplate{}) + Invokes(testing.NewRootGetActionWithOptions(virtualclustertemplatesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterTemplate), err } // List takes label and field selectors, and returns the list of VirtualClusterTemplates that match those selectors. func (c *FakeVirtualClusterTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualClusterTemplateList, err error) { + emptyResult := &v1.VirtualClusterTemplateList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(virtualclustertemplatesResource, virtualclustertemplatesKind, opts), &v1.VirtualClusterTemplateList{}) + Invokes(testing.NewRootListActionWithOptions(virtualclustertemplatesResource, virtualclustertemplatesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -56,36 +58,39 @@ func (c *FakeVirtualClusterTemplates) List(ctx context.Context, opts metav1.List // Watch returns a watch.Interface that watches the requested virtualClusterTemplates. func (c *FakeVirtualClusterTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(virtualclustertemplatesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(virtualclustertemplatesResource, opts)) } // Create takes the representation of a virtualClusterTemplate and creates it. Returns the server's representation of the virtualClusterTemplate, and an error, if there is any. func (c *FakeVirtualClusterTemplates) Create(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.CreateOptions) (result *v1.VirtualClusterTemplate, err error) { + emptyResult := &v1.VirtualClusterTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(virtualclustertemplatesResource, virtualClusterTemplate), &v1.VirtualClusterTemplate{}) + Invokes(testing.NewRootCreateActionWithOptions(virtualclustertemplatesResource, virtualClusterTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterTemplate), err } // Update takes the representation of a virtualClusterTemplate and updates it. Returns the server's representation of the virtualClusterTemplate, and an error, if there is any. func (c *FakeVirtualClusterTemplates) Update(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (result *v1.VirtualClusterTemplate, err error) { + emptyResult := &v1.VirtualClusterTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(virtualclustertemplatesResource, virtualClusterTemplate), &v1.VirtualClusterTemplate{}) + Invokes(testing.NewRootUpdateActionWithOptions(virtualclustertemplatesResource, virtualClusterTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterTemplate), 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 *FakeVirtualClusterTemplates) UpdateStatus(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (*v1.VirtualClusterTemplate, error) { +func (c *FakeVirtualClusterTemplates) UpdateStatus(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (result *v1.VirtualClusterTemplate, err error) { + emptyResult := &v1.VirtualClusterTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(virtualclustertemplatesResource, "status", virtualClusterTemplate), &v1.VirtualClusterTemplate{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(virtualclustertemplatesResource, "status", virtualClusterTemplate, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterTemplate), err } @@ -99,7 +104,7 @@ func (c *FakeVirtualClusterTemplates) Delete(ctx context.Context, name string, o // DeleteCollection deletes a collection of objects. func (c *FakeVirtualClusterTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(virtualclustertemplatesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(virtualclustertemplatesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.VirtualClusterTemplateList{}) return err @@ -107,10 +112,11 @@ func (c *FakeVirtualClusterTemplates) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched virtualClusterTemplate. func (c *FakeVirtualClusterTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualClusterTemplate, err error) { + emptyResult := &v1.VirtualClusterTemplate{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(virtualclustertemplatesResource, name, pt, data, subresources...), &v1.VirtualClusterTemplate{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(virtualclustertemplatesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VirtualClusterTemplate), err } diff --git a/pkg/clientset/versioned/typed/storage/v1/networkpeer.go b/pkg/clientset/versioned/typed/storage/v1/networkpeer.go index 4be6486..8554a41 100644 --- a/pkg/clientset/versioned/typed/storage/v1/networkpeer.go +++ b/pkg/clientset/versioned/typed/storage/v1/networkpeer.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // NetworkPeersGetter has a method to return a NetworkPeerInterface. @@ -24,6 +23,7 @@ type NetworkPeersGetter interface { type NetworkPeerInterface interface { Create(ctx context.Context, networkPeer *v1.NetworkPeer, opts metav1.CreateOptions) (*v1.NetworkPeer, error) Update(ctx context.Context, networkPeer *v1.NetworkPeer, opts metav1.UpdateOptions) (*v1.NetworkPeer, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, networkPeer *v1.NetworkPeer, opts metav1.UpdateOptions) (*v1.NetworkPeer, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type NetworkPeerInterface interface { // networkPeers implements NetworkPeerInterface type networkPeers struct { - client rest.Interface + *gentype.ClientWithList[*v1.NetworkPeer, *v1.NetworkPeerList] } // newNetworkPeers returns a NetworkPeers func newNetworkPeers(c *StorageV1Client) *networkPeers { return &networkPeers{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.NetworkPeer, *v1.NetworkPeerList]( + "networkpeers", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.NetworkPeer { return &v1.NetworkPeer{} }, + func() *v1.NetworkPeerList { return &v1.NetworkPeerList{} }), } } - -// Get takes name of the networkPeer, and returns the corresponding networkPeer object, and an error if there is any. -func (c *networkPeers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NetworkPeer, err error) { - result = &v1.NetworkPeer{} - err = c.client.Get(). - Resource("networkpeers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of NetworkPeers that match those selectors. -func (c *networkPeers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPeerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.NetworkPeerList{} - err = c.client.Get(). - Resource("networkpeers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested networkPeers. -func (c *networkPeers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("networkpeers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a networkPeer and creates it. Returns the server's representation of the networkPeer, and an error, if there is any. -func (c *networkPeers) Create(ctx context.Context, networkPeer *v1.NetworkPeer, opts metav1.CreateOptions) (result *v1.NetworkPeer, err error) { - result = &v1.NetworkPeer{} - err = c.client.Post(). - Resource("networkpeers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkPeer). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a networkPeer and updates it. Returns the server's representation of the networkPeer, and an error, if there is any. -func (c *networkPeers) Update(ctx context.Context, networkPeer *v1.NetworkPeer, opts metav1.UpdateOptions) (result *v1.NetworkPeer, err error) { - result = &v1.NetworkPeer{} - err = c.client.Put(). - Resource("networkpeers"). - Name(networkPeer.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkPeer). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *networkPeers) UpdateStatus(ctx context.Context, networkPeer *v1.NetworkPeer, opts metav1.UpdateOptions) (result *v1.NetworkPeer, err error) { - result = &v1.NetworkPeer{} - err = c.client.Put(). - Resource("networkpeers"). - Name(networkPeer.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkPeer). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the networkPeer and deletes it. Returns an error if one occurs. -func (c *networkPeers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("networkpeers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *networkPeers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("networkpeers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched networkPeer. -func (c *networkPeers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPeer, err error) { - result = &v1.NetworkPeer{} - err = c.client.Patch(pt). - Resource("networkpeers"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/project.go b/pkg/clientset/versioned/typed/storage/v1/project.go index 21c649f..5280f62 100644 --- a/pkg/clientset/versioned/typed/storage/v1/project.go +++ b/pkg/clientset/versioned/typed/storage/v1/project.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ProjectsGetter has a method to return a ProjectInterface. @@ -24,6 +23,7 @@ type ProjectsGetter interface { type ProjectInterface interface { Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (*v1.Project, error) Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (*v1.Project, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (*v1.Project, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type ProjectInterface interface { // projects implements ProjectInterface type projects struct { - client rest.Interface + *gentype.ClientWithList[*v1.Project, *v1.ProjectList] } // newProjects returns a Projects func newProjects(c *StorageV1Client) *projects { return &projects{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Project, *v1.ProjectList]( + "projects", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Project { return &v1.Project{} }, + func() *v1.ProjectList { return &v1.ProjectList{} }), } } - -// Get takes name of the project, and returns the corresponding project object, and an error if there is any. -func (c *projects) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Project, err error) { - result = &v1.Project{} - err = c.client.Get(). - Resource("projects"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Projects that match those selectors. -func (c *projects) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProjectList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ProjectList{} - err = c.client.Get(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested projects. -func (c *projects) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. -func (c *projects) Create(ctx context.Context, project *v1.Project, opts metav1.CreateOptions) (result *v1.Project, err error) { - result = &v1.Project{} - err = c.client.Post(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(project). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. -func (c *projects) Update(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) { - result = &v1.Project{} - err = c.client.Put(). - Resource("projects"). - Name(project.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(project). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *projects) UpdateStatus(ctx context.Context, project *v1.Project, opts metav1.UpdateOptions) (result *v1.Project, err error) { - result = &v1.Project{} - err = c.client.Put(). - Resource("projects"). - Name(project.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(project). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the project and deletes it. Returns an error if one occurs. -func (c *projects) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("projects"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *projects) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("projects"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched project. -func (c *projects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Project, err error) { - result = &v1.Project{} - err = c.client.Patch(pt). - Resource("projects"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/runner.go b/pkg/clientset/versioned/typed/storage/v1/runner.go index 12cf861..7b8dd48 100644 --- a/pkg/clientset/versioned/typed/storage/v1/runner.go +++ b/pkg/clientset/versioned/typed/storage/v1/runner.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // RunnersGetter has a method to return a RunnerInterface. @@ -24,6 +23,7 @@ type RunnersGetter interface { type RunnerInterface interface { Create(ctx context.Context, runner *v1.Runner, opts metav1.CreateOptions) (*v1.Runner, error) Update(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (*v1.Runner, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (*v1.Runner, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type RunnerInterface interface { // runners implements RunnerInterface type runners struct { - client rest.Interface + *gentype.ClientWithList[*v1.Runner, *v1.RunnerList] } // newRunners returns a Runners func newRunners(c *StorageV1Client) *runners { return &runners{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Runner, *v1.RunnerList]( + "runners", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Runner { return &v1.Runner{} }, + func() *v1.RunnerList { return &v1.RunnerList{} }), } } - -// Get takes name of the runner, and returns the corresponding runner object, and an error if there is any. -func (c *runners) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Runner, err error) { - result = &v1.Runner{} - err = c.client.Get(). - Resource("runners"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Runners that match those selectors. -func (c *runners) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RunnerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RunnerList{} - err = c.client.Get(). - Resource("runners"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested runners. -func (c *runners) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("runners"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a runner and creates it. Returns the server's representation of the runner, and an error, if there is any. -func (c *runners) Create(ctx context.Context, runner *v1.Runner, opts metav1.CreateOptions) (result *v1.Runner, err error) { - result = &v1.Runner{} - err = c.client.Post(). - Resource("runners"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(runner). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a runner and updates it. Returns the server's representation of the runner, and an error, if there is any. -func (c *runners) Update(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (result *v1.Runner, err error) { - result = &v1.Runner{} - err = c.client.Put(). - Resource("runners"). - Name(runner.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(runner). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *runners) UpdateStatus(ctx context.Context, runner *v1.Runner, opts metav1.UpdateOptions) (result *v1.Runner, err error) { - result = &v1.Runner{} - err = c.client.Put(). - Resource("runners"). - Name(runner.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(runner). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the runner and deletes it. Returns an error if one occurs. -func (c *runners) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("runners"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *runners) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("runners"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched runner. -func (c *runners) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Runner, err error) { - result = &v1.Runner{} - err = c.client.Patch(pt). - Resource("runners"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/sharedsecret.go b/pkg/clientset/versioned/typed/storage/v1/sharedsecret.go index aa94367..6e4dbd3 100644 --- a/pkg/clientset/versioned/typed/storage/v1/sharedsecret.go +++ b/pkg/clientset/versioned/typed/storage/v1/sharedsecret.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // SharedSecretsGetter has a method to return a SharedSecretInterface. @@ -24,6 +23,7 @@ type SharedSecretsGetter interface { type SharedSecretInterface interface { Create(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.CreateOptions) (*v1.SharedSecret, error) Update(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (*v1.SharedSecret, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (*v1.SharedSecret, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,144 +36,18 @@ type SharedSecretInterface interface { // sharedSecrets implements SharedSecretInterface type sharedSecrets struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.SharedSecret, *v1.SharedSecretList] } // newSharedSecrets returns a SharedSecrets func newSharedSecrets(c *StorageV1Client, namespace string) *sharedSecrets { return &sharedSecrets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.SharedSecret, *v1.SharedSecretList]( + "sharedsecrets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.SharedSecret { return &v1.SharedSecret{} }, + func() *v1.SharedSecretList { return &v1.SharedSecretList{} }), } } - -// Get takes name of the sharedSecret, and returns the corresponding sharedSecret object, and an error if there is any. -func (c *sharedSecrets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SharedSecret, err error) { - result = &v1.SharedSecret{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sharedsecrets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SharedSecrets that match those selectors. -func (c *sharedSecrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SharedSecretList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SharedSecretList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sharedsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested sharedSecrets. -func (c *sharedSecrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("sharedsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a sharedSecret and creates it. Returns the server's representation of the sharedSecret, and an error, if there is any. -func (c *sharedSecrets) Create(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.CreateOptions) (result *v1.SharedSecret, err error) { - result = &v1.SharedSecret{} - err = c.client.Post(). - Namespace(c.ns). - Resource("sharedsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(sharedSecret). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a sharedSecret and updates it. Returns the server's representation of the sharedSecret, and an error, if there is any. -func (c *sharedSecrets) Update(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (result *v1.SharedSecret, err error) { - result = &v1.SharedSecret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sharedsecrets"). - Name(sharedSecret.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(sharedSecret). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *sharedSecrets) UpdateStatus(ctx context.Context, sharedSecret *v1.SharedSecret, opts metav1.UpdateOptions) (result *v1.SharedSecret, err error) { - result = &v1.SharedSecret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sharedsecrets"). - Name(sharedSecret.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(sharedSecret). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the sharedSecret and deletes it. Returns an error if one occurs. -func (c *sharedSecrets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sharedsecrets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *sharedSecrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("sharedsecrets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched sharedSecret. -func (c *sharedSecrets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SharedSecret, err error) { - result = &v1.SharedSecret{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("sharedsecrets"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/spaceinstance.go b/pkg/clientset/versioned/typed/storage/v1/spaceinstance.go index 493f1a0..5a9d994 100644 --- a/pkg/clientset/versioned/typed/storage/v1/spaceinstance.go +++ b/pkg/clientset/versioned/typed/storage/v1/spaceinstance.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // SpaceInstancesGetter has a method to return a SpaceInstanceInterface. @@ -24,6 +23,7 @@ type SpaceInstancesGetter interface { type SpaceInstanceInterface interface { Create(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.CreateOptions) (*v1.SpaceInstance, error) Update(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.UpdateOptions) (*v1.SpaceInstance, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.UpdateOptions) (*v1.SpaceInstance, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,144 +36,18 @@ type SpaceInstanceInterface interface { // spaceInstances implements SpaceInstanceInterface type spaceInstances struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.SpaceInstance, *v1.SpaceInstanceList] } // newSpaceInstances returns a SpaceInstances func newSpaceInstances(c *StorageV1Client, namespace string) *spaceInstances { return &spaceInstances{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.SpaceInstance, *v1.SpaceInstanceList]( + "spaceinstances", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.SpaceInstance { return &v1.SpaceInstance{} }, + func() *v1.SpaceInstanceList { return &v1.SpaceInstanceList{} }), } } - -// Get takes name of the spaceInstance, and returns the corresponding spaceInstance object, and an error if there is any. -func (c *spaceInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SpaceInstance, err error) { - result = &v1.SpaceInstance{} - err = c.client.Get(). - Namespace(c.ns). - Resource("spaceinstances"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SpaceInstances that match those selectors. -func (c *spaceInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SpaceInstanceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SpaceInstanceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("spaceinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested spaceInstances. -func (c *spaceInstances) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("spaceinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a spaceInstance and creates it. Returns the server's representation of the spaceInstance, and an error, if there is any. -func (c *spaceInstances) Create(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.CreateOptions) (result *v1.SpaceInstance, err error) { - result = &v1.SpaceInstance{} - err = c.client.Post(). - Namespace(c.ns). - Resource("spaceinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(spaceInstance). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a spaceInstance and updates it. Returns the server's representation of the spaceInstance, and an error, if there is any. -func (c *spaceInstances) Update(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.UpdateOptions) (result *v1.SpaceInstance, err error) { - result = &v1.SpaceInstance{} - err = c.client.Put(). - Namespace(c.ns). - Resource("spaceinstances"). - Name(spaceInstance.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(spaceInstance). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *spaceInstances) UpdateStatus(ctx context.Context, spaceInstance *v1.SpaceInstance, opts metav1.UpdateOptions) (result *v1.SpaceInstance, err error) { - result = &v1.SpaceInstance{} - err = c.client.Put(). - Namespace(c.ns). - Resource("spaceinstances"). - Name(spaceInstance.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(spaceInstance). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the spaceInstance and deletes it. Returns an error if one occurs. -func (c *spaceInstances) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("spaceinstances"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *spaceInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("spaceinstances"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched spaceInstance. -func (c *spaceInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SpaceInstance, err error) { - result = &v1.SpaceInstance{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("spaceinstances"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/spacetemplate.go b/pkg/clientset/versioned/typed/storage/v1/spacetemplate.go index dae30ab..fca555b 100644 --- a/pkg/clientset/versioned/typed/storage/v1/spacetemplate.go +++ b/pkg/clientset/versioned/typed/storage/v1/spacetemplate.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // SpaceTemplatesGetter has a method to return a SpaceTemplateInterface. @@ -24,6 +23,7 @@ type SpaceTemplatesGetter interface { type SpaceTemplateInterface interface { Create(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.CreateOptions) (*v1.SpaceTemplate, error) Update(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (*v1.SpaceTemplate, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (*v1.SpaceTemplate, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type SpaceTemplateInterface interface { // spaceTemplates implements SpaceTemplateInterface type spaceTemplates struct { - client rest.Interface + *gentype.ClientWithList[*v1.SpaceTemplate, *v1.SpaceTemplateList] } // newSpaceTemplates returns a SpaceTemplates func newSpaceTemplates(c *StorageV1Client) *spaceTemplates { return &spaceTemplates{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.SpaceTemplate, *v1.SpaceTemplateList]( + "spacetemplates", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.SpaceTemplate { return &v1.SpaceTemplate{} }, + func() *v1.SpaceTemplateList { return &v1.SpaceTemplateList{} }), } } - -// Get takes name of the spaceTemplate, and returns the corresponding spaceTemplate object, and an error if there is any. -func (c *spaceTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SpaceTemplate, err error) { - result = &v1.SpaceTemplate{} - err = c.client.Get(). - Resource("spacetemplates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SpaceTemplates that match those selectors. -func (c *spaceTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SpaceTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SpaceTemplateList{} - err = c.client.Get(). - Resource("spacetemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested spaceTemplates. -func (c *spaceTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("spacetemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a spaceTemplate and creates it. Returns the server's representation of the spaceTemplate, and an error, if there is any. -func (c *spaceTemplates) Create(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.CreateOptions) (result *v1.SpaceTemplate, err error) { - result = &v1.SpaceTemplate{} - err = c.client.Post(). - Resource("spacetemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(spaceTemplate). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a spaceTemplate and updates it. Returns the server's representation of the spaceTemplate, and an error, if there is any. -func (c *spaceTemplates) Update(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (result *v1.SpaceTemplate, err error) { - result = &v1.SpaceTemplate{} - err = c.client.Put(). - Resource("spacetemplates"). - Name(spaceTemplate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(spaceTemplate). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *spaceTemplates) UpdateStatus(ctx context.Context, spaceTemplate *v1.SpaceTemplate, opts metav1.UpdateOptions) (result *v1.SpaceTemplate, err error) { - result = &v1.SpaceTemplate{} - err = c.client.Put(). - Resource("spacetemplates"). - Name(spaceTemplate.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(spaceTemplate). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the spaceTemplate and deletes it. Returns an error if one occurs. -func (c *spaceTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("spacetemplates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *spaceTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("spacetemplates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched spaceTemplate. -func (c *spaceTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SpaceTemplate, err error) { - result = &v1.SpaceTemplate{} - err = c.client.Patch(pt). - Resource("spacetemplates"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/task.go b/pkg/clientset/versioned/typed/storage/v1/task.go index 2a2c8ee..055fb16 100644 --- a/pkg/clientset/versioned/typed/storage/v1/task.go +++ b/pkg/clientset/versioned/typed/storage/v1/task.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // TasksGetter has a method to return a TaskInterface. @@ -24,6 +23,7 @@ type TasksGetter interface { type TaskInterface interface { Create(ctx context.Context, task *v1.Task, opts metav1.CreateOptions) (*v1.Task, error) Update(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (*v1.Task, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (*v1.Task, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type TaskInterface interface { // tasks implements TaskInterface type tasks struct { - client rest.Interface + *gentype.ClientWithList[*v1.Task, *v1.TaskList] } // newTasks returns a Tasks func newTasks(c *StorageV1Client) *tasks { return &tasks{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Task, *v1.TaskList]( + "tasks", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Task { return &v1.Task{} }, + func() *v1.TaskList { return &v1.TaskList{} }), } } - -// Get takes name of the task, and returns the corresponding task object, and an error if there is any. -func (c *tasks) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Task, err error) { - result = &v1.Task{} - err = c.client.Get(). - Resource("tasks"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Tasks that match those selectors. -func (c *tasks) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TaskList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.TaskList{} - err = c.client.Get(). - Resource("tasks"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested tasks. -func (c *tasks) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("tasks"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a task and creates it. Returns the server's representation of the task, and an error, if there is any. -func (c *tasks) Create(ctx context.Context, task *v1.Task, opts metav1.CreateOptions) (result *v1.Task, err error) { - result = &v1.Task{} - err = c.client.Post(). - Resource("tasks"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(task). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a task and updates it. Returns the server's representation of the task, and an error, if there is any. -func (c *tasks) Update(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (result *v1.Task, err error) { - result = &v1.Task{} - err = c.client.Put(). - Resource("tasks"). - Name(task.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(task). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *tasks) UpdateStatus(ctx context.Context, task *v1.Task, opts metav1.UpdateOptions) (result *v1.Task, err error) { - result = &v1.Task{} - err = c.client.Put(). - Resource("tasks"). - Name(task.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(task). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the task and deletes it. Returns an error if one occurs. -func (c *tasks) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("tasks"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *tasks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("tasks"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched task. -func (c *tasks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Task, err error) { - result = &v1.Task{} - err = c.client.Patch(pt). - Resource("tasks"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/team.go b/pkg/clientset/versioned/typed/storage/v1/team.go index f01e029..81258fa 100644 --- a/pkg/clientset/versioned/typed/storage/v1/team.go +++ b/pkg/clientset/versioned/typed/storage/v1/team.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // TeamsGetter has a method to return a TeamInterface. @@ -24,6 +23,7 @@ type TeamsGetter interface { type TeamInterface interface { Create(ctx context.Context, team *v1.Team, opts metav1.CreateOptions) (*v1.Team, error) Update(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (*v1.Team, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (*v1.Team, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type TeamInterface interface { // teams implements TeamInterface type teams struct { - client rest.Interface + *gentype.ClientWithList[*v1.Team, *v1.TeamList] } // newTeams returns a Teams func newTeams(c *StorageV1Client) *teams { return &teams{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.Team, *v1.TeamList]( + "teams", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Team { return &v1.Team{} }, + func() *v1.TeamList { return &v1.TeamList{} }), } } - -// Get takes name of the team, and returns the corresponding team object, and an error if there is any. -func (c *teams) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Team, err error) { - result = &v1.Team{} - err = c.client.Get(). - Resource("teams"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Teams that match those selectors. -func (c *teams) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TeamList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.TeamList{} - err = c.client.Get(). - Resource("teams"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested teams. -func (c *teams) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("teams"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a team and creates it. Returns the server's representation of the team, and an error, if there is any. -func (c *teams) Create(ctx context.Context, team *v1.Team, opts metav1.CreateOptions) (result *v1.Team, err error) { - result = &v1.Team{} - err = c.client.Post(). - Resource("teams"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(team). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a team and updates it. Returns the server's representation of the team, and an error, if there is any. -func (c *teams) Update(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (result *v1.Team, err error) { - result = &v1.Team{} - err = c.client.Put(). - Resource("teams"). - Name(team.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(team). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *teams) UpdateStatus(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (result *v1.Team, err error) { - result = &v1.Team{} - err = c.client.Put(). - Resource("teams"). - Name(team.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(team). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the team and deletes it. Returns an error if one occurs. -func (c *teams) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("teams"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *teams) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("teams"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched team. -func (c *teams) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Team, err error) { - result = &v1.Team{} - err = c.client.Patch(pt). - Resource("teams"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/user.go b/pkg/clientset/versioned/typed/storage/v1/user.go index 9187ca8..5ce7882 100644 --- a/pkg/clientset/versioned/typed/storage/v1/user.go +++ b/pkg/clientset/versioned/typed/storage/v1/user.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // UsersGetter has a method to return a UserInterface. @@ -24,6 +23,7 @@ type UsersGetter interface { type UserInterface interface { Create(ctx context.Context, user *v1.User, opts metav1.CreateOptions) (*v1.User, error) Update(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (*v1.User, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (*v1.User, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type UserInterface interface { // users implements UserInterface type users struct { - client rest.Interface + *gentype.ClientWithList[*v1.User, *v1.UserList] } // newUsers returns a Users func newUsers(c *StorageV1Client) *users { return &users{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.User, *v1.UserList]( + "users", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.User { return &v1.User{} }, + func() *v1.UserList { return &v1.UserList{} }), } } - -// Get takes name of the user, and returns the corresponding user object, and an error if there is any. -func (c *users) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.User, err error) { - result = &v1.User{} - err = c.client.Get(). - Resource("users"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Users that match those selectors. -func (c *users) List(ctx context.Context, opts metav1.ListOptions) (result *v1.UserList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.UserList{} - err = c.client.Get(). - Resource("users"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested users. -func (c *users) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("users"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. -func (c *users) Create(ctx context.Context, user *v1.User, opts metav1.CreateOptions) (result *v1.User, err error) { - result = &v1.User{} - err = c.client.Post(). - Resource("users"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(user). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. -func (c *users) Update(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (result *v1.User, err error) { - result = &v1.User{} - err = c.client.Put(). - Resource("users"). - Name(user.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(user). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *users) UpdateStatus(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (result *v1.User, err error) { - result = &v1.User{} - err = c.client.Put(). - Resource("users"). - Name(user.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(user). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the user and deletes it. Returns an error if one occurs. -func (c *users) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("users"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *users) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("users"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched user. -func (c *users) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.User, err error) { - result = &v1.User{} - err = c.client.Patch(pt). - Resource("users"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/virtualclusterinstance.go b/pkg/clientset/versioned/typed/storage/v1/virtualclusterinstance.go index baa3f21..28dea55 100644 --- a/pkg/clientset/versioned/typed/storage/v1/virtualclusterinstance.go +++ b/pkg/clientset/versioned/typed/storage/v1/virtualclusterinstance.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // VirtualClusterInstancesGetter has a method to return a VirtualClusterInstanceInterface. @@ -35,128 +34,18 @@ type VirtualClusterInstanceInterface interface { // virtualClusterInstances implements VirtualClusterInstanceInterface type virtualClusterInstances struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.VirtualClusterInstance, *v1.VirtualClusterInstanceList] } // newVirtualClusterInstances returns a VirtualClusterInstances func newVirtualClusterInstances(c *StorageV1Client, namespace string) *virtualClusterInstances { return &virtualClusterInstances{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.VirtualClusterInstance, *v1.VirtualClusterInstanceList]( + "virtualclusterinstances", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.VirtualClusterInstance { return &v1.VirtualClusterInstance{} }, + func() *v1.VirtualClusterInstanceList { return &v1.VirtualClusterInstanceList{} }), } } - -// Get takes name of the virtualClusterInstance, and returns the corresponding virtualClusterInstance object, and an error if there is any. -func (c *virtualClusterInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualClusterInstance, err error) { - result = &v1.VirtualClusterInstance{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualClusterInstances that match those selectors. -func (c *virtualClusterInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualClusterInstanceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.VirtualClusterInstanceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualClusterInstances. -func (c *virtualClusterInstances) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualClusterInstance and creates it. Returns the server's representation of the virtualClusterInstance, and an error, if there is any. -func (c *virtualClusterInstances) Create(ctx context.Context, virtualClusterInstance *v1.VirtualClusterInstance, opts metav1.CreateOptions) (result *v1.VirtualClusterInstance, err error) { - result = &v1.VirtualClusterInstance{} - err = c.client.Post(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualClusterInstance). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualClusterInstance and updates it. Returns the server's representation of the virtualClusterInstance, and an error, if there is any. -func (c *virtualClusterInstances) Update(ctx context.Context, virtualClusterInstance *v1.VirtualClusterInstance, opts metav1.UpdateOptions) (result *v1.VirtualClusterInstance, err error) { - result = &v1.VirtualClusterInstance{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - Name(virtualClusterInstance.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualClusterInstance). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualClusterInstance and deletes it. Returns an error if one occurs. -func (c *virtualClusterInstances) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualClusterInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualclusterinstances"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualClusterInstance. -func (c *virtualClusterInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualClusterInstance, err error) { - result = &v1.VirtualClusterInstance{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("virtualclusterinstances"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/storage/v1/virtualclustertemplate.go b/pkg/clientset/versioned/typed/storage/v1/virtualclustertemplate.go index e446dce..776e035 100644 --- a/pkg/clientset/versioned/typed/storage/v1/virtualclustertemplate.go +++ b/pkg/clientset/versioned/typed/storage/v1/virtualclustertemplate.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // VirtualClusterTemplatesGetter has a method to return a VirtualClusterTemplateInterface. @@ -24,6 +23,7 @@ type VirtualClusterTemplatesGetter interface { type VirtualClusterTemplateInterface interface { Create(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.CreateOptions) (*v1.VirtualClusterTemplate, error) Update(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (*v1.VirtualClusterTemplate, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (*v1.VirtualClusterTemplate, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,133 +36,18 @@ type VirtualClusterTemplateInterface interface { // virtualClusterTemplates implements VirtualClusterTemplateInterface type virtualClusterTemplates struct { - client rest.Interface + *gentype.ClientWithList[*v1.VirtualClusterTemplate, *v1.VirtualClusterTemplateList] } // newVirtualClusterTemplates returns a VirtualClusterTemplates func newVirtualClusterTemplates(c *StorageV1Client) *virtualClusterTemplates { return &virtualClusterTemplates{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.VirtualClusterTemplate, *v1.VirtualClusterTemplateList]( + "virtualclustertemplates", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.VirtualClusterTemplate { return &v1.VirtualClusterTemplate{} }, + func() *v1.VirtualClusterTemplateList { return &v1.VirtualClusterTemplateList{} }), } } - -// Get takes name of the virtualClusterTemplate, and returns the corresponding virtualClusterTemplate object, and an error if there is any. -func (c *virtualClusterTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualClusterTemplate, err error) { - result = &v1.VirtualClusterTemplate{} - err = c.client.Get(). - Resource("virtualclustertemplates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualClusterTemplates that match those selectors. -func (c *virtualClusterTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualClusterTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.VirtualClusterTemplateList{} - err = c.client.Get(). - Resource("virtualclustertemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualClusterTemplates. -func (c *virtualClusterTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("virtualclustertemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualClusterTemplate and creates it. Returns the server's representation of the virtualClusterTemplate, and an error, if there is any. -func (c *virtualClusterTemplates) Create(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.CreateOptions) (result *v1.VirtualClusterTemplate, err error) { - result = &v1.VirtualClusterTemplate{} - err = c.client.Post(). - Resource("virtualclustertemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualClusterTemplate). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualClusterTemplate and updates it. Returns the server's representation of the virtualClusterTemplate, and an error, if there is any. -func (c *virtualClusterTemplates) Update(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (result *v1.VirtualClusterTemplate, err error) { - result = &v1.VirtualClusterTemplate{} - err = c.client.Put(). - Resource("virtualclustertemplates"). - Name(virtualClusterTemplate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualClusterTemplate). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *virtualClusterTemplates) UpdateStatus(ctx context.Context, virtualClusterTemplate *v1.VirtualClusterTemplate, opts metav1.UpdateOptions) (result *v1.VirtualClusterTemplate, err error) { - result = &v1.VirtualClusterTemplate{} - err = c.client.Put(). - Resource("virtualclustertemplates"). - Name(virtualClusterTemplate.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualClusterTemplate). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualClusterTemplate and deletes it. Returns an error if one occurs. -func (c *virtualClusterTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("virtualclustertemplates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualClusterTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("virtualclustertemplates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualClusterTemplate. -func (c *virtualClusterTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualClusterTemplate, err error) { - result = &v1.VirtualClusterTemplate{} - err = c.client.Patch(pt). - Resource("virtualclustertemplates"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clientset/versioned/typed/virtualcluster/v1/fake/fake_helmrelease.go b/pkg/clientset/versioned/typed/virtualcluster/v1/fake/fake_helmrelease.go index ad7a4bb..ef2973d 100644 --- a/pkg/clientset/versioned/typed/virtualcluster/v1/fake/fake_helmrelease.go +++ b/pkg/clientset/versioned/typed/virtualcluster/v1/fake/fake_helmrelease.go @@ -25,22 +25,24 @@ var helmreleasesKind = v1.SchemeGroupVersion.WithKind("HelmRelease") // Get takes name of the helmRelease, and returns the corresponding helmRelease object, and an error if there is any. func (c *FakeHelmReleases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HelmRelease, err error) { + emptyResult := &v1.HelmRelease{} obj, err := c.Fake. - Invokes(testing.NewGetAction(helmreleasesResource, c.ns, name), &v1.HelmRelease{}) + Invokes(testing.NewGetActionWithOptions(helmreleasesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HelmRelease), err } // List takes label and field selectors, and returns the list of HelmReleases that match those selectors. func (c *FakeHelmReleases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HelmReleaseList, err error) { + emptyResult := &v1.HelmReleaseList{} obj, err := c.Fake. - Invokes(testing.NewListAction(helmreleasesResource, helmreleasesKind, c.ns, opts), &v1.HelmReleaseList{}) + Invokes(testing.NewListActionWithOptions(helmreleasesResource, helmreleasesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -59,40 +61,43 @@ func (c *FakeHelmReleases) List(ctx context.Context, opts metav1.ListOptions) (r // Watch returns a watch.Interface that watches the requested helmReleases. func (c *FakeHelmReleases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(helmreleasesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(helmreleasesResource, c.ns, opts)) } // Create takes the representation of a helmRelease and creates it. Returns the server's representation of the helmRelease, and an error, if there is any. func (c *FakeHelmReleases) Create(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.CreateOptions) (result *v1.HelmRelease, err error) { + emptyResult := &v1.HelmRelease{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(helmreleasesResource, c.ns, helmRelease), &v1.HelmRelease{}) + Invokes(testing.NewCreateActionWithOptions(helmreleasesResource, c.ns, helmRelease, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HelmRelease), err } // Update takes the representation of a helmRelease and updates it. Returns the server's representation of the helmRelease, and an error, if there is any. func (c *FakeHelmReleases) Update(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.UpdateOptions) (result *v1.HelmRelease, err error) { + emptyResult := &v1.HelmRelease{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(helmreleasesResource, c.ns, helmRelease), &v1.HelmRelease{}) + Invokes(testing.NewUpdateActionWithOptions(helmreleasesResource, c.ns, helmRelease, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HelmRelease), 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 *FakeHelmReleases) UpdateStatus(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.UpdateOptions) (*v1.HelmRelease, error) { +func (c *FakeHelmReleases) UpdateStatus(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.UpdateOptions) (result *v1.HelmRelease, err error) { + emptyResult := &v1.HelmRelease{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(helmreleasesResource, "status", c.ns, helmRelease), &v1.HelmRelease{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(helmreleasesResource, "status", c.ns, helmRelease, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HelmRelease), err } @@ -107,7 +112,7 @@ func (c *FakeHelmReleases) Delete(ctx context.Context, name string, opts metav1. // DeleteCollection deletes a collection of objects. func (c *FakeHelmReleases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(helmreleasesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(helmreleasesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.HelmReleaseList{}) return err @@ -115,11 +120,12 @@ func (c *FakeHelmReleases) DeleteCollection(ctx context.Context, opts metav1.Del // Patch applies the patch and returns the patched helmRelease. func (c *FakeHelmReleases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HelmRelease, err error) { + emptyResult := &v1.HelmRelease{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(helmreleasesResource, c.ns, name, pt, data, subresources...), &v1.HelmRelease{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(helmreleasesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HelmRelease), err } diff --git a/pkg/clientset/versioned/typed/virtualcluster/v1/helmrelease.go b/pkg/clientset/versioned/typed/virtualcluster/v1/helmrelease.go index c72a1e8..90867bc 100644 --- a/pkg/clientset/versioned/typed/virtualcluster/v1/helmrelease.go +++ b/pkg/clientset/versioned/typed/virtualcluster/v1/helmrelease.go @@ -4,14 +4,13 @@ package v1 import ( "context" - "time" v1 "github.com/loft-sh/api/v4/pkg/apis/virtualcluster/v1" scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // HelmReleasesGetter has a method to return a HelmReleaseInterface. @@ -24,6 +23,7 @@ type HelmReleasesGetter interface { type HelmReleaseInterface interface { Create(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.CreateOptions) (*v1.HelmRelease, error) Update(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.UpdateOptions) (*v1.HelmRelease, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.UpdateOptions) (*v1.HelmRelease, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -36,144 +36,18 @@ type HelmReleaseInterface interface { // helmReleases implements HelmReleaseInterface type helmReleases struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.HelmRelease, *v1.HelmReleaseList] } // newHelmReleases returns a HelmReleases func newHelmReleases(c *VirtualclusterV1Client, namespace string) *helmReleases { return &helmReleases{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.HelmRelease, *v1.HelmReleaseList]( + "helmreleases", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.HelmRelease { return &v1.HelmRelease{} }, + func() *v1.HelmReleaseList { return &v1.HelmReleaseList{} }), } } - -// Get takes name of the helmRelease, and returns the corresponding helmRelease object, and an error if there is any. -func (c *helmReleases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HelmRelease, err error) { - result = &v1.HelmRelease{} - err = c.client.Get(). - Namespace(c.ns). - Resource("helmreleases"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of HelmReleases that match those selectors. -func (c *helmReleases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HelmReleaseList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.HelmReleaseList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("helmreleases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested helmReleases. -func (c *helmReleases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("helmreleases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a helmRelease and creates it. Returns the server's representation of the helmRelease, and an error, if there is any. -func (c *helmReleases) Create(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.CreateOptions) (result *v1.HelmRelease, err error) { - result = &v1.HelmRelease{} - err = c.client.Post(). - Namespace(c.ns). - Resource("helmreleases"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(helmRelease). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a helmRelease and updates it. Returns the server's representation of the helmRelease, and an error, if there is any. -func (c *helmReleases) Update(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.UpdateOptions) (result *v1.HelmRelease, err error) { - result = &v1.HelmRelease{} - err = c.client.Put(). - Namespace(c.ns). - Resource("helmreleases"). - Name(helmRelease.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(helmRelease). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *helmReleases) UpdateStatus(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.UpdateOptions) (result *v1.HelmRelease, err error) { - result = &v1.HelmRelease{} - err = c.client.Put(). - Namespace(c.ns). - Resource("helmreleases"). - Name(helmRelease.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(helmRelease). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the helmRelease and deletes it. Returns an error if one occurs. -func (c *helmReleases) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("helmreleases"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *helmReleases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("helmreleases"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched helmRelease. -func (c *helmReleases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HelmRelease, err error) { - result = &v1.HelmRelease{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("helmreleases"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/informers/externalversions/factory.go b/pkg/informers/externalversions/factory.go index c9d0beb..2103915 100644 --- a/pkg/informers/externalversions/factory.go +++ b/pkg/informers/externalversions/factory.go @@ -214,6 +214,7 @@ type SharedInformerFactory interface { // Start initializes all requested informers. They are handled in goroutines // which run until the stop channel gets closed. + // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync. Start(stopCh <-chan struct{}) // Shutdown marks a factory as shutting down. At that point no new diff --git a/pkg/listers/management/v1/agentauditevent.go b/pkg/listers/management/v1/agentauditevent.go index 9402cf6..f932c7d 100644 --- a/pkg/listers/management/v1/agentauditevent.go +++ b/pkg/listers/management/v1/agentauditevent.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type AgentAuditEventLister interface { // agentAuditEventLister implements the AgentAuditEventLister interface. type agentAuditEventLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.AgentAuditEvent] } // NewAgentAuditEventLister returns a new AgentAuditEventLister. func NewAgentAuditEventLister(indexer cache.Indexer) AgentAuditEventLister { - return &agentAuditEventLister{indexer: indexer} -} - -// List lists all AgentAuditEvents in the indexer. -func (s *agentAuditEventLister) List(selector labels.Selector) (ret []*v1.AgentAuditEvent, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.AgentAuditEvent)) - }) - return ret, err -} - -// Get retrieves the AgentAuditEvent from the index for a given name. -func (s *agentAuditEventLister) Get(name string) (*v1.AgentAuditEvent, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("agentauditevent"), name) - } - return obj.(*v1.AgentAuditEvent), nil + return &agentAuditEventLister{listers.New[*v1.AgentAuditEvent](indexer, v1.Resource("agentauditevent"))} } diff --git a/pkg/listers/management/v1/announcement.go b/pkg/listers/management/v1/announcement.go index 5c43000..1950939 100644 --- a/pkg/listers/management/v1/announcement.go +++ b/pkg/listers/management/v1/announcement.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type AnnouncementLister interface { // announcementLister implements the AnnouncementLister interface. type announcementLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Announcement] } // NewAnnouncementLister returns a new AnnouncementLister. func NewAnnouncementLister(indexer cache.Indexer) AnnouncementLister { - return &announcementLister{indexer: indexer} -} - -// List lists all Announcements in the indexer. -func (s *announcementLister) List(selector labels.Selector) (ret []*v1.Announcement, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Announcement)) - }) - return ret, err -} - -// Get retrieves the Announcement from the index for a given name. -func (s *announcementLister) Get(name string) (*v1.Announcement, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("announcement"), name) - } - return obj.(*v1.Announcement), nil + return &announcementLister{listers.New[*v1.Announcement](indexer, v1.Resource("announcement"))} } diff --git a/pkg/listers/management/v1/app.go b/pkg/listers/management/v1/app.go index 16bf1a8..d2be17d 100644 --- a/pkg/listers/management/v1/app.go +++ b/pkg/listers/management/v1/app.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type AppLister interface { // appLister implements the AppLister interface. type appLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.App] } // NewAppLister returns a new AppLister. func NewAppLister(indexer cache.Indexer) AppLister { - return &appLister{indexer: indexer} -} - -// List lists all Apps in the indexer. -func (s *appLister) List(selector labels.Selector) (ret []*v1.App, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.App)) - }) - return ret, err -} - -// Get retrieves the App from the index for a given name. -func (s *appLister) Get(name string) (*v1.App, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("app"), name) - } - return obj.(*v1.App), nil + return &appLister{listers.New[*v1.App](indexer, v1.Resource("app"))} } diff --git a/pkg/listers/management/v1/backup.go b/pkg/listers/management/v1/backup.go index 5cd6dcc..7a3643f 100644 --- a/pkg/listers/management/v1/backup.go +++ b/pkg/listers/management/v1/backup.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type BackupLister interface { // backupLister implements the BackupLister interface. type backupLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Backup] } // NewBackupLister returns a new BackupLister. func NewBackupLister(indexer cache.Indexer) BackupLister { - return &backupLister{indexer: indexer} -} - -// List lists all Backups in the indexer. -func (s *backupLister) List(selector labels.Selector) (ret []*v1.Backup, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Backup)) - }) - return ret, err -} - -// Get retrieves the Backup from the index for a given name. -func (s *backupLister) Get(name string) (*v1.Backup, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("backup"), name) - } - return obj.(*v1.Backup), nil + return &backupLister{listers.New[*v1.Backup](indexer, v1.Resource("backup"))} } diff --git a/pkg/listers/management/v1/cluster.go b/pkg/listers/management/v1/cluster.go index bf20f9e..bf5b5b7 100644 --- a/pkg/listers/management/v1/cluster.go +++ b/pkg/listers/management/v1/cluster.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type ClusterLister interface { // clusterLister implements the ClusterLister interface. type clusterLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Cluster] } // NewClusterLister returns a new ClusterLister. func NewClusterLister(indexer cache.Indexer) ClusterLister { - return &clusterLister{indexer: indexer} -} - -// List lists all Clusters in the indexer. -func (s *clusterLister) List(selector labels.Selector) (ret []*v1.Cluster, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Cluster)) - }) - return ret, err -} - -// Get retrieves the Cluster from the index for a given name. -func (s *clusterLister) Get(name string) (*v1.Cluster, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("cluster"), name) - } - return obj.(*v1.Cluster), nil + return &clusterLister{listers.New[*v1.Cluster](indexer, v1.Resource("cluster"))} } diff --git a/pkg/listers/management/v1/clusteraccess.go b/pkg/listers/management/v1/clusteraccess.go index b305414..6040a1f 100644 --- a/pkg/listers/management/v1/clusteraccess.go +++ b/pkg/listers/management/v1/clusteraccess.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type ClusterAccessLister interface { // clusterAccessLister implements the ClusterAccessLister interface. type clusterAccessLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ClusterAccess] } // NewClusterAccessLister returns a new ClusterAccessLister. func NewClusterAccessLister(indexer cache.Indexer) ClusterAccessLister { - return &clusterAccessLister{indexer: indexer} -} - -// List lists all ClusterAccesses in the indexer. -func (s *clusterAccessLister) List(selector labels.Selector) (ret []*v1.ClusterAccess, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ClusterAccess)) - }) - return ret, err -} - -// Get retrieves the ClusterAccess from the index for a given name. -func (s *clusterAccessLister) Get(name string) (*v1.ClusterAccess, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("clusteraccess"), name) - } - return obj.(*v1.ClusterAccess), nil + return &clusterAccessLister{listers.New[*v1.ClusterAccess](indexer, v1.Resource("clusteraccess"))} } diff --git a/pkg/listers/management/v1/clusterroletemplate.go b/pkg/listers/management/v1/clusterroletemplate.go index 0e36bf1..100a734 100644 --- a/pkg/listers/management/v1/clusterroletemplate.go +++ b/pkg/listers/management/v1/clusterroletemplate.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type ClusterRoleTemplateLister interface { // clusterRoleTemplateLister implements the ClusterRoleTemplateLister interface. type clusterRoleTemplateLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ClusterRoleTemplate] } // NewClusterRoleTemplateLister returns a new ClusterRoleTemplateLister. func NewClusterRoleTemplateLister(indexer cache.Indexer) ClusterRoleTemplateLister { - return &clusterRoleTemplateLister{indexer: indexer} -} - -// List lists all ClusterRoleTemplates in the indexer. -func (s *clusterRoleTemplateLister) List(selector labels.Selector) (ret []*v1.ClusterRoleTemplate, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ClusterRoleTemplate)) - }) - return ret, err -} - -// Get retrieves the ClusterRoleTemplate from the index for a given name. -func (s *clusterRoleTemplateLister) Get(name string) (*v1.ClusterRoleTemplate, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("clusterroletemplate"), name) - } - return obj.(*v1.ClusterRoleTemplate), nil + return &clusterRoleTemplateLister{listers.New[*v1.ClusterRoleTemplate](indexer, v1.Resource("clusterroletemplate"))} } diff --git a/pkg/listers/management/v1/config.go b/pkg/listers/management/v1/config.go index ccce0de..0455f95 100644 --- a/pkg/listers/management/v1/config.go +++ b/pkg/listers/management/v1/config.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type ConfigLister interface { // configLister implements the ConfigLister interface. type configLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Config] } // NewConfigLister returns a new ConfigLister. func NewConfigLister(indexer cache.Indexer) ConfigLister { - return &configLister{indexer: indexer} -} - -// List lists all Configs in the indexer. -func (s *configLister) List(selector labels.Selector) (ret []*v1.Config, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Config)) - }) - return ret, err -} - -// Get retrieves the Config from the index for a given name. -func (s *configLister) Get(name string) (*v1.Config, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("config"), name) - } - return obj.(*v1.Config), nil + return &configLister{listers.New[*v1.Config](indexer, v1.Resource("config"))} } diff --git a/pkg/listers/management/v1/convertvirtualclusterconfig.go b/pkg/listers/management/v1/convertvirtualclusterconfig.go index af8f3ae..b3e0ab2 100644 --- a/pkg/listers/management/v1/convertvirtualclusterconfig.go +++ b/pkg/listers/management/v1/convertvirtualclusterconfig.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type ConvertVirtualClusterConfigLister interface { // convertVirtualClusterConfigLister implements the ConvertVirtualClusterConfigLister interface. type convertVirtualClusterConfigLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ConvertVirtualClusterConfig] } // NewConvertVirtualClusterConfigLister returns a new ConvertVirtualClusterConfigLister. func NewConvertVirtualClusterConfigLister(indexer cache.Indexer) ConvertVirtualClusterConfigLister { - return &convertVirtualClusterConfigLister{indexer: indexer} -} - -// List lists all ConvertVirtualClusterConfigs in the indexer. -func (s *convertVirtualClusterConfigLister) List(selector labels.Selector) (ret []*v1.ConvertVirtualClusterConfig, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ConvertVirtualClusterConfig)) - }) - return ret, err -} - -// Get retrieves the ConvertVirtualClusterConfig from the index for a given name. -func (s *convertVirtualClusterConfigLister) Get(name string) (*v1.ConvertVirtualClusterConfig, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("convertvirtualclusterconfig"), name) - } - return obj.(*v1.ConvertVirtualClusterConfig), nil + return &convertVirtualClusterConfigLister{listers.New[*v1.ConvertVirtualClusterConfig](indexer, v1.Resource("convertvirtualclusterconfig"))} } diff --git a/pkg/listers/management/v1/devpodenvironmenttemplate.go b/pkg/listers/management/v1/devpodenvironmenttemplate.go index 91c3d1a..7902544 100644 --- a/pkg/listers/management/v1/devpodenvironmenttemplate.go +++ b/pkg/listers/management/v1/devpodenvironmenttemplate.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type DevPodEnvironmentTemplateLister interface { // devPodEnvironmentTemplateLister implements the DevPodEnvironmentTemplateLister interface. type devPodEnvironmentTemplateLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.DevPodEnvironmentTemplate] } // NewDevPodEnvironmentTemplateLister returns a new DevPodEnvironmentTemplateLister. func NewDevPodEnvironmentTemplateLister(indexer cache.Indexer) DevPodEnvironmentTemplateLister { - return &devPodEnvironmentTemplateLister{indexer: indexer} -} - -// List lists all DevPodEnvironmentTemplates in the indexer. -func (s *devPodEnvironmentTemplateLister) List(selector labels.Selector) (ret []*v1.DevPodEnvironmentTemplate, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DevPodEnvironmentTemplate)) - }) - return ret, err -} - -// Get retrieves the DevPodEnvironmentTemplate from the index for a given name. -func (s *devPodEnvironmentTemplateLister) Get(name string) (*v1.DevPodEnvironmentTemplate, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("devpodenvironmenttemplate"), name) - } - return obj.(*v1.DevPodEnvironmentTemplate), nil + return &devPodEnvironmentTemplateLister{listers.New[*v1.DevPodEnvironmentTemplate](indexer, v1.Resource("devpodenvironmenttemplate"))} } diff --git a/pkg/listers/management/v1/devpodworkspaceinstance.go b/pkg/listers/management/v1/devpodworkspaceinstance.go index 3c32f95..d7ccf8b 100644 --- a/pkg/listers/management/v1/devpodworkspaceinstance.go +++ b/pkg/listers/management/v1/devpodworkspaceinstance.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type DevPodWorkspaceInstanceLister interface { // devPodWorkspaceInstanceLister implements the DevPodWorkspaceInstanceLister interface. type devPodWorkspaceInstanceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.DevPodWorkspaceInstance] } // NewDevPodWorkspaceInstanceLister returns a new DevPodWorkspaceInstanceLister. func NewDevPodWorkspaceInstanceLister(indexer cache.Indexer) DevPodWorkspaceInstanceLister { - return &devPodWorkspaceInstanceLister{indexer: indexer} -} - -// List lists all DevPodWorkspaceInstances in the indexer. -func (s *devPodWorkspaceInstanceLister) List(selector labels.Selector) (ret []*v1.DevPodWorkspaceInstance, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DevPodWorkspaceInstance)) - }) - return ret, err + return &devPodWorkspaceInstanceLister{listers.New[*v1.DevPodWorkspaceInstance](indexer, v1.Resource("devpodworkspaceinstance"))} } // DevPodWorkspaceInstances returns an object that can list and get DevPodWorkspaceInstances. func (s *devPodWorkspaceInstanceLister) DevPodWorkspaceInstances(namespace string) DevPodWorkspaceInstanceNamespaceLister { - return devPodWorkspaceInstanceNamespaceLister{indexer: s.indexer, namespace: namespace} + return devPodWorkspaceInstanceNamespaceLister{listers.NewNamespaced[*v1.DevPodWorkspaceInstance](s.ResourceIndexer, namespace)} } // DevPodWorkspaceInstanceNamespaceLister helps list and get DevPodWorkspaceInstances. @@ -58,26 +50,5 @@ type DevPodWorkspaceInstanceNamespaceLister interface { // devPodWorkspaceInstanceNamespaceLister implements the DevPodWorkspaceInstanceNamespaceLister // interface. type devPodWorkspaceInstanceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all DevPodWorkspaceInstances in the indexer for a given namespace. -func (s devPodWorkspaceInstanceNamespaceLister) List(selector labels.Selector) (ret []*v1.DevPodWorkspaceInstance, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DevPodWorkspaceInstance)) - }) - return ret, err -} - -// Get retrieves the DevPodWorkspaceInstance from the indexer for a given namespace and name. -func (s devPodWorkspaceInstanceNamespaceLister) Get(name string) (*v1.DevPodWorkspaceInstance, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("devpodworkspaceinstance"), name) - } - return obj.(*v1.DevPodWorkspaceInstance), nil + listers.ResourceIndexer[*v1.DevPodWorkspaceInstance] } diff --git a/pkg/listers/management/v1/devpodworkspacetemplate.go b/pkg/listers/management/v1/devpodworkspacetemplate.go index 447e7e2..ce5d694 100644 --- a/pkg/listers/management/v1/devpodworkspacetemplate.go +++ b/pkg/listers/management/v1/devpodworkspacetemplate.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type DevPodWorkspaceTemplateLister interface { // devPodWorkspaceTemplateLister implements the DevPodWorkspaceTemplateLister interface. type devPodWorkspaceTemplateLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.DevPodWorkspaceTemplate] } // NewDevPodWorkspaceTemplateLister returns a new DevPodWorkspaceTemplateLister. func NewDevPodWorkspaceTemplateLister(indexer cache.Indexer) DevPodWorkspaceTemplateLister { - return &devPodWorkspaceTemplateLister{indexer: indexer} -} - -// List lists all DevPodWorkspaceTemplates in the indexer. -func (s *devPodWorkspaceTemplateLister) List(selector labels.Selector) (ret []*v1.DevPodWorkspaceTemplate, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DevPodWorkspaceTemplate)) - }) - return ret, err -} - -// Get retrieves the DevPodWorkspaceTemplate from the index for a given name. -func (s *devPodWorkspaceTemplateLister) Get(name string) (*v1.DevPodWorkspaceTemplate, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("devpodworkspacetemplate"), name) - } - return obj.(*v1.DevPodWorkspaceTemplate), nil + return &devPodWorkspaceTemplateLister{listers.New[*v1.DevPodWorkspaceTemplate](indexer, v1.Resource("devpodworkspacetemplate"))} } diff --git a/pkg/listers/management/v1/directclusterendpointtoken.go b/pkg/listers/management/v1/directclusterendpointtoken.go index b9b121a..58620ea 100644 --- a/pkg/listers/management/v1/directclusterendpointtoken.go +++ b/pkg/listers/management/v1/directclusterendpointtoken.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type DirectClusterEndpointTokenLister interface { // directClusterEndpointTokenLister implements the DirectClusterEndpointTokenLister interface. type directClusterEndpointTokenLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.DirectClusterEndpointToken] } // NewDirectClusterEndpointTokenLister returns a new DirectClusterEndpointTokenLister. func NewDirectClusterEndpointTokenLister(indexer cache.Indexer) DirectClusterEndpointTokenLister { - return &directClusterEndpointTokenLister{indexer: indexer} -} - -// List lists all DirectClusterEndpointTokens in the indexer. -func (s *directClusterEndpointTokenLister) List(selector labels.Selector) (ret []*v1.DirectClusterEndpointToken, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DirectClusterEndpointToken)) - }) - return ret, err -} - -// Get retrieves the DirectClusterEndpointToken from the index for a given name. -func (s *directClusterEndpointTokenLister) Get(name string) (*v1.DirectClusterEndpointToken, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("directclusterendpointtoken"), name) - } - return obj.(*v1.DirectClusterEndpointToken), nil + return &directClusterEndpointTokenLister{listers.New[*v1.DirectClusterEndpointToken](indexer, v1.Resource("directclusterendpointtoken"))} } diff --git a/pkg/listers/management/v1/event.go b/pkg/listers/management/v1/event.go index 6bbbef6..d64d1c3 100644 --- a/pkg/listers/management/v1/event.go +++ b/pkg/listers/management/v1/event.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type EventLister interface { // eventLister implements the EventLister interface. type eventLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Event] } // NewEventLister returns a new EventLister. func NewEventLister(indexer cache.Indexer) EventLister { - return &eventLister{indexer: indexer} -} - -// List lists all Events in the indexer. -func (s *eventLister) List(selector labels.Selector) (ret []*v1.Event, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Event)) - }) - return ret, err -} - -// Get retrieves the Event from the index for a given name. -func (s *eventLister) Get(name string) (*v1.Event, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("event"), name) - } - return obj.(*v1.Event), nil + return &eventLister{listers.New[*v1.Event](indexer, v1.Resource("event"))} } diff --git a/pkg/listers/management/v1/feature.go b/pkg/listers/management/v1/feature.go index 8f1fe81..14e8874 100644 --- a/pkg/listers/management/v1/feature.go +++ b/pkg/listers/management/v1/feature.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type FeatureLister interface { // featureLister implements the FeatureLister interface. type featureLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Feature] } // NewFeatureLister returns a new FeatureLister. func NewFeatureLister(indexer cache.Indexer) FeatureLister { - return &featureLister{indexer: indexer} -} - -// List lists all Features in the indexer. -func (s *featureLister) List(selector labels.Selector) (ret []*v1.Feature, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Feature)) - }) - return ret, err -} - -// Get retrieves the Feature from the index for a given name. -func (s *featureLister) Get(name string) (*v1.Feature, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("feature"), name) - } - return obj.(*v1.Feature), nil + return &featureLister{listers.New[*v1.Feature](indexer, v1.Resource("feature"))} } diff --git a/pkg/listers/management/v1/ingressauthtoken.go b/pkg/listers/management/v1/ingressauthtoken.go index 5ef7ae5..4239c8e 100644 --- a/pkg/listers/management/v1/ingressauthtoken.go +++ b/pkg/listers/management/v1/ingressauthtoken.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type IngressAuthTokenLister interface { // ingressAuthTokenLister implements the IngressAuthTokenLister interface. type ingressAuthTokenLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.IngressAuthToken] } // NewIngressAuthTokenLister returns a new IngressAuthTokenLister. func NewIngressAuthTokenLister(indexer cache.Indexer) IngressAuthTokenLister { - return &ingressAuthTokenLister{indexer: indexer} -} - -// List lists all IngressAuthTokens in the indexer. -func (s *ingressAuthTokenLister) List(selector labels.Selector) (ret []*v1.IngressAuthToken, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.IngressAuthToken)) - }) - return ret, err -} - -// Get retrieves the IngressAuthToken from the index for a given name. -func (s *ingressAuthTokenLister) Get(name string) (*v1.IngressAuthToken, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("ingressauthtoken"), name) - } - return obj.(*v1.IngressAuthToken), nil + return &ingressAuthTokenLister{listers.New[*v1.IngressAuthToken](indexer, v1.Resource("ingressauthtoken"))} } diff --git a/pkg/listers/management/v1/license.go b/pkg/listers/management/v1/license.go index f5401fa..502e475 100644 --- a/pkg/listers/management/v1/license.go +++ b/pkg/listers/management/v1/license.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type LicenseLister interface { // licenseLister implements the LicenseLister interface. type licenseLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.License] } // NewLicenseLister returns a new LicenseLister. func NewLicenseLister(indexer cache.Indexer) LicenseLister { - return &licenseLister{indexer: indexer} -} - -// List lists all Licenses in the indexer. -func (s *licenseLister) List(selector labels.Selector) (ret []*v1.License, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.License)) - }) - return ret, err -} - -// Get retrieves the License from the index for a given name. -func (s *licenseLister) Get(name string) (*v1.License, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("license"), name) - } - return obj.(*v1.License), nil + return &licenseLister{listers.New[*v1.License](indexer, v1.Resource("license"))} } diff --git a/pkg/listers/management/v1/licensetoken.go b/pkg/listers/management/v1/licensetoken.go index e81387c..43579dd 100644 --- a/pkg/listers/management/v1/licensetoken.go +++ b/pkg/listers/management/v1/licensetoken.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type LicenseTokenLister interface { // licenseTokenLister implements the LicenseTokenLister interface. type licenseTokenLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.LicenseToken] } // NewLicenseTokenLister returns a new LicenseTokenLister. func NewLicenseTokenLister(indexer cache.Indexer) LicenseTokenLister { - return &licenseTokenLister{indexer: indexer} -} - -// List lists all LicenseTokens in the indexer. -func (s *licenseTokenLister) List(selector labels.Selector) (ret []*v1.LicenseToken, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.LicenseToken)) - }) - return ret, err -} - -// Get retrieves the LicenseToken from the index for a given name. -func (s *licenseTokenLister) Get(name string) (*v1.LicenseToken, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("licensetoken"), name) - } - return obj.(*v1.LicenseToken), nil + return &licenseTokenLister{listers.New[*v1.LicenseToken](indexer, v1.Resource("licensetoken"))} } diff --git a/pkg/listers/management/v1/loftupgrade.go b/pkg/listers/management/v1/loftupgrade.go index 6612e30..f52fc50 100644 --- a/pkg/listers/management/v1/loftupgrade.go +++ b/pkg/listers/management/v1/loftupgrade.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type LoftUpgradeLister interface { // loftUpgradeLister implements the LoftUpgradeLister interface. type loftUpgradeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.LoftUpgrade] } // NewLoftUpgradeLister returns a new LoftUpgradeLister. func NewLoftUpgradeLister(indexer cache.Indexer) LoftUpgradeLister { - return &loftUpgradeLister{indexer: indexer} -} - -// List lists all LoftUpgrades in the indexer. -func (s *loftUpgradeLister) List(selector labels.Selector) (ret []*v1.LoftUpgrade, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.LoftUpgrade)) - }) - return ret, err -} - -// Get retrieves the LoftUpgrade from the index for a given name. -func (s *loftUpgradeLister) Get(name string) (*v1.LoftUpgrade, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("loftupgrade"), name) - } - return obj.(*v1.LoftUpgrade), nil + return &loftUpgradeLister{listers.New[*v1.LoftUpgrade](indexer, v1.Resource("loftupgrade"))} } diff --git a/pkg/listers/management/v1/oidcclient.go b/pkg/listers/management/v1/oidcclient.go index 035996e..4784277 100644 --- a/pkg/listers/management/v1/oidcclient.go +++ b/pkg/listers/management/v1/oidcclient.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type OIDCClientLister interface { // oIDCClientLister implements the OIDCClientLister interface. type oIDCClientLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.OIDCClient] } // NewOIDCClientLister returns a new OIDCClientLister. func NewOIDCClientLister(indexer cache.Indexer) OIDCClientLister { - return &oIDCClientLister{indexer: indexer} -} - -// List lists all OIDCClients in the indexer. -func (s *oIDCClientLister) List(selector labels.Selector) (ret []*v1.OIDCClient, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.OIDCClient)) - }) - return ret, err -} - -// Get retrieves the OIDCClient from the index for a given name. -func (s *oIDCClientLister) Get(name string) (*v1.OIDCClient, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("oidcclient"), name) - } - return obj.(*v1.OIDCClient), nil + return &oIDCClientLister{listers.New[*v1.OIDCClient](indexer, v1.Resource("oidcclient"))} } diff --git a/pkg/listers/management/v1/ownedaccesskey.go b/pkg/listers/management/v1/ownedaccesskey.go index ebb0a15..1cbd7ae 100644 --- a/pkg/listers/management/v1/ownedaccesskey.go +++ b/pkg/listers/management/v1/ownedaccesskey.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type OwnedAccessKeyLister interface { // ownedAccessKeyLister implements the OwnedAccessKeyLister interface. type ownedAccessKeyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.OwnedAccessKey] } // NewOwnedAccessKeyLister returns a new OwnedAccessKeyLister. func NewOwnedAccessKeyLister(indexer cache.Indexer) OwnedAccessKeyLister { - return &ownedAccessKeyLister{indexer: indexer} -} - -// List lists all OwnedAccessKeys in the indexer. -func (s *ownedAccessKeyLister) List(selector labels.Selector) (ret []*v1.OwnedAccessKey, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.OwnedAccessKey)) - }) - return ret, err -} - -// Get retrieves the OwnedAccessKey from the index for a given name. -func (s *ownedAccessKeyLister) Get(name string) (*v1.OwnedAccessKey, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("ownedaccesskey"), name) - } - return obj.(*v1.OwnedAccessKey), nil + return &ownedAccessKeyLister{listers.New[*v1.OwnedAccessKey](indexer, v1.Resource("ownedaccesskey"))} } diff --git a/pkg/listers/management/v1/project.go b/pkg/listers/management/v1/project.go index 7349ec6..bb5bd6c 100644 --- a/pkg/listers/management/v1/project.go +++ b/pkg/listers/management/v1/project.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type ProjectLister interface { // projectLister implements the ProjectLister interface. type projectLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Project] } // NewProjectLister returns a new ProjectLister. func NewProjectLister(indexer cache.Indexer) ProjectLister { - return &projectLister{indexer: indexer} -} - -// List lists all Projects in the indexer. -func (s *projectLister) List(selector labels.Selector) (ret []*v1.Project, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Project)) - }) - return ret, err -} - -// Get retrieves the Project from the index for a given name. -func (s *projectLister) Get(name string) (*v1.Project, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("project"), name) - } - return obj.(*v1.Project), nil + return &projectLister{listers.New[*v1.Project](indexer, v1.Resource("project"))} } diff --git a/pkg/listers/management/v1/projectsecret.go b/pkg/listers/management/v1/projectsecret.go index d0e0765..5e46d9f 100644 --- a/pkg/listers/management/v1/projectsecret.go +++ b/pkg/listers/management/v1/projectsecret.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type ProjectSecretLister interface { // projectSecretLister implements the ProjectSecretLister interface. type projectSecretLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ProjectSecret] } // NewProjectSecretLister returns a new ProjectSecretLister. func NewProjectSecretLister(indexer cache.Indexer) ProjectSecretLister { - return &projectSecretLister{indexer: indexer} -} - -// List lists all ProjectSecrets in the indexer. -func (s *projectSecretLister) List(selector labels.Selector) (ret []*v1.ProjectSecret, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ProjectSecret)) - }) - return ret, err + return &projectSecretLister{listers.New[*v1.ProjectSecret](indexer, v1.Resource("projectsecret"))} } // ProjectSecrets returns an object that can list and get ProjectSecrets. func (s *projectSecretLister) ProjectSecrets(namespace string) ProjectSecretNamespaceLister { - return projectSecretNamespaceLister{indexer: s.indexer, namespace: namespace} + return projectSecretNamespaceLister{listers.NewNamespaced[*v1.ProjectSecret](s.ResourceIndexer, namespace)} } // ProjectSecretNamespaceLister helps list and get ProjectSecrets. @@ -58,26 +50,5 @@ type ProjectSecretNamespaceLister interface { // projectSecretNamespaceLister implements the ProjectSecretNamespaceLister // interface. type projectSecretNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ProjectSecrets in the indexer for a given namespace. -func (s projectSecretNamespaceLister) List(selector labels.Selector) (ret []*v1.ProjectSecret, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ProjectSecret)) - }) - return ret, err -} - -// Get retrieves the ProjectSecret from the indexer for a given namespace and name. -func (s projectSecretNamespaceLister) Get(name string) (*v1.ProjectSecret, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("projectsecret"), name) - } - return obj.(*v1.ProjectSecret), nil + listers.ResourceIndexer[*v1.ProjectSecret] } diff --git a/pkg/listers/management/v1/redirecttoken.go b/pkg/listers/management/v1/redirecttoken.go index 65ac803..5977122 100644 --- a/pkg/listers/management/v1/redirecttoken.go +++ b/pkg/listers/management/v1/redirecttoken.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type RedirectTokenLister interface { // redirectTokenLister implements the RedirectTokenLister interface. type redirectTokenLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.RedirectToken] } // NewRedirectTokenLister returns a new RedirectTokenLister. func NewRedirectTokenLister(indexer cache.Indexer) RedirectTokenLister { - return &redirectTokenLister{indexer: indexer} -} - -// List lists all RedirectTokens in the indexer. -func (s *redirectTokenLister) List(selector labels.Selector) (ret []*v1.RedirectToken, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RedirectToken)) - }) - return ret, err -} - -// Get retrieves the RedirectToken from the index for a given name. -func (s *redirectTokenLister) Get(name string) (*v1.RedirectToken, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("redirecttoken"), name) - } - return obj.(*v1.RedirectToken), nil + return &redirectTokenLister{listers.New[*v1.RedirectToken](indexer, v1.Resource("redirecttoken"))} } diff --git a/pkg/listers/management/v1/registervirtualcluster.go b/pkg/listers/management/v1/registervirtualcluster.go index 4b387c9..cd7cbee 100644 --- a/pkg/listers/management/v1/registervirtualcluster.go +++ b/pkg/listers/management/v1/registervirtualcluster.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type RegisterVirtualClusterLister interface { // registerVirtualClusterLister implements the RegisterVirtualClusterLister interface. type registerVirtualClusterLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.RegisterVirtualCluster] } // NewRegisterVirtualClusterLister returns a new RegisterVirtualClusterLister. func NewRegisterVirtualClusterLister(indexer cache.Indexer) RegisterVirtualClusterLister { - return ®isterVirtualClusterLister{indexer: indexer} -} - -// List lists all RegisterVirtualClusters in the indexer. -func (s *registerVirtualClusterLister) List(selector labels.Selector) (ret []*v1.RegisterVirtualCluster, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RegisterVirtualCluster)) - }) - return ret, err -} - -// Get retrieves the RegisterVirtualCluster from the index for a given name. -func (s *registerVirtualClusterLister) Get(name string) (*v1.RegisterVirtualCluster, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("registervirtualcluster"), name) - } - return obj.(*v1.RegisterVirtualCluster), nil + return ®isterVirtualClusterLister{listers.New[*v1.RegisterVirtualCluster](indexer, v1.Resource("registervirtualcluster"))} } diff --git a/pkg/listers/management/v1/resetaccesskey.go b/pkg/listers/management/v1/resetaccesskey.go index 0be1cb8..924c185 100644 --- a/pkg/listers/management/v1/resetaccesskey.go +++ b/pkg/listers/management/v1/resetaccesskey.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type ResetAccessKeyLister interface { // resetAccessKeyLister implements the ResetAccessKeyLister interface. type resetAccessKeyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ResetAccessKey] } // NewResetAccessKeyLister returns a new ResetAccessKeyLister. func NewResetAccessKeyLister(indexer cache.Indexer) ResetAccessKeyLister { - return &resetAccessKeyLister{indexer: indexer} -} - -// List lists all ResetAccessKeys in the indexer. -func (s *resetAccessKeyLister) List(selector labels.Selector) (ret []*v1.ResetAccessKey, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ResetAccessKey)) - }) - return ret, err -} - -// Get retrieves the ResetAccessKey from the index for a given name. -func (s *resetAccessKeyLister) Get(name string) (*v1.ResetAccessKey, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("resetaccesskey"), name) - } - return obj.(*v1.ResetAccessKey), nil + return &resetAccessKeyLister{listers.New[*v1.ResetAccessKey](indexer, v1.Resource("resetaccesskey"))} } diff --git a/pkg/listers/management/v1/runner.go b/pkg/listers/management/v1/runner.go index 2618a4e..42bc623 100644 --- a/pkg/listers/management/v1/runner.go +++ b/pkg/listers/management/v1/runner.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type RunnerLister interface { // runnerLister implements the RunnerLister interface. type runnerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Runner] } // NewRunnerLister returns a new RunnerLister. func NewRunnerLister(indexer cache.Indexer) RunnerLister { - return &runnerLister{indexer: indexer} -} - -// List lists all Runners in the indexer. -func (s *runnerLister) List(selector labels.Selector) (ret []*v1.Runner, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Runner)) - }) - return ret, err -} - -// Get retrieves the Runner from the index for a given name. -func (s *runnerLister) Get(name string) (*v1.Runner, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("runner"), name) - } - return obj.(*v1.Runner), nil + return &runnerLister{listers.New[*v1.Runner](indexer, v1.Resource("runner"))} } diff --git a/pkg/listers/management/v1/self.go b/pkg/listers/management/v1/self.go index 0198a5d..fba7f87 100644 --- a/pkg/listers/management/v1/self.go +++ b/pkg/listers/management/v1/self.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type SelfLister interface { // selfLister implements the SelfLister interface. type selfLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Self] } // NewSelfLister returns a new SelfLister. func NewSelfLister(indexer cache.Indexer) SelfLister { - return &selfLister{indexer: indexer} -} - -// List lists all Selves in the indexer. -func (s *selfLister) List(selector labels.Selector) (ret []*v1.Self, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Self)) - }) - return ret, err -} - -// Get retrieves the Self from the index for a given name. -func (s *selfLister) Get(name string) (*v1.Self, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("self"), name) - } - return obj.(*v1.Self), nil + return &selfLister{listers.New[*v1.Self](indexer, v1.Resource("self"))} } diff --git a/pkg/listers/management/v1/selfsubjectaccessreview.go b/pkg/listers/management/v1/selfsubjectaccessreview.go index 1b77bc5..775816b 100644 --- a/pkg/listers/management/v1/selfsubjectaccessreview.go +++ b/pkg/listers/management/v1/selfsubjectaccessreview.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type SelfSubjectAccessReviewLister interface { // selfSubjectAccessReviewLister implements the SelfSubjectAccessReviewLister interface. type selfSubjectAccessReviewLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.SelfSubjectAccessReview] } // NewSelfSubjectAccessReviewLister returns a new SelfSubjectAccessReviewLister. func NewSelfSubjectAccessReviewLister(indexer cache.Indexer) SelfSubjectAccessReviewLister { - return &selfSubjectAccessReviewLister{indexer: indexer} -} - -// List lists all SelfSubjectAccessReviews in the indexer. -func (s *selfSubjectAccessReviewLister) List(selector labels.Selector) (ret []*v1.SelfSubjectAccessReview, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SelfSubjectAccessReview)) - }) - return ret, err -} - -// Get retrieves the SelfSubjectAccessReview from the index for a given name. -func (s *selfSubjectAccessReviewLister) Get(name string) (*v1.SelfSubjectAccessReview, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("selfsubjectaccessreview"), name) - } - return obj.(*v1.SelfSubjectAccessReview), nil + return &selfSubjectAccessReviewLister{listers.New[*v1.SelfSubjectAccessReview](indexer, v1.Resource("selfsubjectaccessreview"))} } diff --git a/pkg/listers/management/v1/sharedsecret.go b/pkg/listers/management/v1/sharedsecret.go index 749e64e..9d7995c 100644 --- a/pkg/listers/management/v1/sharedsecret.go +++ b/pkg/listers/management/v1/sharedsecret.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type SharedSecretLister interface { // sharedSecretLister implements the SharedSecretLister interface. type sharedSecretLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.SharedSecret] } // NewSharedSecretLister returns a new SharedSecretLister. func NewSharedSecretLister(indexer cache.Indexer) SharedSecretLister { - return &sharedSecretLister{indexer: indexer} -} - -// List lists all SharedSecrets in the indexer. -func (s *sharedSecretLister) List(selector labels.Selector) (ret []*v1.SharedSecret, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SharedSecret)) - }) - return ret, err + return &sharedSecretLister{listers.New[*v1.SharedSecret](indexer, v1.Resource("sharedsecret"))} } // SharedSecrets returns an object that can list and get SharedSecrets. func (s *sharedSecretLister) SharedSecrets(namespace string) SharedSecretNamespaceLister { - return sharedSecretNamespaceLister{indexer: s.indexer, namespace: namespace} + return sharedSecretNamespaceLister{listers.NewNamespaced[*v1.SharedSecret](s.ResourceIndexer, namespace)} } // SharedSecretNamespaceLister helps list and get SharedSecrets. @@ -58,26 +50,5 @@ type SharedSecretNamespaceLister interface { // sharedSecretNamespaceLister implements the SharedSecretNamespaceLister // interface. type sharedSecretNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all SharedSecrets in the indexer for a given namespace. -func (s sharedSecretNamespaceLister) List(selector labels.Selector) (ret []*v1.SharedSecret, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SharedSecret)) - }) - return ret, err -} - -// Get retrieves the SharedSecret from the indexer for a given namespace and name. -func (s sharedSecretNamespaceLister) Get(name string) (*v1.SharedSecret, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("sharedsecret"), name) - } - return obj.(*v1.SharedSecret), nil + listers.ResourceIndexer[*v1.SharedSecret] } diff --git a/pkg/listers/management/v1/spaceinstance.go b/pkg/listers/management/v1/spaceinstance.go index 3a28476..2876be6 100644 --- a/pkg/listers/management/v1/spaceinstance.go +++ b/pkg/listers/management/v1/spaceinstance.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type SpaceInstanceLister interface { // spaceInstanceLister implements the SpaceInstanceLister interface. type spaceInstanceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.SpaceInstance] } // NewSpaceInstanceLister returns a new SpaceInstanceLister. func NewSpaceInstanceLister(indexer cache.Indexer) SpaceInstanceLister { - return &spaceInstanceLister{indexer: indexer} -} - -// List lists all SpaceInstances in the indexer. -func (s *spaceInstanceLister) List(selector labels.Selector) (ret []*v1.SpaceInstance, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SpaceInstance)) - }) - return ret, err + return &spaceInstanceLister{listers.New[*v1.SpaceInstance](indexer, v1.Resource("spaceinstance"))} } // SpaceInstances returns an object that can list and get SpaceInstances. func (s *spaceInstanceLister) SpaceInstances(namespace string) SpaceInstanceNamespaceLister { - return spaceInstanceNamespaceLister{indexer: s.indexer, namespace: namespace} + return spaceInstanceNamespaceLister{listers.NewNamespaced[*v1.SpaceInstance](s.ResourceIndexer, namespace)} } // SpaceInstanceNamespaceLister helps list and get SpaceInstances. @@ -58,26 +50,5 @@ type SpaceInstanceNamespaceLister interface { // spaceInstanceNamespaceLister implements the SpaceInstanceNamespaceLister // interface. type spaceInstanceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all SpaceInstances in the indexer for a given namespace. -func (s spaceInstanceNamespaceLister) List(selector labels.Selector) (ret []*v1.SpaceInstance, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SpaceInstance)) - }) - return ret, err -} - -// Get retrieves the SpaceInstance from the indexer for a given namespace and name. -func (s spaceInstanceNamespaceLister) Get(name string) (*v1.SpaceInstance, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("spaceinstance"), name) - } - return obj.(*v1.SpaceInstance), nil + listers.ResourceIndexer[*v1.SpaceInstance] } diff --git a/pkg/listers/management/v1/spacetemplate.go b/pkg/listers/management/v1/spacetemplate.go index c873aee..efeda36 100644 --- a/pkg/listers/management/v1/spacetemplate.go +++ b/pkg/listers/management/v1/spacetemplate.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type SpaceTemplateLister interface { // spaceTemplateLister implements the SpaceTemplateLister interface. type spaceTemplateLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.SpaceTemplate] } // NewSpaceTemplateLister returns a new SpaceTemplateLister. func NewSpaceTemplateLister(indexer cache.Indexer) SpaceTemplateLister { - return &spaceTemplateLister{indexer: indexer} -} - -// List lists all SpaceTemplates in the indexer. -func (s *spaceTemplateLister) List(selector labels.Selector) (ret []*v1.SpaceTemplate, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SpaceTemplate)) - }) - return ret, err -} - -// Get retrieves the SpaceTemplate from the index for a given name. -func (s *spaceTemplateLister) Get(name string) (*v1.SpaceTemplate, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("spacetemplate"), name) - } - return obj.(*v1.SpaceTemplate), nil + return &spaceTemplateLister{listers.New[*v1.SpaceTemplate](indexer, v1.Resource("spacetemplate"))} } diff --git a/pkg/listers/management/v1/subjectaccessreview.go b/pkg/listers/management/v1/subjectaccessreview.go index af2a8be..b90d7a7 100644 --- a/pkg/listers/management/v1/subjectaccessreview.go +++ b/pkg/listers/management/v1/subjectaccessreview.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type SubjectAccessReviewLister interface { // subjectAccessReviewLister implements the SubjectAccessReviewLister interface. type subjectAccessReviewLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.SubjectAccessReview] } // NewSubjectAccessReviewLister returns a new SubjectAccessReviewLister. func NewSubjectAccessReviewLister(indexer cache.Indexer) SubjectAccessReviewLister { - return &subjectAccessReviewLister{indexer: indexer} -} - -// List lists all SubjectAccessReviews in the indexer. -func (s *subjectAccessReviewLister) List(selector labels.Selector) (ret []*v1.SubjectAccessReview, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SubjectAccessReview)) - }) - return ret, err -} - -// Get retrieves the SubjectAccessReview from the index for a given name. -func (s *subjectAccessReviewLister) Get(name string) (*v1.SubjectAccessReview, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("subjectaccessreview"), name) - } - return obj.(*v1.SubjectAccessReview), nil + return &subjectAccessReviewLister{listers.New[*v1.SubjectAccessReview](indexer, v1.Resource("subjectaccessreview"))} } diff --git a/pkg/listers/management/v1/task.go b/pkg/listers/management/v1/task.go index c1ef121..17a7f86 100644 --- a/pkg/listers/management/v1/task.go +++ b/pkg/listers/management/v1/task.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type TaskLister interface { // taskLister implements the TaskLister interface. type taskLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Task] } // NewTaskLister returns a new TaskLister. func NewTaskLister(indexer cache.Indexer) TaskLister { - return &taskLister{indexer: indexer} -} - -// List lists all Tasks in the indexer. -func (s *taskLister) List(selector labels.Selector) (ret []*v1.Task, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Task)) - }) - return ret, err -} - -// Get retrieves the Task from the index for a given name. -func (s *taskLister) Get(name string) (*v1.Task, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("task"), name) - } - return obj.(*v1.Task), nil + return &taskLister{listers.New[*v1.Task](indexer, v1.Resource("task"))} } diff --git a/pkg/listers/management/v1/team.go b/pkg/listers/management/v1/team.go index 3f7d63d..eea3dd2 100644 --- a/pkg/listers/management/v1/team.go +++ b/pkg/listers/management/v1/team.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type TeamLister interface { // teamLister implements the TeamLister interface. type teamLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Team] } // NewTeamLister returns a new TeamLister. func NewTeamLister(indexer cache.Indexer) TeamLister { - return &teamLister{indexer: indexer} -} - -// List lists all Teams in the indexer. -func (s *teamLister) List(selector labels.Selector) (ret []*v1.Team, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Team)) - }) - return ret, err -} - -// Get retrieves the Team from the index for a given name. -func (s *teamLister) Get(name string) (*v1.Team, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("team"), name) - } - return obj.(*v1.Team), nil + return &teamLister{listers.New[*v1.Team](indexer, v1.Resource("team"))} } diff --git a/pkg/listers/management/v1/translatevclusterresourcename.go b/pkg/listers/management/v1/translatevclusterresourcename.go index ec838cc..6904a4a 100644 --- a/pkg/listers/management/v1/translatevclusterresourcename.go +++ b/pkg/listers/management/v1/translatevclusterresourcename.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type TranslateVClusterResourceNameLister interface { // translateVClusterResourceNameLister implements the TranslateVClusterResourceNameLister interface. type translateVClusterResourceNameLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.TranslateVClusterResourceName] } // NewTranslateVClusterResourceNameLister returns a new TranslateVClusterResourceNameLister. func NewTranslateVClusterResourceNameLister(indexer cache.Indexer) TranslateVClusterResourceNameLister { - return &translateVClusterResourceNameLister{indexer: indexer} -} - -// List lists all TranslateVClusterResourceNames in the indexer. -func (s *translateVClusterResourceNameLister) List(selector labels.Selector) (ret []*v1.TranslateVClusterResourceName, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.TranslateVClusterResourceName)) - }) - return ret, err -} - -// Get retrieves the TranslateVClusterResourceName from the index for a given name. -func (s *translateVClusterResourceNameLister) Get(name string) (*v1.TranslateVClusterResourceName, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("translatevclusterresourcename"), name) - } - return obj.(*v1.TranslateVClusterResourceName), nil + return &translateVClusterResourceNameLister{listers.New[*v1.TranslateVClusterResourceName](indexer, v1.Resource("translatevclusterresourcename"))} } diff --git a/pkg/listers/management/v1/user.go b/pkg/listers/management/v1/user.go index 2f51734..4aad012 100644 --- a/pkg/listers/management/v1/user.go +++ b/pkg/listers/management/v1/user.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type UserLister interface { // userLister implements the UserLister interface. type userLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.User] } // NewUserLister returns a new UserLister. func NewUserLister(indexer cache.Indexer) UserLister { - return &userLister{indexer: indexer} -} - -// List lists all Users in the indexer. -func (s *userLister) List(selector labels.Selector) (ret []*v1.User, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.User)) - }) - return ret, err -} - -// Get retrieves the User from the index for a given name. -func (s *userLister) Get(name string) (*v1.User, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("user"), name) - } - return obj.(*v1.User), nil + return &userLister{listers.New[*v1.User](indexer, v1.Resource("user"))} } diff --git a/pkg/listers/management/v1/virtualclusterinstance.go b/pkg/listers/management/v1/virtualclusterinstance.go index fb69d29..864a37f 100644 --- a/pkg/listers/management/v1/virtualclusterinstance.go +++ b/pkg/listers/management/v1/virtualclusterinstance.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type VirtualClusterInstanceLister interface { // virtualClusterInstanceLister implements the VirtualClusterInstanceLister interface. type virtualClusterInstanceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.VirtualClusterInstance] } // NewVirtualClusterInstanceLister returns a new VirtualClusterInstanceLister. func NewVirtualClusterInstanceLister(indexer cache.Indexer) VirtualClusterInstanceLister { - return &virtualClusterInstanceLister{indexer: indexer} -} - -// List lists all VirtualClusterInstances in the indexer. -func (s *virtualClusterInstanceLister) List(selector labels.Selector) (ret []*v1.VirtualClusterInstance, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.VirtualClusterInstance)) - }) - return ret, err + return &virtualClusterInstanceLister{listers.New[*v1.VirtualClusterInstance](indexer, v1.Resource("virtualclusterinstance"))} } // VirtualClusterInstances returns an object that can list and get VirtualClusterInstances. func (s *virtualClusterInstanceLister) VirtualClusterInstances(namespace string) VirtualClusterInstanceNamespaceLister { - return virtualClusterInstanceNamespaceLister{indexer: s.indexer, namespace: namespace} + return virtualClusterInstanceNamespaceLister{listers.NewNamespaced[*v1.VirtualClusterInstance](s.ResourceIndexer, namespace)} } // VirtualClusterInstanceNamespaceLister helps list and get VirtualClusterInstances. @@ -58,26 +50,5 @@ type VirtualClusterInstanceNamespaceLister interface { // virtualClusterInstanceNamespaceLister implements the VirtualClusterInstanceNamespaceLister // interface. type virtualClusterInstanceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VirtualClusterInstances in the indexer for a given namespace. -func (s virtualClusterInstanceNamespaceLister) List(selector labels.Selector) (ret []*v1.VirtualClusterInstance, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.VirtualClusterInstance)) - }) - return ret, err -} - -// Get retrieves the VirtualClusterInstance from the indexer for a given namespace and name. -func (s virtualClusterInstanceNamespaceLister) Get(name string) (*v1.VirtualClusterInstance, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("virtualclusterinstance"), name) - } - return obj.(*v1.VirtualClusterInstance), nil + listers.ResourceIndexer[*v1.VirtualClusterInstance] } diff --git a/pkg/listers/management/v1/virtualclustertemplate.go b/pkg/listers/management/v1/virtualclustertemplate.go index b7bd1e3..015267d 100644 --- a/pkg/listers/management/v1/virtualclustertemplate.go +++ b/pkg/listers/management/v1/virtualclustertemplate.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type VirtualClusterTemplateLister interface { // virtualClusterTemplateLister implements the VirtualClusterTemplateLister interface. type virtualClusterTemplateLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.VirtualClusterTemplate] } // NewVirtualClusterTemplateLister returns a new VirtualClusterTemplateLister. func NewVirtualClusterTemplateLister(indexer cache.Indexer) VirtualClusterTemplateLister { - return &virtualClusterTemplateLister{indexer: indexer} -} - -// List lists all VirtualClusterTemplates in the indexer. -func (s *virtualClusterTemplateLister) List(selector labels.Selector) (ret []*v1.VirtualClusterTemplate, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.VirtualClusterTemplate)) - }) - return ret, err -} - -// Get retrieves the VirtualClusterTemplate from the index for a given name. -func (s *virtualClusterTemplateLister) Get(name string) (*v1.VirtualClusterTemplate, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("virtualclustertemplate"), name) - } - return obj.(*v1.VirtualClusterTemplate), nil + return &virtualClusterTemplateLister{listers.New[*v1.VirtualClusterTemplate](indexer, v1.Resource("virtualclustertemplate"))} } diff --git a/pkg/listers/storage/v1/accesskey.go b/pkg/listers/storage/v1/accesskey.go index 63a46f3..0a7da2e 100644 --- a/pkg/listers/storage/v1/accesskey.go +++ b/pkg/listers/storage/v1/accesskey.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type AccessKeyLister interface { // accessKeyLister implements the AccessKeyLister interface. type accessKeyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.AccessKey] } // NewAccessKeyLister returns a new AccessKeyLister. func NewAccessKeyLister(indexer cache.Indexer) AccessKeyLister { - return &accessKeyLister{indexer: indexer} -} - -// List lists all AccessKeys in the indexer. -func (s *accessKeyLister) List(selector labels.Selector) (ret []*v1.AccessKey, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.AccessKey)) - }) - return ret, err -} - -// Get retrieves the AccessKey from the index for a given name. -func (s *accessKeyLister) Get(name string) (*v1.AccessKey, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("accesskey"), name) - } - return obj.(*v1.AccessKey), nil + return &accessKeyLister{listers.New[*v1.AccessKey](indexer, v1.Resource("accesskey"))} } diff --git a/pkg/listers/storage/v1/app.go b/pkg/listers/storage/v1/app.go index 62f85d0..97fc8c0 100644 --- a/pkg/listers/storage/v1/app.go +++ b/pkg/listers/storage/v1/app.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type AppLister interface { // appLister implements the AppLister interface. type appLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.App] } // NewAppLister returns a new AppLister. func NewAppLister(indexer cache.Indexer) AppLister { - return &appLister{indexer: indexer} -} - -// List lists all Apps in the indexer. -func (s *appLister) List(selector labels.Selector) (ret []*v1.App, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.App)) - }) - return ret, err -} - -// Get retrieves the App from the index for a given name. -func (s *appLister) Get(name string) (*v1.App, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("app"), name) - } - return obj.(*v1.App), nil + return &appLister{listers.New[*v1.App](indexer, v1.Resource("app"))} } diff --git a/pkg/listers/storage/v1/cluster.go b/pkg/listers/storage/v1/cluster.go index 7896dad..5199adb 100644 --- a/pkg/listers/storage/v1/cluster.go +++ b/pkg/listers/storage/v1/cluster.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type ClusterLister interface { // clusterLister implements the ClusterLister interface. type clusterLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Cluster] } // NewClusterLister returns a new ClusterLister. func NewClusterLister(indexer cache.Indexer) ClusterLister { - return &clusterLister{indexer: indexer} -} - -// List lists all Clusters in the indexer. -func (s *clusterLister) List(selector labels.Selector) (ret []*v1.Cluster, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Cluster)) - }) - return ret, err -} - -// Get retrieves the Cluster from the index for a given name. -func (s *clusterLister) Get(name string) (*v1.Cluster, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("cluster"), name) - } - return obj.(*v1.Cluster), nil + return &clusterLister{listers.New[*v1.Cluster](indexer, v1.Resource("cluster"))} } diff --git a/pkg/listers/storage/v1/clusteraccess.go b/pkg/listers/storage/v1/clusteraccess.go index 597c70b..5ad7a45 100644 --- a/pkg/listers/storage/v1/clusteraccess.go +++ b/pkg/listers/storage/v1/clusteraccess.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type ClusterAccessLister interface { // clusterAccessLister implements the ClusterAccessLister interface. type clusterAccessLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ClusterAccess] } // NewClusterAccessLister returns a new ClusterAccessLister. func NewClusterAccessLister(indexer cache.Indexer) ClusterAccessLister { - return &clusterAccessLister{indexer: indexer} -} - -// List lists all ClusterAccesses in the indexer. -func (s *clusterAccessLister) List(selector labels.Selector) (ret []*v1.ClusterAccess, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ClusterAccess)) - }) - return ret, err -} - -// Get retrieves the ClusterAccess from the index for a given name. -func (s *clusterAccessLister) Get(name string) (*v1.ClusterAccess, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("clusteraccess"), name) - } - return obj.(*v1.ClusterAccess), nil + return &clusterAccessLister{listers.New[*v1.ClusterAccess](indexer, v1.Resource("clusteraccess"))} } diff --git a/pkg/listers/storage/v1/clusterroletemplate.go b/pkg/listers/storage/v1/clusterroletemplate.go index 5274bc9..b91d7c8 100644 --- a/pkg/listers/storage/v1/clusterroletemplate.go +++ b/pkg/listers/storage/v1/clusterroletemplate.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type ClusterRoleTemplateLister interface { // clusterRoleTemplateLister implements the ClusterRoleTemplateLister interface. type clusterRoleTemplateLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ClusterRoleTemplate] } // NewClusterRoleTemplateLister returns a new ClusterRoleTemplateLister. func NewClusterRoleTemplateLister(indexer cache.Indexer) ClusterRoleTemplateLister { - return &clusterRoleTemplateLister{indexer: indexer} -} - -// List lists all ClusterRoleTemplates in the indexer. -func (s *clusterRoleTemplateLister) List(selector labels.Selector) (ret []*v1.ClusterRoleTemplate, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ClusterRoleTemplate)) - }) - return ret, err -} - -// Get retrieves the ClusterRoleTemplate from the index for a given name. -func (s *clusterRoleTemplateLister) Get(name string) (*v1.ClusterRoleTemplate, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("clusterroletemplate"), name) - } - return obj.(*v1.ClusterRoleTemplate), nil + return &clusterRoleTemplateLister{listers.New[*v1.ClusterRoleTemplate](indexer, v1.Resource("clusterroletemplate"))} } diff --git a/pkg/listers/storage/v1/devpodenvironmenttemplate.go b/pkg/listers/storage/v1/devpodenvironmenttemplate.go index e03a9a3..8e1b07c 100644 --- a/pkg/listers/storage/v1/devpodenvironmenttemplate.go +++ b/pkg/listers/storage/v1/devpodenvironmenttemplate.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type DevPodEnvironmentTemplateLister interface { // devPodEnvironmentTemplateLister implements the DevPodEnvironmentTemplateLister interface. type devPodEnvironmentTemplateLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.DevPodEnvironmentTemplate] } // NewDevPodEnvironmentTemplateLister returns a new DevPodEnvironmentTemplateLister. func NewDevPodEnvironmentTemplateLister(indexer cache.Indexer) DevPodEnvironmentTemplateLister { - return &devPodEnvironmentTemplateLister{indexer: indexer} -} - -// List lists all DevPodEnvironmentTemplates in the indexer. -func (s *devPodEnvironmentTemplateLister) List(selector labels.Selector) (ret []*v1.DevPodEnvironmentTemplate, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DevPodEnvironmentTemplate)) - }) - return ret, err -} - -// Get retrieves the DevPodEnvironmentTemplate from the index for a given name. -func (s *devPodEnvironmentTemplateLister) Get(name string) (*v1.DevPodEnvironmentTemplate, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("devpodenvironmenttemplate"), name) - } - return obj.(*v1.DevPodEnvironmentTemplate), nil + return &devPodEnvironmentTemplateLister{listers.New[*v1.DevPodEnvironmentTemplate](indexer, v1.Resource("devpodenvironmenttemplate"))} } diff --git a/pkg/listers/storage/v1/devpodworkspaceinstance.go b/pkg/listers/storage/v1/devpodworkspaceinstance.go index 27272f5..40b34ce 100644 --- a/pkg/listers/storage/v1/devpodworkspaceinstance.go +++ b/pkg/listers/storage/v1/devpodworkspaceinstance.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type DevPodWorkspaceInstanceLister interface { // devPodWorkspaceInstanceLister implements the DevPodWorkspaceInstanceLister interface. type devPodWorkspaceInstanceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.DevPodWorkspaceInstance] } // NewDevPodWorkspaceInstanceLister returns a new DevPodWorkspaceInstanceLister. func NewDevPodWorkspaceInstanceLister(indexer cache.Indexer) DevPodWorkspaceInstanceLister { - return &devPodWorkspaceInstanceLister{indexer: indexer} -} - -// List lists all DevPodWorkspaceInstances in the indexer. -func (s *devPodWorkspaceInstanceLister) List(selector labels.Selector) (ret []*v1.DevPodWorkspaceInstance, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DevPodWorkspaceInstance)) - }) - return ret, err + return &devPodWorkspaceInstanceLister{listers.New[*v1.DevPodWorkspaceInstance](indexer, v1.Resource("devpodworkspaceinstance"))} } // DevPodWorkspaceInstances returns an object that can list and get DevPodWorkspaceInstances. func (s *devPodWorkspaceInstanceLister) DevPodWorkspaceInstances(namespace string) DevPodWorkspaceInstanceNamespaceLister { - return devPodWorkspaceInstanceNamespaceLister{indexer: s.indexer, namespace: namespace} + return devPodWorkspaceInstanceNamespaceLister{listers.NewNamespaced[*v1.DevPodWorkspaceInstance](s.ResourceIndexer, namespace)} } // DevPodWorkspaceInstanceNamespaceLister helps list and get DevPodWorkspaceInstances. @@ -58,26 +50,5 @@ type DevPodWorkspaceInstanceNamespaceLister interface { // devPodWorkspaceInstanceNamespaceLister implements the DevPodWorkspaceInstanceNamespaceLister // interface. type devPodWorkspaceInstanceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all DevPodWorkspaceInstances in the indexer for a given namespace. -func (s devPodWorkspaceInstanceNamespaceLister) List(selector labels.Selector) (ret []*v1.DevPodWorkspaceInstance, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DevPodWorkspaceInstance)) - }) - return ret, err -} - -// Get retrieves the DevPodWorkspaceInstance from the indexer for a given namespace and name. -func (s devPodWorkspaceInstanceNamespaceLister) Get(name string) (*v1.DevPodWorkspaceInstance, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("devpodworkspaceinstance"), name) - } - return obj.(*v1.DevPodWorkspaceInstance), nil + listers.ResourceIndexer[*v1.DevPodWorkspaceInstance] } diff --git a/pkg/listers/storage/v1/devpodworkspacetemplate.go b/pkg/listers/storage/v1/devpodworkspacetemplate.go index ce7d280..9e146f4 100644 --- a/pkg/listers/storage/v1/devpodworkspacetemplate.go +++ b/pkg/listers/storage/v1/devpodworkspacetemplate.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type DevPodWorkspaceTemplateLister interface { // devPodWorkspaceTemplateLister implements the DevPodWorkspaceTemplateLister interface. type devPodWorkspaceTemplateLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.DevPodWorkspaceTemplate] } // NewDevPodWorkspaceTemplateLister returns a new DevPodWorkspaceTemplateLister. func NewDevPodWorkspaceTemplateLister(indexer cache.Indexer) DevPodWorkspaceTemplateLister { - return &devPodWorkspaceTemplateLister{indexer: indexer} -} - -// List lists all DevPodWorkspaceTemplates in the indexer. -func (s *devPodWorkspaceTemplateLister) List(selector labels.Selector) (ret []*v1.DevPodWorkspaceTemplate, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DevPodWorkspaceTemplate)) - }) - return ret, err -} - -// Get retrieves the DevPodWorkspaceTemplate from the index for a given name. -func (s *devPodWorkspaceTemplateLister) Get(name string) (*v1.DevPodWorkspaceTemplate, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("devpodworkspacetemplate"), name) - } - return obj.(*v1.DevPodWorkspaceTemplate), nil + return &devPodWorkspaceTemplateLister{listers.New[*v1.DevPodWorkspaceTemplate](indexer, v1.Resource("devpodworkspacetemplate"))} } diff --git a/pkg/listers/storage/v1/networkpeer.go b/pkg/listers/storage/v1/networkpeer.go index d22bbeb..a9c134d 100644 --- a/pkg/listers/storage/v1/networkpeer.go +++ b/pkg/listers/storage/v1/networkpeer.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type NetworkPeerLister interface { // networkPeerLister implements the NetworkPeerLister interface. type networkPeerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.NetworkPeer] } // NewNetworkPeerLister returns a new NetworkPeerLister. func NewNetworkPeerLister(indexer cache.Indexer) NetworkPeerLister { - return &networkPeerLister{indexer: indexer} -} - -// List lists all NetworkPeers in the indexer. -func (s *networkPeerLister) List(selector labels.Selector) (ret []*v1.NetworkPeer, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.NetworkPeer)) - }) - return ret, err -} - -// Get retrieves the NetworkPeer from the index for a given name. -func (s *networkPeerLister) Get(name string) (*v1.NetworkPeer, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("networkpeer"), name) - } - return obj.(*v1.NetworkPeer), nil + return &networkPeerLister{listers.New[*v1.NetworkPeer](indexer, v1.Resource("networkpeer"))} } diff --git a/pkg/listers/storage/v1/project.go b/pkg/listers/storage/v1/project.go index 306bfd5..090e420 100644 --- a/pkg/listers/storage/v1/project.go +++ b/pkg/listers/storage/v1/project.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type ProjectLister interface { // projectLister implements the ProjectLister interface. type projectLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Project] } // NewProjectLister returns a new ProjectLister. func NewProjectLister(indexer cache.Indexer) ProjectLister { - return &projectLister{indexer: indexer} -} - -// List lists all Projects in the indexer. -func (s *projectLister) List(selector labels.Selector) (ret []*v1.Project, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Project)) - }) - return ret, err -} - -// Get retrieves the Project from the index for a given name. -func (s *projectLister) Get(name string) (*v1.Project, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("project"), name) - } - return obj.(*v1.Project), nil + return &projectLister{listers.New[*v1.Project](indexer, v1.Resource("project"))} } diff --git a/pkg/listers/storage/v1/runner.go b/pkg/listers/storage/v1/runner.go index ab6fb01..3fc9ded 100644 --- a/pkg/listers/storage/v1/runner.go +++ b/pkg/listers/storage/v1/runner.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type RunnerLister interface { // runnerLister implements the RunnerLister interface. type runnerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Runner] } // NewRunnerLister returns a new RunnerLister. func NewRunnerLister(indexer cache.Indexer) RunnerLister { - return &runnerLister{indexer: indexer} -} - -// List lists all Runners in the indexer. -func (s *runnerLister) List(selector labels.Selector) (ret []*v1.Runner, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Runner)) - }) - return ret, err -} - -// Get retrieves the Runner from the index for a given name. -func (s *runnerLister) Get(name string) (*v1.Runner, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("runner"), name) - } - return obj.(*v1.Runner), nil + return &runnerLister{listers.New[*v1.Runner](indexer, v1.Resource("runner"))} } diff --git a/pkg/listers/storage/v1/sharedsecret.go b/pkg/listers/storage/v1/sharedsecret.go index 82c3109..528bc2d 100644 --- a/pkg/listers/storage/v1/sharedsecret.go +++ b/pkg/listers/storage/v1/sharedsecret.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type SharedSecretLister interface { // sharedSecretLister implements the SharedSecretLister interface. type sharedSecretLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.SharedSecret] } // NewSharedSecretLister returns a new SharedSecretLister. func NewSharedSecretLister(indexer cache.Indexer) SharedSecretLister { - return &sharedSecretLister{indexer: indexer} -} - -// List lists all SharedSecrets in the indexer. -func (s *sharedSecretLister) List(selector labels.Selector) (ret []*v1.SharedSecret, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SharedSecret)) - }) - return ret, err + return &sharedSecretLister{listers.New[*v1.SharedSecret](indexer, v1.Resource("sharedsecret"))} } // SharedSecrets returns an object that can list and get SharedSecrets. func (s *sharedSecretLister) SharedSecrets(namespace string) SharedSecretNamespaceLister { - return sharedSecretNamespaceLister{indexer: s.indexer, namespace: namespace} + return sharedSecretNamespaceLister{listers.NewNamespaced[*v1.SharedSecret](s.ResourceIndexer, namespace)} } // SharedSecretNamespaceLister helps list and get SharedSecrets. @@ -58,26 +50,5 @@ type SharedSecretNamespaceLister interface { // sharedSecretNamespaceLister implements the SharedSecretNamespaceLister // interface. type sharedSecretNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all SharedSecrets in the indexer for a given namespace. -func (s sharedSecretNamespaceLister) List(selector labels.Selector) (ret []*v1.SharedSecret, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SharedSecret)) - }) - return ret, err -} - -// Get retrieves the SharedSecret from the indexer for a given namespace and name. -func (s sharedSecretNamespaceLister) Get(name string) (*v1.SharedSecret, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("sharedsecret"), name) - } - return obj.(*v1.SharedSecret), nil + listers.ResourceIndexer[*v1.SharedSecret] } diff --git a/pkg/listers/storage/v1/spaceinstance.go b/pkg/listers/storage/v1/spaceinstance.go index b49ec04..4a3b181 100644 --- a/pkg/listers/storage/v1/spaceinstance.go +++ b/pkg/listers/storage/v1/spaceinstance.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type SpaceInstanceLister interface { // spaceInstanceLister implements the SpaceInstanceLister interface. type spaceInstanceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.SpaceInstance] } // NewSpaceInstanceLister returns a new SpaceInstanceLister. func NewSpaceInstanceLister(indexer cache.Indexer) SpaceInstanceLister { - return &spaceInstanceLister{indexer: indexer} -} - -// List lists all SpaceInstances in the indexer. -func (s *spaceInstanceLister) List(selector labels.Selector) (ret []*v1.SpaceInstance, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SpaceInstance)) - }) - return ret, err + return &spaceInstanceLister{listers.New[*v1.SpaceInstance](indexer, v1.Resource("spaceinstance"))} } // SpaceInstances returns an object that can list and get SpaceInstances. func (s *spaceInstanceLister) SpaceInstances(namespace string) SpaceInstanceNamespaceLister { - return spaceInstanceNamespaceLister{indexer: s.indexer, namespace: namespace} + return spaceInstanceNamespaceLister{listers.NewNamespaced[*v1.SpaceInstance](s.ResourceIndexer, namespace)} } // SpaceInstanceNamespaceLister helps list and get SpaceInstances. @@ -58,26 +50,5 @@ type SpaceInstanceNamespaceLister interface { // spaceInstanceNamespaceLister implements the SpaceInstanceNamespaceLister // interface. type spaceInstanceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all SpaceInstances in the indexer for a given namespace. -func (s spaceInstanceNamespaceLister) List(selector labels.Selector) (ret []*v1.SpaceInstance, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SpaceInstance)) - }) - return ret, err -} - -// Get retrieves the SpaceInstance from the indexer for a given namespace and name. -func (s spaceInstanceNamespaceLister) Get(name string) (*v1.SpaceInstance, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("spaceinstance"), name) - } - return obj.(*v1.SpaceInstance), nil + listers.ResourceIndexer[*v1.SpaceInstance] } diff --git a/pkg/listers/storage/v1/spacetemplate.go b/pkg/listers/storage/v1/spacetemplate.go index 5e3cf8d..aa7d44b 100644 --- a/pkg/listers/storage/v1/spacetemplate.go +++ b/pkg/listers/storage/v1/spacetemplate.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type SpaceTemplateLister interface { // spaceTemplateLister implements the SpaceTemplateLister interface. type spaceTemplateLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.SpaceTemplate] } // NewSpaceTemplateLister returns a new SpaceTemplateLister. func NewSpaceTemplateLister(indexer cache.Indexer) SpaceTemplateLister { - return &spaceTemplateLister{indexer: indexer} -} - -// List lists all SpaceTemplates in the indexer. -func (s *spaceTemplateLister) List(selector labels.Selector) (ret []*v1.SpaceTemplate, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.SpaceTemplate)) - }) - return ret, err -} - -// Get retrieves the SpaceTemplate from the index for a given name. -func (s *spaceTemplateLister) Get(name string) (*v1.SpaceTemplate, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("spacetemplate"), name) - } - return obj.(*v1.SpaceTemplate), nil + return &spaceTemplateLister{listers.New[*v1.SpaceTemplate](indexer, v1.Resource("spacetemplate"))} } diff --git a/pkg/listers/storage/v1/task.go b/pkg/listers/storage/v1/task.go index f6f7fde..03d0fdb 100644 --- a/pkg/listers/storage/v1/task.go +++ b/pkg/listers/storage/v1/task.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type TaskLister interface { // taskLister implements the TaskLister interface. type taskLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Task] } // NewTaskLister returns a new TaskLister. func NewTaskLister(indexer cache.Indexer) TaskLister { - return &taskLister{indexer: indexer} -} - -// List lists all Tasks in the indexer. -func (s *taskLister) List(selector labels.Selector) (ret []*v1.Task, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Task)) - }) - return ret, err -} - -// Get retrieves the Task from the index for a given name. -func (s *taskLister) Get(name string) (*v1.Task, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("task"), name) - } - return obj.(*v1.Task), nil + return &taskLister{listers.New[*v1.Task](indexer, v1.Resource("task"))} } diff --git a/pkg/listers/storage/v1/team.go b/pkg/listers/storage/v1/team.go index 4319d5b..f144ab5 100644 --- a/pkg/listers/storage/v1/team.go +++ b/pkg/listers/storage/v1/team.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type TeamLister interface { // teamLister implements the TeamLister interface. type teamLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Team] } // NewTeamLister returns a new TeamLister. func NewTeamLister(indexer cache.Indexer) TeamLister { - return &teamLister{indexer: indexer} -} - -// List lists all Teams in the indexer. -func (s *teamLister) List(selector labels.Selector) (ret []*v1.Team, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Team)) - }) - return ret, err -} - -// Get retrieves the Team from the index for a given name. -func (s *teamLister) Get(name string) (*v1.Team, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("team"), name) - } - return obj.(*v1.Team), nil + return &teamLister{listers.New[*v1.Team](indexer, v1.Resource("team"))} } diff --git a/pkg/listers/storage/v1/user.go b/pkg/listers/storage/v1/user.go index 5b7b1ae..026fce1 100644 --- a/pkg/listers/storage/v1/user.go +++ b/pkg/listers/storage/v1/user.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type UserLister interface { // userLister implements the UserLister interface. type userLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.User] } // NewUserLister returns a new UserLister. func NewUserLister(indexer cache.Indexer) UserLister { - return &userLister{indexer: indexer} -} - -// List lists all Users in the indexer. -func (s *userLister) List(selector labels.Selector) (ret []*v1.User, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.User)) - }) - return ret, err -} - -// Get retrieves the User from the index for a given name. -func (s *userLister) Get(name string) (*v1.User, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("user"), name) - } - return obj.(*v1.User), nil + return &userLister{listers.New[*v1.User](indexer, v1.Resource("user"))} } diff --git a/pkg/listers/storage/v1/virtualclusterinstance.go b/pkg/listers/storage/v1/virtualclusterinstance.go index c2eacc0..a801501 100644 --- a/pkg/listers/storage/v1/virtualclusterinstance.go +++ b/pkg/listers/storage/v1/virtualclusterinstance.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type VirtualClusterInstanceLister interface { // virtualClusterInstanceLister implements the VirtualClusterInstanceLister interface. type virtualClusterInstanceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.VirtualClusterInstance] } // NewVirtualClusterInstanceLister returns a new VirtualClusterInstanceLister. func NewVirtualClusterInstanceLister(indexer cache.Indexer) VirtualClusterInstanceLister { - return &virtualClusterInstanceLister{indexer: indexer} -} - -// List lists all VirtualClusterInstances in the indexer. -func (s *virtualClusterInstanceLister) List(selector labels.Selector) (ret []*v1.VirtualClusterInstance, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.VirtualClusterInstance)) - }) - return ret, err + return &virtualClusterInstanceLister{listers.New[*v1.VirtualClusterInstance](indexer, v1.Resource("virtualclusterinstance"))} } // VirtualClusterInstances returns an object that can list and get VirtualClusterInstances. func (s *virtualClusterInstanceLister) VirtualClusterInstances(namespace string) VirtualClusterInstanceNamespaceLister { - return virtualClusterInstanceNamespaceLister{indexer: s.indexer, namespace: namespace} + return virtualClusterInstanceNamespaceLister{listers.NewNamespaced[*v1.VirtualClusterInstance](s.ResourceIndexer, namespace)} } // VirtualClusterInstanceNamespaceLister helps list and get VirtualClusterInstances. @@ -58,26 +50,5 @@ type VirtualClusterInstanceNamespaceLister interface { // virtualClusterInstanceNamespaceLister implements the VirtualClusterInstanceNamespaceLister // interface. type virtualClusterInstanceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VirtualClusterInstances in the indexer for a given namespace. -func (s virtualClusterInstanceNamespaceLister) List(selector labels.Selector) (ret []*v1.VirtualClusterInstance, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.VirtualClusterInstance)) - }) - return ret, err -} - -// Get retrieves the VirtualClusterInstance from the indexer for a given namespace and name. -func (s virtualClusterInstanceNamespaceLister) Get(name string) (*v1.VirtualClusterInstance, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("virtualclusterinstance"), name) - } - return obj.(*v1.VirtualClusterInstance), nil + listers.ResourceIndexer[*v1.VirtualClusterInstance] } diff --git a/pkg/listers/storage/v1/virtualclustertemplate.go b/pkg/listers/storage/v1/virtualclustertemplate.go index 35b9823..582dc79 100644 --- a/pkg/listers/storage/v1/virtualclustertemplate.go +++ b/pkg/listers/storage/v1/virtualclustertemplate.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -23,30 +23,10 @@ type VirtualClusterTemplateLister interface { // virtualClusterTemplateLister implements the VirtualClusterTemplateLister interface. type virtualClusterTemplateLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.VirtualClusterTemplate] } // NewVirtualClusterTemplateLister returns a new VirtualClusterTemplateLister. func NewVirtualClusterTemplateLister(indexer cache.Indexer) VirtualClusterTemplateLister { - return &virtualClusterTemplateLister{indexer: indexer} -} - -// List lists all VirtualClusterTemplates in the indexer. -func (s *virtualClusterTemplateLister) List(selector labels.Selector) (ret []*v1.VirtualClusterTemplate, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.VirtualClusterTemplate)) - }) - return ret, err -} - -// Get retrieves the VirtualClusterTemplate from the index for a given name. -func (s *virtualClusterTemplateLister) Get(name string) (*v1.VirtualClusterTemplate, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("virtualclustertemplate"), name) - } - return obj.(*v1.VirtualClusterTemplate), nil + return &virtualClusterTemplateLister{listers.New[*v1.VirtualClusterTemplate](indexer, v1.Resource("virtualclustertemplate"))} } diff --git a/pkg/listers/virtualcluster/v1/helmrelease.go b/pkg/listers/virtualcluster/v1/helmrelease.go index b13eaf2..580cf5e 100644 --- a/pkg/listers/virtualcluster/v1/helmrelease.go +++ b/pkg/listers/virtualcluster/v1/helmrelease.go @@ -4,8 +4,8 @@ package v1 import ( v1 "github.com/loft-sh/api/v4/pkg/apis/virtualcluster/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -22,25 +22,17 @@ type HelmReleaseLister interface { // helmReleaseLister implements the HelmReleaseLister interface. type helmReleaseLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.HelmRelease] } // NewHelmReleaseLister returns a new HelmReleaseLister. func NewHelmReleaseLister(indexer cache.Indexer) HelmReleaseLister { - return &helmReleaseLister{indexer: indexer} -} - -// List lists all HelmReleases in the indexer. -func (s *helmReleaseLister) List(selector labels.Selector) (ret []*v1.HelmRelease, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.HelmRelease)) - }) - return ret, err + return &helmReleaseLister{listers.New[*v1.HelmRelease](indexer, v1.Resource("helmrelease"))} } // HelmReleases returns an object that can list and get HelmReleases. func (s *helmReleaseLister) HelmReleases(namespace string) HelmReleaseNamespaceLister { - return helmReleaseNamespaceLister{indexer: s.indexer, namespace: namespace} + return helmReleaseNamespaceLister{listers.NewNamespaced[*v1.HelmRelease](s.ResourceIndexer, namespace)} } // HelmReleaseNamespaceLister helps list and get HelmReleases. @@ -58,26 +50,5 @@ type HelmReleaseNamespaceLister interface { // helmReleaseNamespaceLister implements the HelmReleaseNamespaceLister // interface. type helmReleaseNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all HelmReleases in the indexer for a given namespace. -func (s helmReleaseNamespaceLister) List(selector labels.Selector) (ret []*v1.HelmRelease, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.HelmRelease)) - }) - return ret, err -} - -// Get retrieves the HelmRelease from the indexer for a given namespace and name. -func (s helmReleaseNamespaceLister) Get(name string) (*v1.HelmRelease, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("helmrelease"), name) - } - return obj.(*v1.HelmRelease), nil + listers.ResourceIndexer[*v1.HelmRelease] } diff --git a/pkg/openapi/zz_generated.openapi.go b/pkg/openapi/zz_generated.openapi.go index 512ec01..a60f689 100644 --- a/pkg/openapi/zz_generated.openapi.go +++ b/pkg/openapi/zz_generated.openapi.go @@ -6,8 +6,9 @@ package openapi import ( + v1 "k8s.io/api/core/v1" resource "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" intstr "k8s.io/apimachinery/pkg/util/intstr" common "k8s.io/kube-openapi/pkg/common" spec "k8s.io/kube-openapi/pkg/validation/spec" @@ -562,22 +563,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/virtualcluster/v1.HelmReleaseList": schema_pkg_apis_virtualcluster_v1_HelmReleaseList(ref), "github.com/loft-sh/api/v4/pkg/apis/virtualcluster/v1.HelmReleaseSpec": schema_pkg_apis_virtualcluster_v1_HelmReleaseSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/virtualcluster/v1.HelmReleaseStatus": schema_pkg_apis_virtualcluster_v1_HelmReleaseStatus(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.Condition": schema_pkg_apis_policy_v1beta1_Condition(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicy": schema_pkg_apis_policy_v1beta1_JsPolicy(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyBundle": schema_pkg_apis_policy_v1beta1_JsPolicyBundle(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyBundleList": schema_pkg_apis_policy_v1beta1_JsPolicyBundleList(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyBundleSpec": schema_pkg_apis_policy_v1beta1_JsPolicyBundleSpec(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyBundleStatus": schema_pkg_apis_policy_v1beta1_JsPolicyBundleStatus(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyList": schema_pkg_apis_policy_v1beta1_JsPolicyList(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicySpec": schema_pkg_apis_policy_v1beta1_JsPolicySpec(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyStatus": schema_pkg_apis_policy_v1beta1_JsPolicyStatus(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyViolations": schema_pkg_apis_policy_v1beta1_JsPolicyViolations(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyViolationsList": schema_pkg_apis_policy_v1beta1_JsPolicyViolationsList(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyViolationsSpec": schema_pkg_apis_policy_v1beta1_JsPolicyViolationsSpec(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyViolationsStatus": schema_pkg_apis_policy_v1beta1_JsPolicyViolationsStatus(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.PolicyViolation": schema_pkg_apis_policy_v1beta1_PolicyViolation(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.RequestInfo": schema_pkg_apis_policy_v1beta1_RequestInfo(ref), - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.UserInfo": schema_pkg_apis_policy_v1beta1_UserInfo(ref), "k8s.io/api/admissionregistration/v1.AuditAnnotation": schema_k8sio_api_admissionregistration_v1_AuditAnnotation(ref), "k8s.io/api/admissionregistration/v1.ExpressionWarning": schema_k8sio_api_admissionregistration_v1_ExpressionWarning(ref), "k8s.io/api/admissionregistration/v1.MatchCondition": schema_k8sio_api_admissionregistration_v1_MatchCondition(ref), @@ -732,6 +717,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/authentication/v1beta1.TokenReviewSpec": schema_k8sio_api_authentication_v1beta1_TokenReviewSpec(ref), "k8s.io/api/authentication/v1beta1.TokenReviewStatus": schema_k8sio_api_authentication_v1beta1_TokenReviewStatus(ref), "k8s.io/api/authentication/v1beta1.UserInfo": schema_k8sio_api_authentication_v1beta1_UserInfo(ref), + "k8s.io/api/authorization/v1.FieldSelectorAttributes": schema_k8sio_api_authorization_v1_FieldSelectorAttributes(ref), + "k8s.io/api/authorization/v1.LabelSelectorAttributes": schema_k8sio_api_authorization_v1_LabelSelectorAttributes(ref), "k8s.io/api/authorization/v1.LocalSubjectAccessReview": schema_k8sio_api_authorization_v1_LocalSubjectAccessReview(ref), "k8s.io/api/authorization/v1.NonResourceAttributes": schema_k8sio_api_authorization_v1_NonResourceAttributes(ref), "k8s.io/api/authorization/v1.NonResourceRule": schema_k8sio_api_authorization_v1_NonResourceRule(ref), @@ -870,7 +857,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.CephFSVolumeSource": schema_k8sio_api_core_v1_CephFSVolumeSource(ref), "k8s.io/api/core/v1.CinderPersistentVolumeSource": schema_k8sio_api_core_v1_CinderPersistentVolumeSource(ref), "k8s.io/api/core/v1.CinderVolumeSource": schema_k8sio_api_core_v1_CinderVolumeSource(ref), - "k8s.io/api/core/v1.ClaimSource": schema_k8sio_api_core_v1_ClaimSource(ref), "k8s.io/api/core/v1.ClientIPConfig": schema_k8sio_api_core_v1_ClientIPConfig(ref), "k8s.io/api/core/v1.ClusterTrustBundleProjection": schema_k8sio_api_core_v1_ClusterTrustBundleProjection(ref), "k8s.io/api/core/v1.ComponentCondition": schema_k8sio_api_core_v1_ComponentCondition(ref), @@ -892,6 +878,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.ContainerStateTerminated": schema_k8sio_api_core_v1_ContainerStateTerminated(ref), "k8s.io/api/core/v1.ContainerStateWaiting": schema_k8sio_api_core_v1_ContainerStateWaiting(ref), "k8s.io/api/core/v1.ContainerStatus": schema_k8sio_api_core_v1_ContainerStatus(ref), + "k8s.io/api/core/v1.ContainerUser": schema_k8sio_api_core_v1_ContainerUser(ref), "k8s.io/api/core/v1.DaemonEndpoint": schema_k8sio_api_core_v1_DaemonEndpoint(ref), "k8s.io/api/core/v1.DownwardAPIProjection": schema_k8sio_api_core_v1_DownwardAPIProjection(ref), "k8s.io/api/core/v1.DownwardAPIVolumeFile": schema_k8sio_api_core_v1_DownwardAPIVolumeFile(ref), @@ -929,6 +916,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.HostPathVolumeSource": schema_k8sio_api_core_v1_HostPathVolumeSource(ref), "k8s.io/api/core/v1.ISCSIPersistentVolumeSource": schema_k8sio_api_core_v1_ISCSIPersistentVolumeSource(ref), "k8s.io/api/core/v1.ISCSIVolumeSource": schema_k8sio_api_core_v1_ISCSIVolumeSource(ref), + "k8s.io/api/core/v1.ImageVolumeSource": schema_k8sio_api_core_v1_ImageVolumeSource(ref), "k8s.io/api/core/v1.KeyToPath": schema_k8sio_api_core_v1_KeyToPath(ref), "k8s.io/api/core/v1.Lifecycle": schema_k8sio_api_core_v1_Lifecycle(ref), "k8s.io/api/core/v1.LifecycleHandler": schema_k8sio_api_core_v1_LifecycleHandler(ref), @@ -936,6 +924,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.LimitRangeItem": schema_k8sio_api_core_v1_LimitRangeItem(ref), "k8s.io/api/core/v1.LimitRangeList": schema_k8sio_api_core_v1_LimitRangeList(ref), "k8s.io/api/core/v1.LimitRangeSpec": schema_k8sio_api_core_v1_LimitRangeSpec(ref), + "k8s.io/api/core/v1.LinuxContainerUser": schema_k8sio_api_core_v1_LinuxContainerUser(ref), "k8s.io/api/core/v1.List": schema_k8sio_api_core_v1_List(ref), "k8s.io/api/core/v1.LoadBalancerIngress": schema_k8sio_api_core_v1_LoadBalancerIngress(ref), "k8s.io/api/core/v1.LoadBalancerStatus": schema_k8sio_api_core_v1_LoadBalancerStatus(ref), @@ -955,6 +944,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.NodeConfigSource": schema_k8sio_api_core_v1_NodeConfigSource(ref), "k8s.io/api/core/v1.NodeConfigStatus": schema_k8sio_api_core_v1_NodeConfigStatus(ref), "k8s.io/api/core/v1.NodeDaemonEndpoints": schema_k8sio_api_core_v1_NodeDaemonEndpoints(ref), + "k8s.io/api/core/v1.NodeFeatures": schema_k8sio_api_core_v1_NodeFeatures(ref), "k8s.io/api/core/v1.NodeList": schema_k8sio_api_core_v1_NodeList(ref), "k8s.io/api/core/v1.NodeProxyOptions": schema_k8sio_api_core_v1_NodeProxyOptions(ref), "k8s.io/api/core/v1.NodeRuntimeHandler": schema_k8sio_api_core_v1_NodeRuntimeHandler(ref), @@ -1025,11 +1015,13 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.ReplicationControllerStatus": schema_k8sio_api_core_v1_ReplicationControllerStatus(ref), "k8s.io/api/core/v1.ResourceClaim": schema_k8sio_api_core_v1_ResourceClaim(ref), "k8s.io/api/core/v1.ResourceFieldSelector": schema_k8sio_api_core_v1_ResourceFieldSelector(ref), + "k8s.io/api/core/v1.ResourceHealth": schema_k8sio_api_core_v1_ResourceHealth(ref), "k8s.io/api/core/v1.ResourceQuota": schema_k8sio_api_core_v1_ResourceQuota(ref), "k8s.io/api/core/v1.ResourceQuotaList": schema_k8sio_api_core_v1_ResourceQuotaList(ref), "k8s.io/api/core/v1.ResourceQuotaSpec": schema_k8sio_api_core_v1_ResourceQuotaSpec(ref), "k8s.io/api/core/v1.ResourceQuotaStatus": schema_k8sio_api_core_v1_ResourceQuotaStatus(ref), "k8s.io/api/core/v1.ResourceRequirements": schema_k8sio_api_core_v1_ResourceRequirements(ref), + "k8s.io/api/core/v1.ResourceStatus": schema_k8sio_api_core_v1_ResourceStatus(ref), "k8s.io/api/core/v1.SELinuxOptions": schema_k8sio_api_core_v1_SELinuxOptions(ref), "k8s.io/api/core/v1.ScaleIOPersistentVolumeSource": schema_k8sio_api_core_v1_ScaleIOPersistentVolumeSource(ref), "k8s.io/api/core/v1.ScaleIOVolumeSource": schema_k8sio_api_core_v1_ScaleIOVolumeSource(ref), @@ -1155,6 +1147,9 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/networking/v1.ServiceBackendPort": schema_k8sio_api_networking_v1_ServiceBackendPort(ref), "k8s.io/api/networking/v1beta1.HTTPIngressPath": schema_k8sio_api_networking_v1beta1_HTTPIngressPath(ref), "k8s.io/api/networking/v1beta1.HTTPIngressRuleValue": schema_k8sio_api_networking_v1beta1_HTTPIngressRuleValue(ref), + "k8s.io/api/networking/v1beta1.IPAddress": schema_k8sio_api_networking_v1beta1_IPAddress(ref), + "k8s.io/api/networking/v1beta1.IPAddressList": schema_k8sio_api_networking_v1beta1_IPAddressList(ref), + "k8s.io/api/networking/v1beta1.IPAddressSpec": schema_k8sio_api_networking_v1beta1_IPAddressSpec(ref), "k8s.io/api/networking/v1beta1.Ingress": schema_k8sio_api_networking_v1beta1_Ingress(ref), "k8s.io/api/networking/v1beta1.IngressBackend": schema_k8sio_api_networking_v1beta1_IngressBackend(ref), "k8s.io/api/networking/v1beta1.IngressClass": schema_k8sio_api_networking_v1beta1_IngressClass(ref), @@ -1170,6 +1165,11 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/networking/v1beta1.IngressSpec": schema_k8sio_api_networking_v1beta1_IngressSpec(ref), "k8s.io/api/networking/v1beta1.IngressStatus": schema_k8sio_api_networking_v1beta1_IngressStatus(ref), "k8s.io/api/networking/v1beta1.IngressTLS": schema_k8sio_api_networking_v1beta1_IngressTLS(ref), + "k8s.io/api/networking/v1beta1.ParentReference": schema_k8sio_api_networking_v1beta1_ParentReference(ref), + "k8s.io/api/networking/v1beta1.ServiceCIDR": schema_k8sio_api_networking_v1beta1_ServiceCIDR(ref), + "k8s.io/api/networking/v1beta1.ServiceCIDRList": schema_k8sio_api_networking_v1beta1_ServiceCIDRList(ref), + "k8s.io/api/networking/v1beta1.ServiceCIDRSpec": schema_k8sio_api_networking_v1beta1_ServiceCIDRSpec(ref), + "k8s.io/api/networking/v1beta1.ServiceCIDRStatus": schema_k8sio_api_networking_v1beta1_ServiceCIDRStatus(ref), "k8s.io/api/node/v1alpha1.Overhead": schema_k8sio_api_node_v1alpha1_Overhead(ref), "k8s.io/api/node/v1alpha1.RuntimeClass": schema_k8sio_api_node_v1alpha1_RuntimeClass(ref), "k8s.io/api/node/v1alpha1.RuntimeClassList": schema_k8sio_api_node_v1alpha1_RuntimeClassList(ref), @@ -1272,6 +1272,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/storage/v1beta1.VolumeAttachmentSource": schema_k8sio_api_storage_v1beta1_VolumeAttachmentSource(ref), "k8s.io/api/storage/v1beta1.VolumeAttachmentSpec": schema_k8sio_api_storage_v1beta1_VolumeAttachmentSpec(ref), "k8s.io/api/storage/v1beta1.VolumeAttachmentStatus": schema_k8sio_api_storage_v1beta1_VolumeAttachmentStatus(ref), + "k8s.io/api/storage/v1beta1.VolumeAttributesClass": schema_k8sio_api_storage_v1beta1_VolumeAttributesClass(ref), + "k8s.io/api/storage/v1beta1.VolumeAttributesClassList": schema_k8sio_api_storage_v1beta1_VolumeAttributesClassList(ref), "k8s.io/api/storage/v1beta1.VolumeError": schema_k8sio_api_storage_v1beta1_VolumeError(ref), "k8s.io/api/storage/v1beta1.VolumeNodeResources": schema_k8sio_api_storage_v1beta1_VolumeNodeResources(ref), "k8s.io/apimachinery/pkg/api/resource.Quantity": schema_apimachinery_pkg_api_resource_Quantity(ref), @@ -1286,6 +1288,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldSelectorRequirement": schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), @@ -9462,6 +9465,13 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceSpec(ref common.Refere }, }, }, + "preventWakeUpOnConnection": { + SchemaProps: spec.SchemaProps{ + Description: "PreventWakeUpOnConnection is used to prevent workspace that uses sleep mode from waking up on incomming ssh connection.", + Type: []string{"boolean"}, + Format: "", + }, + }, }, }, }, @@ -21862,6 +21872,13 @@ func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceSpec(ref common.Reference }, }, }, + "preventWakeUpOnConnection": { + SchemaProps: spec.SchemaProps{ + Description: "PreventWakeUpOnConnection is used to prevent workspace that uses sleep mode from waking up on incomming ssh connection.", + Type: []string{"boolean"}, + Format: "", + }, + }, }, }, }, @@ -22168,6 +22185,13 @@ func schema_pkg_apis_storage_v1_DevPodWorkspaceTemplateDefinition(ref common.Ref Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.CredentialForwarding"), }, }, + "preventWakeUpOnConnection": { + SchemaProps: spec.SchemaProps{ + Description: "PreventWakeUpOnConnection is used to prevent workspace that uses sleep mode from waking up on incomming ssh connection.", + Type: []string{"boolean"}, + Format: "", + }, + }, }, Required: []string{"provider"}, }, @@ -28569,712 +28593,7 @@ func schema_pkg_apis_virtualcluster_v1_HelmReleaseList(ref common.ReferenceCallb Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/virtualcluster/v1.HelmRelease"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/virtualcluster/v1.HelmRelease", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_virtualcluster_v1_HelmReleaseSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "chart": { - SchemaProps: spec.SchemaProps{ - Description: "Chart holds information about a chart that should get deployed", - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Chart"), - }, - }, - "manifests": { - SchemaProps: spec.SchemaProps{ - Description: "Manifests holds kube manifests that will be deployed as a chart", - Type: []string{"string"}, - Format: "", - }, - }, - "bash": { - SchemaProps: spec.SchemaProps{ - Description: "Bash holds the bash script to execute in a container in the target", - Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Bash"), - }, - }, - "values": { - SchemaProps: spec.SchemaProps{ - Description: "Values is the set of extra Values added to the chart. These values merge with the default values inside of the chart. You can use golang templating in here with values from parameters.", - Type: []string{"string"}, - Format: "", - }, - }, - "parameters": { - SchemaProps: spec.SchemaProps{ - Description: "Parameters are additional helm chart values that will get merged with config and are then used to deploy the helm chart.", - Type: []string{"string"}, - Format: "", - }, - }, - "annotations": { - SchemaProps: spec.SchemaProps{ - Description: "Annotations are extra annotations for this helm release", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Bash", "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Chart"}, - } -} - -func schema_pkg_apis_virtualcluster_v1_HelmReleaseStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "version": { - SchemaProps: spec.SchemaProps{ - Description: "Revision is an int which represents the revision of the release.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "info": { - SchemaProps: spec.SchemaProps{ - Description: "Info provides information about a release", - Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Info"), - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Metadata provides information about a chart", - Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Metadata"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Info", "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Metadata"}, - } -} - -func schema_pkg_apis_policy_v1beta1_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Condition defines an observation of a Cluster API resource operational state.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of condition in CamelCase or in foo.example.com/CamelCase. Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "severity": { - SchemaProps: spec.SchemaProps{ - Description: "Severity provides an explicit classification of Reason code, so the users or machines can immediately understand the current situation and act accordingly. The Severity field MUST be set only when Status=False.", - Type: []string{"string"}, - Format: "", - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "The reason for the condition's last transition in CamelCase. The specific API may choose whether this field is considered a guaranteed API. This field may not be empty.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human readable message indicating details about the transition. This field may be empty.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status", "lastTransitionTime"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_policy_v1beta1_JsPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JsPolicy holds the webhook configuration", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicySpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicySpec", "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_policy_v1beta1_JsPolicyBundle(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JsPolicyBundle holds the bundled payload", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyBundleSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyBundleStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyBundleSpec", "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyBundleStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_policy_v1beta1_JsPolicyBundleList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JsPolicyBundleList contains a list of JsPolicyBundle", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyBundle"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyBundle", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_policy_v1beta1_JsPolicyBundleSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "bundle": { - SchemaProps: spec.SchemaProps{ - Description: "Bundle holds the bundled payload (including dependencies and minified javascript code)", - Type: []string{"string"}, - Format: "byte", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_policy_v1beta1_JsPolicyBundleStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - }, - }, - } -} - -func schema_pkg_apis_policy_v1beta1_JsPolicyList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JsPolicyList contains a list of JsPolicy", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicy"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicy", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_policy_v1beta1_JsPolicySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "operations": { - SchemaProps: spec.SchemaProps{ - Description: "Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"*", "CONNECT", "CREATE", "DELETE", "UPDATE"}, - }, - }, - }, - }, - }, - "resources": { - SchemaProps: spec.SchemaProps{ - Description: "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "apiGroups": { - SchemaProps: spec.SchemaProps{ - Description: "APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "apiVersions": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "scope": { - SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, - }, - }, - "failurePolicy": { - SchemaProps: spec.SchemaProps{ - Description: "FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail.\n\nPossible enum values:\n - `\"Fail\"` means that an error calling the webhook causes the admission to fail.\n - `\"Ignore\"` means that an error calling the webhook is ignored.", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"Fail", "Ignore"}, - }, - }, - "matchPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "matchPolicy defines how the \"rules\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\".\n\n- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.\n\n- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.\n\nDefaults to \"Equivalent\"\n\nPossible enum values:\n - `\"Equivalent\"` means requests should be sent to the webhook if they modify a resource listed in rules via another API group or version.\n - `\"Exact\"` means requests should only be sent to the webhook if they exactly match a given rule.", - Type: []string{"string"}, - Format: "", - Enum: []interface{}{"Equivalent", "Exact"}, - }, - }, - "namespaceSelector": { - SchemaProps: spec.SchemaProps{ - Description: "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), - }, - }, - "objectSelector": { - SchemaProps: spec.SchemaProps{ - Description: "ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), - }, - }, - "timeoutSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "violationPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Violation policy describes how violations should be handled. You can either specify deny (which is the default), warn or dry.", - Type: []string{"string"}, - Format: "", - }, - }, - "auditPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "AuditPolicy defines if violations should be logged to the webhook status or not. By default, violations will be logged to the CRD status.", - Type: []string{"string"}, - Format: "", - }, - }, - "auditLogSize": { - SchemaProps: spec.SchemaProps{ - Description: "AuditLogSize defines how many violations should be logged in the status. Defaults to 10", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type defines what kind of policy the object represents. Valid values are Validating, Mutating and Controller. Defaults to Validating.", - Type: []string{"string"}, - Format: "", - }, - }, - "dependencies": { - SchemaProps: spec.SchemaProps{ - Description: "Dependencies is a map of npm modules this webhook should be bundled with", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "javascript": { - SchemaProps: spec.SchemaProps{ - Description: "JavaScript is the payload of the webhook that will be executed. If this is not defined, jsPolicy expects the user to create a JsPolicyBundle for this policy.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, - } -} - -func schema_pkg_apis_policy_v1beta1_JsPolicyStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "Phase describes how the syncing status of the webhook is", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "Reason holds the error in machine-readable language if the webhook is in a failed state", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Message describes the error in human-readable language if the webhook is in a failed state", - Type: []string{"string"}, - Format: "", - }, - }, - "conditions": { - SchemaProps: spec.SchemaProps{ - Description: "Conditions holds several conditions the virtual cluster might be in", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.Condition"), - }, - }, - }, - }, - }, - "observedGeneration": { - SchemaProps: spec.SchemaProps{ - Description: "ObservedGeneration is the latest generation observed by the controller.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "bundleHash": { - SchemaProps: spec.SchemaProps{ - Description: "BundleHash is used to determine if we have to re-bundle the javascript", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.Condition"}, - } -} - -func schema_pkg_apis_policy_v1beta1_JsPolicyViolations(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JsPolicyViolations holds the webhook configuration", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyViolationsSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyViolationsStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyViolationsSpec", "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyViolationsStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_policy_v1beta1_JsPolicyViolationsList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JsPolicyViolationsList contains a list of JsPolicyViolations", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyViolations"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/virtualcluster/v1.HelmRelease"), }, }, }, @@ -29285,178 +28604,104 @@ func schema_pkg_apis_policy_v1beta1_JsPolicyViolationsList(ref common.ReferenceC }, }, Dependencies: []string{ - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.JsPolicyViolations", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_policy_v1beta1_JsPolicyViolationsSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - }, - }, + "github.com/loft-sh/api/v4/pkg/apis/virtualcluster/v1.HelmRelease", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_pkg_apis_policy_v1beta1_JsPolicyViolationsStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_virtualcluster_v1_HelmReleaseSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "violations": { + "chart": { SchemaProps: spec.SchemaProps{ - Description: "Violations is an array of violations that were recorded by the webhook", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.PolicyViolation"), - }, - }, - }, + Description: "Chart holds information about a chart that should get deployed", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Chart"), }, }, - }, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.PolicyViolation"}, - } -} - -func schema_pkg_apis_policy_v1beta1_PolicyViolation(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "action": { + "manifests": { SchemaProps: spec.SchemaProps{ - Description: "Action holds the the action type the webhook reacted with", + Description: "Manifests holds kube manifests that will be deployed as a chart", Type: []string{"string"}, Format: "", }, }, - "code": { + "bash": { SchemaProps: spec.SchemaProps{ - Description: "Code is the error code that was returned to the client", - Type: []string{"integer"}, - Format: "int32", + Description: "Bash holds the bash script to execute in a container in the target", + Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Bash"), }, }, - "reason": { + "values": { SchemaProps: spec.SchemaProps{ - Description: "Reason is the error reason that was returned to the client", + Description: "Values is the set of extra Values added to the chart. These values merge with the default values inside of the chart. You can use golang templating in here with values from parameters.", Type: []string{"string"}, Format: "", }, }, - "message": { + "parameters": { SchemaProps: spec.SchemaProps{ - Description: "Message holds the message that was sent to the client", + Description: "Parameters are additional helm chart values that will get merged with config and are then used to deploy the helm chart.", Type: []string{"string"}, Format: "", }, }, - "requestInfo": { - SchemaProps: spec.SchemaProps{ - Description: "The request this violation is about", - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.RequestInfo"), - }, - }, - "userInfo": { - SchemaProps: spec.SchemaProps{ - Description: "The user that sent the request", - Ref: ref("github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.UserInfo"), - }, - }, - "timestamp": { + "annotations": { SchemaProps: spec.SchemaProps{ - Description: "The timestamp when this violation has occurred", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + Description: "Annotations are extra annotations for this helm release", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, }, }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.RequestInfo", "github.com/loft-sh/jspolicy/pkg/apis/policy/v1beta1.UserInfo", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Bash", "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Chart"}, } } -func schema_pkg_apis_policy_v1beta1_RequestInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_virtualcluster_v1_HelmReleaseStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the object as presented in the request. On a CREATE operation, the client may omit name and rely on the server to generate the name. If that is the case, this field will contain an empty string.", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace associated with the request (if any).", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the type of object being submitted (for example, Pod or Deployment)", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the type of object being submitted (for example, Pod or Deployment)", - Type: []string{"string"}, - Format: "", - }, - }, - "operation": { + "version": { SchemaProps: spec.SchemaProps{ - Description: "Operation is the operation being performed. This may be different than the operation requested. e.g. a patch can result in either a CREATE or UPDATE Operation.", - Type: []string{"string"}, - Format: "", + Description: "Revision is an int which represents the revision of the release.", + Type: []string{"integer"}, + Format: "int32", }, }, - }, - }, - }, - } -} - -func schema_pkg_apis_policy_v1beta1_UserInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "username": { + "info": { SchemaProps: spec.SchemaProps{ - Description: "The name that uniquely identifies this user among all active users.", - Type: []string{"string"}, - Format: "", + Description: "Info provides information about a release", + Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Info"), }, }, - "uid": { + "metadata": { SchemaProps: spec.SchemaProps{ - Description: "A unique value that identifies this user across time. If this user is deleted and another user by the same name is added, they will have different UIDs.", - Type: []string{"string"}, - Format: "", + Description: "Metadata provides information about a chart", + Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Metadata"), }, }, }, }, }, + Dependencies: []string{ + "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Info", "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1.Metadata"}, } } @@ -34052,13 +33297,13 @@ func schema_k8sio_api_apps_v1_StatefulSetSpec(ref common.ReferenceCallback) comm }, "persistentVolumeClaimRetentionPolicy": { SchemaProps: spec.SchemaProps{ - Description: "persistentVolumeClaimRetentionPolicy describes the lifecycle of persistent volume claims created from volumeClaimTemplates. By default, all persistent volume claims are created as needed and retained until manually deleted. This policy allows the lifecycle to be altered, for example by deleting persistent volume claims when their stateful set is deleted, or when their pod is scaled down. This requires the StatefulSetAutoDeletePVC feature gate to be enabled, which is alpha. +optional", + Description: "persistentVolumeClaimRetentionPolicy describes the lifecycle of persistent volume claims created from volumeClaimTemplates. By default, all persistent volume claims are created as needed and retained until manually deleted. This policy allows the lifecycle to be altered, for example by deleting persistent volume claims when their stateful set is deleted, or when their pod is scaled down. This requires the StatefulSetAutoDeletePVC feature gate to be enabled, which is beta.", Ref: ref("k8s.io/api/apps/v1.StatefulSetPersistentVolumeClaimRetentionPolicy"), }, }, "ordinals": { SchemaProps: spec.SchemaProps{ - Description: "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested. Using the ordinals field requires the StatefulSetStartOrdinal feature gate to be enabled, which is beta.", + Description: "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested.", Ref: ref("k8s.io/api/apps/v1.StatefulSetOrdinals"), }, }, @@ -35203,7 +34448,7 @@ func schema_k8sio_api_apps_v1beta1_StatefulSetSpec(ref common.ReferenceCallback) }, "ordinals": { SchemaProps: spec.SchemaProps{ - Description: "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested. Using the ordinals field requires the StatefulSetStartOrdinal feature gate to be enabled, which is beta.", + Description: "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested.", Ref: ref("k8s.io/api/apps/v1beta1.StatefulSetOrdinals"), }, }, @@ -36902,7 +36147,7 @@ func schema_k8sio_api_apps_v1beta2_StatefulSetSpec(ref common.ReferenceCallback) }, "ordinals": { SchemaProps: spec.SchemaProps{ - Description: "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested. Using the ordinals field requires the StatefulSetStartOrdinal feature gate to be enabled, which is beta.", + Description: "ordinals controls the numbering of replica indices in a StatefulSet. The default ordinals behavior assigns a \"0\" index to the first replica and increments the index by one for each additional replica requested.", Ref: ref("k8s.io/api/apps/v1beta2.StatefulSetOrdinals"), }, }, @@ -37783,6 +37028,88 @@ func schema_k8sio_api_authentication_v1beta1_UserInfo(ref common.ReferenceCallba } } +func schema_k8sio_api_authorization_v1_FieldSelectorAttributes(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FieldSelectorAttributes indicates a field limited access. Webhook authors are encouraged to * ensure rawSelector and requirements are not both set * consider the requirements field if set * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details. For the *SubjectAccessReview endpoints of the kube-apiserver: * If rawSelector is empty and requirements are empty, the request is not limited. * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds. * If rawSelector is empty and requirements are present, the requirements should be honored * If rawSelector is present and requirements are present, the request is invalid.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "rawSelector": { + SchemaProps: spec.SchemaProps{ + Description: "rawSelector is the serialization of a field selector that would be included in a query parameter. Webhook implementations are encouraged to ignore rawSelector. The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.", + Type: []string{"string"}, + Format: "", + }, + }, + "requirements": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "requirements is the parsed interpretation of a field selector. All requirements must be met for a resource instance to match the selector. Webhook implementations should handle requirements, but how to handle them is up to the webhook. Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements are not understood.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.FieldSelectorRequirement"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldSelectorRequirement"}, + } +} + +func schema_k8sio_api_authorization_v1_LabelSelectorAttributes(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "LabelSelectorAttributes indicates a label limited access. Webhook authors are encouraged to * ensure rawSelector and requirements are not both set * consider the requirements field if set * not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details. For the *SubjectAccessReview endpoints of the kube-apiserver: * If rawSelector is empty and requirements are empty, the request is not limited. * If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds. * If rawSelector is empty and requirements are present, the requirements should be honored * If rawSelector is present and requirements are present, the request is invalid.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "rawSelector": { + SchemaProps: spec.SchemaProps{ + Description: "rawSelector is the serialization of a field selector that would be included in a query parameter. Webhook implementations are encouraged to ignore rawSelector. The kube-apiserver's *SubjectAccessReview will parse the rawSelector as long as the requirements are not present.", + Type: []string{"string"}, + Format: "", + }, + }, + "requirements": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "requirements is the parsed interpretation of a label selector. All requirements must be met for a resource instance to match the selector. Webhook implementations should handle requirements, but how to handle them is up to the webhook. Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements are not understood.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"}, + } +} + func schema_k8sio_api_authorization_v1_LocalSubjectAccessReview(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -37971,9 +37298,23 @@ func schema_k8sio_api_authorization_v1_ResourceAttributes(ref common.ReferenceCa Format: "", }, }, + "fieldSelector": { + SchemaProps: spec.SchemaProps{ + Description: "fieldSelector describes the limitation on access based on field. It can only limit access, not broaden it.\n\nThis field is alpha-level. To use this field, you must enable the `AuthorizeWithSelectors` feature gate (disabled by default).", + Ref: ref("k8s.io/api/authorization/v1.FieldSelectorAttributes"), + }, + }, + "labelSelector": { + SchemaProps: spec.SchemaProps{ + Description: "labelSelector describes the limitation on access based on labels. It can only limit access, not broaden it.\n\nThis field is alpha-level. To use this field, you must enable the `AuthorizeWithSelectors` feature gate (disabled by default).", + Ref: ref("k8s.io/api/authorization/v1.LabelSelectorAttributes"), + }, + }, }, }, }, + Dependencies: []string{ + "k8s.io/api/authorization/v1.FieldSelectorAttributes", "k8s.io/api/authorization/v1.LabelSelectorAttributes"}, } } @@ -38655,9 +37996,23 @@ func schema_k8sio_api_authorization_v1beta1_ResourceAttributes(ref common.Refere Format: "", }, }, + "fieldSelector": { + SchemaProps: spec.SchemaProps{ + Description: "fieldSelector describes the limitation on access based on field. It can only limit access, not broaden it.", + Ref: ref("k8s.io/api/authorization/v1.FieldSelectorAttributes"), + }, + }, + "labelSelector": { + SchemaProps: spec.SchemaProps{ + Description: "labelSelector describes the limitation on access based on labels. It can only limit access, not broaden it.", + Ref: ref("k8s.io/api/authorization/v1.LabelSelectorAttributes"), + }, + }, }, }, }, + Dependencies: []string{ + "k8s.io/api/authorization/v1.FieldSelectorAttributes", "k8s.io/api/authorization/v1.LabelSelectorAttributes"}, } } @@ -42332,13 +41687,13 @@ func schema_k8sio_api_batch_v1_JobSpec(ref common.ReferenceCallback) common.Open }, "podFailurePolicy": { SchemaProps: spec.SchemaProps{ - Description: "Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure.\n\nThis field is beta-level. It can be used when the `JobPodFailurePolicy` feature gate is enabled (enabled by default).", + Description: "Specifies the policy of handling failed pods. In particular, it allows to specify the set of actions and conditions which need to be satisfied to take the associated action. If empty, the default behaviour applies - the counter of failed pods, represented by the jobs's .status.failed field, is incremented and it is checked against the backoffLimit. This field cannot be used in combination with restartPolicy=OnFailure.", Ref: ref("k8s.io/api/batch/v1.PodFailurePolicy"), }, }, "successPolicy": { SchemaProps: spec.SchemaProps{ - Description: "successPolicy specifies the policy when the Job can be declared as succeeded. If empty, the default behavior applies - the Job is declared as succeeded only when the number of succeeded pods equals to the completions. When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated.\n\nThis field is alpha-level. To use this field, you must enable the `JobSuccessPolicy` feature gate (disabled by default).", + Description: "successPolicy specifies the policy when the Job can be declared as succeeded. If empty, the default behavior applies - the Job is declared as succeeded only when the number of succeeded pods equals to the completions. When the field is specified, it must be immutable and works only for the Indexed Jobs. Once the Job meets the SuccessPolicy, the lingering pods are terminated.\n\nThis field is beta-level. To use this field, you must enable the `JobSuccessPolicy` feature gate (enabled by default).", Ref: ref("k8s.io/api/batch/v1.SuccessPolicy"), }, }, @@ -42415,7 +41770,7 @@ func schema_k8sio_api_batch_v1_JobSpec(ref common.ReferenceCallback) common.Open }, "managedBy": { SchemaProps: spec.SchemaProps{ - Description: "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 64 characters.\n\nThis field is alpha-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (disabled by default).", + Description: "ManagedBy field indicates the controller that manages a Job. The k8s Job controller reconciles jobs which don't have this field at all or the field value is the reserved string `kubernetes.io/job-controller`, but skips reconciling Jobs with a custom value for this field. The value must be a valid domain-prefixed path (e.g. acme.io/foo) - all characters before the first \"/\" must be a valid subdomain as defined by RFC 1123. All characters trailing the first \"/\" must be valid HTTP Path characters as defined by RFC 3986. The value cannot exceed 63 characters. This field is immutable.\n\nThis field is alpha-level. The job controller accepts setting the field when the feature gate JobManagedBy is enabled (disabled by default).", Type: []string{"string"}, Format: "", }, @@ -42519,7 +41874,7 @@ func schema_k8sio_api_batch_v1_JobStatus(ref common.ReferenceCallback) common.Op }, "ready": { SchemaProps: spec.SchemaProps{ - Description: "The number of pods which have a Ready condition.", + Description: "The number of active pods which have a Ready condition and are not terminating (without a deletionTimestamp).", Type: []string{"integer"}, Format: "int32", }, @@ -43513,14 +42868,14 @@ func schema_k8sio_api_coordination_v1_LeaseSpec(ref common.ReferenceCallback) co Properties: map[string]spec.Schema{ "holderIdentity": { SchemaProps: spec.SchemaProps{ - Description: "holderIdentity contains the identity of the holder of a current lease.", + Description: "holderIdentity contains the identity of the holder of a current lease. If Coordinated Leader Election is used, the holder identity must be equal to the elected LeaseCandidate.metadata.name field.", Type: []string{"string"}, Format: "", }, }, "leaseDurationSeconds": { SchemaProps: spec.SchemaProps{ - Description: "leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed renewTime.", + Description: "leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measured against the time of last observed renewTime.", Type: []string{"integer"}, Format: "int32", }, @@ -43544,6 +42899,20 @@ func schema_k8sio_api_coordination_v1_LeaseSpec(ref common.ReferenceCallback) co Format: "int32", }, }, + "strategy": { + SchemaProps: spec.SchemaProps{ + Description: "Strategy indicates the strategy for picking the leader for coordinated leader election. If the field is not specified, there is no active coordination for this lease. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.", + Type: []string{"string"}, + Format: "", + }, + }, + "preferredHolder": { + SchemaProps: spec.SchemaProps{ + Description: "PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up. This field can only be set if Strategy is also set.", + Type: []string{"string"}, + Format: "", + }, + }, }, }, }, @@ -43655,7 +43024,7 @@ func schema_k8sio_api_coordination_v1beta1_LeaseSpec(ref common.ReferenceCallbac Properties: map[string]spec.Schema{ "holderIdentity": { SchemaProps: spec.SchemaProps{ - Description: "holderIdentity contains the identity of the holder of a current lease.", + Description: "holderIdentity contains the identity of the holder of a current lease. If Coordinated Leader Election is used, the holder identity must be equal to the elected LeaseCandidate.metadata.name field.", Type: []string{"string"}, Format: "", }, @@ -43686,6 +43055,20 @@ func schema_k8sio_api_coordination_v1beta1_LeaseSpec(ref common.ReferenceCallbac Format: "int32", }, }, + "strategy": { + SchemaProps: spec.SchemaProps{ + Description: "Strategy indicates the strategy for picking the leader for coordinated leader election (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.", + Type: []string{"string"}, + Format: "", + }, + }, + "preferredHolder": { + SchemaProps: spec.SchemaProps{ + Description: "PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up.", + Type: []string{"string"}, + Format: "", + }, + }, }, }, }, @@ -43902,6 +43285,7 @@ func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback "cachingMode": { SchemaProps: spec.SchemaProps{ Description: "cachingMode is the Host Caching mode: None, Read Only, Read Write.\n\nPossible enum values:\n - `\"None\"`\n - `\"ReadOnly\"`\n - `\"ReadWrite\"`", + Default: v1.AzureDataDiskCachingReadWrite, Type: []string{"string"}, Format: "", Enum: []interface{}{"None", "ReadOnly", "ReadWrite"}, @@ -43910,6 +43294,7 @@ func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback "fsType": { SchemaProps: spec.SchemaProps{ Description: "fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", + Default: "ext4", Type: []string{"string"}, Format: "", }, @@ -43917,6 +43302,7 @@ func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback "readOnly": { SchemaProps: spec.SchemaProps{ Description: "readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", + Default: false, Type: []string{"boolean"}, Format: "", }, @@ -43924,6 +43310,7 @@ func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback "kind": { SchemaProps: spec.SchemaProps{ Description: "kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared\n\nPossible enum values:\n - `\"Dedicated\"`\n - `\"Managed\"`\n - `\"Shared\"`", + Default: v1.AzureSharedBlobDisk, Type: []string{"string"}, Format: "", Enum: []interface{}{"Dedicated", "Managed", "Shared"}, @@ -44494,33 +43881,6 @@ func schema_k8sio_api_core_v1_CinderVolumeSource(ref common.ReferenceCallback) c } } -func schema_k8sio_api_core_v1_ClaimSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClaimSource describes a reference to a ResourceClaim.\n\nExactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "resourceClaimName": { - SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceClaimTemplateName": { - SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - func schema_k8sio_api_core_v1_ClientIPConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -45786,12 +45146,63 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm }, }, }, + "user": { + SchemaProps: spec.SchemaProps{ + Description: "User represents user identity information initially attached to the first process of the container", + Ref: ref("k8s.io/api/core/v1.ContainerUser"), + }, + }, + "allocatedResourcesStatus": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "AllocatedResourcesStatus represents the status of various resources allocated for this Pod.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ResourceStatus"), + }, + }, + }, + }, + }, }, Required: []string{"name", "ready", "restartCount", "image", "imageID"}, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerState", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.VolumeMountStatus", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + "k8s.io/api/core/v1.ContainerState", "k8s.io/api/core/v1.ContainerUser", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.ResourceStatus", "k8s.io/api/core/v1.VolumeMountStatus", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + } +} + +func schema_k8sio_api_core_v1_ContainerUser(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ContainerUser represents user identity information", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "linux": { + SchemaProps: spec.SchemaProps{ + Description: "Linux holds user identity information initially attached to the first process of the containers in Linux. Note that the actual running identity can be changed if the process has enough privilege to do so.", + Ref: ref("k8s.io/api/core/v1.LinuxContainerUser"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.LinuxContainerUser"}, } } @@ -47805,11 +47216,13 @@ func schema_k8sio_api_core_v1_HostIP(ref common.ReferenceCallback) common.OpenAP "ip": { SchemaProps: spec.SchemaProps{ Description: "IP is the IP address assigned to the host", + Default: "", Type: []string{"string"}, Format: "", }, }, }, + Required: []string{"ip"}, }, }, } @@ -47879,6 +47292,7 @@ func schema_k8sio_api_core_v1_ISCSIPersistentVolumeSource(ref common.ReferenceCa "iscsiInterface": { SchemaProps: spec.SchemaProps{ Description: "iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).", + Default: "default", Type: []string{"string"}, Format: "", }, @@ -47987,6 +47401,7 @@ func schema_k8sio_api_core_v1_ISCSIVolumeSource(ref common.ReferenceCallback) co "iscsiInterface": { SchemaProps: spec.SchemaProps{ Description: "iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).", + Default: "default", Type: []string{"string"}, Format: "", }, @@ -48061,6 +47476,34 @@ func schema_k8sio_api_core_v1_ISCSIVolumeSource(ref common.ReferenceCallback) co } } +func schema_k8sio_api_core_v1_ImageVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ImageVolumeSource represents a image volume resource.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "reference": { + SchemaProps: spec.SchemaProps{ + Description: "Required: Image or artifact reference to be used. Behaves in the same way as pod.spec.containers[*].image. Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", + Type: []string{"string"}, + Format: "", + }, + }, + "pullPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "Policy for pulling OCI objects. Possible values are: Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.\n\nPossible enum values:\n - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.\n - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.\n - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"Always", "IfNotPresent", "Never"}, + }, + }, + }, + }, + }, + } +} + func schema_k8sio_api_core_v1_KeyToPath(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -48387,6 +47830,56 @@ func schema_k8sio_api_core_v1_LimitRangeSpec(ref common.ReferenceCallback) commo } } +func schema_k8sio_api_core_v1_LinuxContainerUser(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "LinuxContainerUser represents user identity information in Linux containers", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "uid": { + SchemaProps: spec.SchemaProps{ + Description: "UID is the primary uid initially attached to the first process in the container", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "gid": { + SchemaProps: spec.SchemaProps{ + Description: "GID is the primary gid initially attached to the first process in the container", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "supplementalGroups": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "SupplementalGroups are the supplemental groups initially attached to the first process in the container", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + }, + }, + }, + Required: []string{"uid", "gid"}, + }, + }, + } +} + func schema_k8sio_api_core_v1_List(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -49139,6 +48632,26 @@ func schema_k8sio_api_core_v1_NodeDaemonEndpoints(ref common.ReferenceCallback) } } +func schema_k8sio_api_core_v1_NodeFeatures(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeFeatures describes the set of features implemented by the CRI implementation. The features contained in the NodeFeatures should depend only on the cri implementation independent of runtime handlers.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "supplementalGroupsPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "SupplementalGroupsPolicy is set to true if the runtime supports SupplementalGroupsPolicy and ContainerUser.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_k8sio_api_core_v1_NodeList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -49257,7 +48770,7 @@ func schema_k8sio_api_core_v1_NodeRuntimeHandlerFeatures(ref common.ReferenceCal return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "NodeRuntimeHandlerFeatures is a set of runtime features.", + Description: "NodeRuntimeHandlerFeatures is a set of features implemented by the runtime handler.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "recursiveReadOnlyMounts": { @@ -49267,6 +48780,13 @@ func schema_k8sio_api_core_v1_NodeRuntimeHandlerFeatures(ref common.ReferenceCal Format: "", }, }, + "userNamespaces": { + SchemaProps: spec.SchemaProps{ + Description: "UserNamespaces is set to true if the runtime handler supports UserNamespaces, including for volumes.", + Type: []string{"boolean"}, + Format: "", + }, + }, }, }, }, @@ -49520,7 +49040,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Properties: map[string]spec.Schema{ "capacity": { SchemaProps: spec.SchemaProps{ - Description: "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", + Description: "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/reference/node/node-status/#capacity", Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, @@ -49699,11 +49219,17 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op }, }, }, + "features": { + SchemaProps: spec.SchemaProps{ + Description: "Features describes the set of features implemented by the CRI implementation.", + Ref: ref("k8s.io/api/core/v1.NodeFeatures"), + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.AttachedVolume", "k8s.io/api/core/v1.ContainerImage", "k8s.io/api/core/v1.NodeAddress", "k8s.io/api/core/v1.NodeCondition", "k8s.io/api/core/v1.NodeConfigStatus", "k8s.io/api/core/v1.NodeDaemonEndpoints", "k8s.io/api/core/v1.NodeRuntimeHandler", "k8s.io/api/core/v1.NodeSystemInfo", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + "k8s.io/api/core/v1.AttachedVolume", "k8s.io/api/core/v1.ContainerImage", "k8s.io/api/core/v1.NodeAddress", "k8s.io/api/core/v1.NodeCondition", "k8s.io/api/core/v1.NodeConfigStatus", "k8s.io/api/core/v1.NodeDaemonEndpoints", "k8s.io/api/core/v1.NodeFeatures", "k8s.io/api/core/v1.NodeRuntimeHandler", "k8s.io/api/core/v1.NodeSystemInfo", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -49772,7 +49298,7 @@ func schema_k8sio_api_core_v1_NodeSystemInfo(ref common.ReferenceCallback) commo }, "kubeProxyVersion": { SchemaProps: spec.SchemaProps{ - Description: "KubeProxy Version reported by the node.", + Description: "Deprecated: KubeProxy Version reported by the node.", Default: "", Type: []string{"string"}, Format: "", @@ -50186,7 +49712,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall }, "volumeAttributesClassName": { SchemaProps: spec.SchemaProps{ - Description: "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.", + Description: "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).", Type: []string{"string"}, Format: "", }, @@ -50303,7 +49829,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", - Enum: []interface{}{"ControllerResizeFailed", "ControllerResizeInProgress", "NodeResizeFailed", "NodeResizeInProgress", "NodeResizePending"}, + Enum: []interface{}{"ControllerResizeInProgress", "ControllerResizeInfeasible", "NodeResizeInProgress", "NodeResizeInfeasible", "NodeResizePending"}, }, }, }, @@ -50311,14 +49837,14 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa }, "currentVolumeAttributesClassName": { SchemaProps: spec.SchemaProps{ - Description: "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is an alpha field and requires enabling VolumeAttributesClass feature.", + Description: "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is a beta field and requires enabling VolumeAttributesClass feature (off by default).", Type: []string{"string"}, Format: "", }, }, "modifyVolumeStatus": { SchemaProps: spec.SchemaProps{ - Description: "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted. This is an alpha field and requires enabling VolumeAttributesClass feature.", + Description: "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted. This is a beta field and requires enabling VolumeAttributesClass feature (off by default).", Ref: ref("k8s.io/api/core/v1.ModifyVolumeStatus"), }, }, @@ -50823,7 +50349,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) }, "volumeAttributesClassName": { SchemaProps: spec.SchemaProps{ - Description: "Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. This is an alpha field and requires enabling VolumeAttributesClass feature.", + Description: "Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. This is a beta field and requires enabling VolumeAttributesClass feature (off by default).", Type: []string{"string"}, Format: "", }, @@ -50867,7 +50393,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeStatus(ref common.ReferenceCallbac }, "lastPhaseTransitionTime": { SchemaProps: spec.SchemaProps{ - Description: "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions. This is a beta field and requires the PersistentVolumeLastPhaseTransitionTime feature to be enabled (enabled by default).", + Description: "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions.", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -51065,7 +50591,7 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm }, }, SchemaProps: spec.SchemaProps{ - Description: "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", + Description: "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -51085,7 +50611,7 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm }, }, SchemaProps: spec.SchemaProps{ - Description: "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", + Description: "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -51473,11 +50999,13 @@ func schema_k8sio_api_core_v1_PodIP(ref common.ReferenceCallback) common.OpenAPI "ip": { SchemaProps: spec.SchemaProps{ Description: "IP is the IP address assigned to the pod", + Default: "", Type: []string{"string"}, Format: "", }, }, }, + Required: []string{"ip"}, }, }, } @@ -51754,7 +51282,7 @@ func schema_k8sio_api_core_v1_PodResourceClaim(ref common.ReferenceCallback) com return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.", + Description: "PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "name": { @@ -51765,19 +51293,24 @@ func schema_k8sio_api_core_v1_PodResourceClaim(ref common.ReferenceCallback) com Format: "", }, }, - "source": { + "resourceClaimName": { SchemaProps: spec.SchemaProps{ - Description: "Source describes where to find the ResourceClaim.", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/core/v1.ClaimSource"), + Description: "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceClaimTemplateName": { + SchemaProps: spec.SchemaProps{ + Description: "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", + Type: []string{"string"}, + Format: "", }, }, }, Required: []string{"name"}, }, }, - Dependencies: []string{ - "k8s.io/api/core/v1.ClaimSource"}, } } @@ -51798,7 +51331,7 @@ func schema_k8sio_api_core_v1_PodResourceClaimStatus(ref common.ReferenceCallbac }, "resourceClaimName": { SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. It this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.", + Description: "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. If this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.", Type: []string{"string"}, Format: "", }, @@ -51879,7 +51412,7 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c }, }, SchemaProps: spec.SchemaProps{ - Description: "A list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. If unspecified, no additional groups are added to any container. Note that group memberships defined in the container image for the uid of the container process are still effective, even if they are not included in this list. Note that this field cannot be set when spec.os.name is windows.", + Description: "A list of groups applied to the first process run in each container, in addition to the container's primary GID and fsGroup (if specified). If the SupplementalGroupsPolicy feature is enabled, the supplementalGroupsPolicy field determines whether these are in addition to or instead of any group memberships defined in the container image. If unspecified, no additional groups are added, though group memberships defined in the container image may still be used, depending on the supplementalGroupsPolicy field. Note that this field cannot be set when spec.os.name is windows.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -51892,6 +51425,14 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c }, }, }, + "supplementalGroupsPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "Defines how supplemental groups of the first container processes are calculated. Valid values are \"Merge\" and \"Strict\". If not specified, \"Merge\" is used. (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled and the container runtime must implement support for this feature. Note that this field cannot be set when spec.os.name is windows.\n\nPossible enum values:\n - `\"Merge\"` means that the container's provided SupplementalGroups and FsGroup (specified in SecurityContext) will be merged with the primary user's groups as defined in the container image (in /etc/group).\n - `\"Strict\"` means that the container's provided SupplementalGroups and FsGroup (specified in SecurityContext) will be used instead of any groups defined in the container image.", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"Merge", "Strict"}, + }, + }, "fsGroup": { SchemaProps: spec.SchemaProps{ Description: "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows.", @@ -52144,7 +51685,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "nodeName": { SchemaProps: spec.SchemaProps{ - Description: "NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.", + Description: "NodeName indicates in which node this pod is scheduled. If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. This field should not be used to express a desire for the pod to be scheduled on a specific node. https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename", Type: []string{"string"}, Format: "", }, @@ -52386,7 +51927,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "os": { SchemaProps: spec.SchemaProps{ - Description: "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup", + Description: "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.securityContext.supplementalGroupsPolicy - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup", Ref: ref("k8s.io/api/core/v1.PodOS"), }, }, @@ -53130,7 +52671,7 @@ func schema_k8sio_api_core_v1_ProjectedVolumeSource(ref common.ReferenceCallback }, }, SchemaProps: spec.SchemaProps{ - Description: "sources is the list of volume projections", + Description: "sources is the list of volume projections. Each entry in this list handles one source.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -53260,6 +52801,7 @@ func schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref common.ReferenceCall "pool": { SchemaProps: spec.SchemaProps{ Description: "pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", + Default: "rbd", Type: []string{"string"}, Format: "", }, @@ -53267,6 +52809,7 @@ func schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref common.ReferenceCall "user": { SchemaProps: spec.SchemaProps{ Description: "user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", + Default: "admin", Type: []string{"string"}, Format: "", }, @@ -53274,6 +52817,7 @@ func schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref common.ReferenceCall "keyring": { SchemaProps: spec.SchemaProps{ Description: "keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", + Default: "/etc/ceph/keyring", Type: []string{"string"}, Format: "", }, @@ -53345,6 +52889,7 @@ func schema_k8sio_api_core_v1_RBDVolumeSource(ref common.ReferenceCallback) comm "pool": { SchemaProps: spec.SchemaProps{ Description: "pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", + Default: "rbd", Type: []string{"string"}, Format: "", }, @@ -53352,6 +52897,7 @@ func schema_k8sio_api_core_v1_RBDVolumeSource(ref common.ReferenceCallback) comm "user": { SchemaProps: spec.SchemaProps{ Description: "user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", + Default: "admin", Type: []string{"string"}, Format: "", }, @@ -53359,6 +52905,7 @@ func schema_k8sio_api_core_v1_RBDVolumeSource(ref common.ReferenceCallback) comm "keyring": { SchemaProps: spec.SchemaProps{ Description: "keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", + Default: "/etc/ceph/keyring", Type: []string{"string"}, Format: "", }, @@ -53737,6 +53284,13 @@ func schema_k8sio_api_core_v1_ResourceClaim(ref common.ReferenceCallback) common Format: "", }, }, + "request": { + SchemaProps: spec.SchemaProps{ + Description: "Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request.", + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"name"}, }, @@ -53786,6 +53340,35 @@ func schema_k8sio_api_core_v1_ResourceFieldSelector(ref common.ReferenceCallback } } +func schema_k8sio_api_core_v1_ResourceHealth(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ResourceHealth represents the health of a resource. It has the latest device health information. This is a part of KEP https://kep.k8s.io/4680 and historical health changes are planned to be added in future iterations of a KEP.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "resourceID": { + SchemaProps: spec.SchemaProps{ + Description: "ResourceID is the unique identifier of the resource. See the ResourceID type for more information.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "health": { + SchemaProps: spec.SchemaProps{ + Description: "Health of the resource. can be one of:\n - Healthy: operates as normal\n - Unhealthy: reported unhealthy. We consider this a temporary health issue\n since we do not have a mechanism today to distinguish\n temporary and permanent issues.\n - Unknown: The status cannot be determined.\n For example, Device Plugin got unregistered and hasn't been re-registered since.\n\nIn future we may want to introduce the PermanentlyUnhealthy Status.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"resourceID"}, + }, + }, + } +} + func schema_k8sio_api_core_v1_ResourceQuota(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -54051,6 +53634,51 @@ func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) } } +func schema_k8sio_api_core_v1_ResourceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the resource. Must be unique within the pod and match one of the resources from the pod spec.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resources": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "resourceID", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "List of unique Resources health. Each element in the list contains an unique resource ID and resource health. At a minimum, ResourceID must uniquely identify the Resource allocated to the Pod on the Node for the lifetime of a Pod. See ResourceID type for it's definition.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ResourceHealth"), + }, + }, + }, + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ResourceHealth"}, + } +} + func schema_k8sio_api_core_v1_SELinuxOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -54145,6 +53773,7 @@ func schema_k8sio_api_core_v1_ScaleIOPersistentVolumeSource(ref common.Reference "storageMode": { SchemaProps: spec.SchemaProps{ Description: "storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.", + Default: "ThinProvisioned", Type: []string{"string"}, Format: "", }, @@ -54159,6 +53788,7 @@ func schema_k8sio_api_core_v1_ScaleIOPersistentVolumeSource(ref common.Reference "fsType": { SchemaProps: spec.SchemaProps{ Description: "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\"", + Default: "xfs", Type: []string{"string"}, Format: "", }, @@ -54232,6 +53862,7 @@ func schema_k8sio_api_core_v1_ScaleIOVolumeSource(ref common.ReferenceCallback) "storageMode": { SchemaProps: spec.SchemaProps{ Description: "storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.", + Default: "ThinProvisioned", Type: []string{"string"}, Format: "", }, @@ -54246,6 +53877,7 @@ func schema_k8sio_api_core_v1_ScaleIOVolumeSource(ref common.ReferenceCallback) "fsType": { SchemaProps: spec.SchemaProps{ Description: "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".", + Default: "xfs", Type: []string{"string"}, Format: "", }, @@ -54806,7 +54438,7 @@ func schema_k8sio_api_core_v1_SecurityContext(ref common.ReferenceCallback) comm }, "procMount": { SchemaProps: spec.SchemaProps{ - Description: "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.\n\nPossible enum values:\n - `\"Default\"` uses the container runtime defaults for readonly and masked paths for /proc. Most container runtimes mask certain paths in /proc to avoid accidental security exposure of special devices or information.\n - `\"Unmasked\"` bypasses the default masking behavior of the container runtime and ensures the newly created /proc the container stays in tact with no modifications.", + Description: "procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.\n\nPossible enum values:\n - `\"Default\"` uses the container runtime defaults for readonly and masked paths for /proc. Most container runtimes mask certain paths in /proc to avoid accidental security exposure of special devices or information.\n - `\"Unmasked\"` bypasses the default masking behavior of the container runtime and ensures the newly created /proc the container stays in tact with no modifications.", Type: []string{"string"}, Format: "", Enum: []interface{}{"Default", "Unmasked"}, @@ -56267,12 +55899,18 @@ func schema_k8sio_api_core_v1_Volume(ref common.ReferenceCallback) common.OpenAP Ref: ref("k8s.io/api/core/v1.EphemeralVolumeSource"), }, }, + "image": { + SchemaProps: spec.SchemaProps{ + Description: "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.", + Ref: ref("k8s.io/api/core/v1.ImageVolumeSource"), + }, + }, }, Required: []string{"name"}, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.EphemeralVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, + "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.EphemeralVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.ImageVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, } } @@ -56441,7 +56079,7 @@ func schema_k8sio_api_core_v1_VolumeProjection(ref common.ReferenceCallback) com return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "Projection that may be projected along with other supported volume types", + Description: "Projection that may be projected along with other supported volume types. Exactly one of these fields must be set.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "secret": { @@ -56706,11 +56344,17 @@ func schema_k8sio_api_core_v1_VolumeSource(ref common.ReferenceCallback) common. Ref: ref("k8s.io/api/core/v1.EphemeralVolumeSource"), }, }, + "image": { + SchemaProps: spec.SchemaProps{ + Description: "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.", + Ref: ref("k8s.io/api/core/v1.ImageVolumeSource"), + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.EphemeralVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, + "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.EphemeralVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.ImageVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, } } @@ -60280,6 +59924,11 @@ func schema_k8sio_api_networking_v1_ServiceBackendPort(ref common.ReferenceCallb }, }, }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-map-type": "atomic", + }, + }, }, } } @@ -60356,6 +60005,122 @@ func schema_k8sio_api_networking_v1beta1_HTTPIngressRuleValue(ref common.Referen } } +func schema_k8sio_api_networking_v1beta1_IPAddress(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. An IP address can be represented in different formats, to guarantee the uniqueness of the IP, the name of the object is the IP address in canonical format, four decimal digits separated by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 Invalid: 10.01.2.3 or 2001:db8:0:0:0::1", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is the desired state of the IPAddress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/networking/v1beta1.IPAddressSpec"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/networking/v1beta1.IPAddressSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_k8sio_api_networking_v1beta1_IPAddressList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "IPAddressList contains a list of IPAddress.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items is the list of IPAddresses.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/networking/v1beta1.IPAddress"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/networking/v1beta1.IPAddress", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_k8sio_api_networking_v1beta1_IPAddressSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "IPAddressSpec describe the attributes in an IP Address.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "parentRef": { + SchemaProps: spec.SchemaProps{ + Description: "ParentRef references the resource that an IPAddress is attached to. An IPAddress must reference a parent object.", + Ref: ref("k8s.io/api/networking/v1beta1.ParentReference"), + }, + }, + }, + Required: []string{"parentRef"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/networking/v1beta1.ParentReference"}, + } +} + func schema_k8sio_api_networking_v1beta1_Ingress(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -60959,6 +60724,221 @@ func schema_k8sio_api_networking_v1beta1_IngressTLS(ref common.ReferenceCallback } } +func schema_k8sio_api_networking_v1beta1_ParentReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ParentReference describes a reference to a parent object.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Description: "Group is the group of the object being referenced.", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Description: "Resource is the resource of the object being referenced.", + Type: []string{"string"}, + Format: "", + }, + }, + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "Namespace is the namespace of the object being referenced.", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the name of the object being referenced.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"resource", "name"}, + }, + }, + } +} + +func schema_k8sio_api_networking_v1beta1_ServiceCIDR(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ServiceCIDR defines a range of IP addresses using CIDR format (e.g. 192.168.0.0/24 or 2001:db2::/64). This range is used to allocate ClusterIPs to Service objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is the desired state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/networking/v1beta1.ServiceCIDRSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status represents the current state of the ServiceCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/networking/v1beta1.ServiceCIDRStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/networking/v1beta1.ServiceCIDRSpec", "k8s.io/api/networking/v1beta1.ServiceCIDRStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_k8sio_api_networking_v1beta1_ServiceCIDRList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ServiceCIDRList contains a list of ServiceCIDR objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items is the list of ServiceCIDRs.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/networking/v1beta1.ServiceCIDR"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/networking/v1beta1.ServiceCIDR", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_k8sio_api_networking_v1beta1_ServiceCIDRSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ServiceCIDRSpec define the CIDRs the user wants to use for allocating ClusterIPs for Services.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "cidrs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "CIDRs defines the IP blocks in CIDR notation (e.g. \"192.168.0.0/24\" or \"2001:db8::/64\") from which to assign service cluster IPs. Max of two CIDRs is allowed, one of each IP family. This field is immutable.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_k8sio_api_networking_v1beta1_ServiceCIDRStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ServiceCIDRStatus describes the current state of the ServiceCIDR.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions holds an array of metav1.Condition that describe the state of the ServiceCIDR. Current service state", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, + } +} + func schema_k8sio_api_node_v1alpha1_Overhead(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -66130,13 +66110,144 @@ func schema_k8sio_api_storage_v1beta1_StorageClassList(ref common.ReferenceCallb }, "items": { SchemaProps: spec.SchemaProps{ - Description: "items is the list of StorageClasses", + Description: "items is the list of StorageClasses", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/storage/v1beta1.StorageClass"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/storage/v1beta1.StorageClass", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_k8sio_api_storage_v1beta1_TokenRequest(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TokenRequest contains parameters of a service account token.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "audience": { + SchemaProps: spec.SchemaProps{ + Description: "audience is the intended audience of the token in \"TokenRequestSpec\". It will default to the audiences of kube apiserver.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "expirationSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "expirationSeconds is the duration of validity of the token in \"TokenRequestSpec\". It has the same default value of \"ExpirationSeconds\" in \"TokenRequestSpec\"", + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + Required: []string{"audience"}, + }, + }, + } +} + +func schema_k8sio_api_storage_v1beta1_VolumeAttachment(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node.\n\nVolumeAttachment objects are non-namespaced.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec represents specification of the desired attach/detach volume behavior. Populated by the Kubernetes system.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/storage/v1beta1.VolumeAttachmentSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status represents status of the VolumeAttachment request. Populated by the entity completing the attach or detach operation, i.e. the external-attacher.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/storage/v1beta1.VolumeAttachmentStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/storage/v1beta1.VolumeAttachmentSpec", "k8s.io/api/storage/v1beta1.VolumeAttachmentStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_k8sio_api_storage_v1beta1_VolumeAttachmentList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VolumeAttachmentList is a collection of VolumeAttachment objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard list metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items is the list of VolumeAttachments", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/storage/v1beta1.StorageClass"), + Ref: ref("k8s.io/api/storage/v1beta1.VolumeAttachment"), }, }, }, @@ -66147,257 +66258,238 @@ func schema_k8sio_api_storage_v1beta1_StorageClassList(ref common.ReferenceCallb }, }, Dependencies: []string{ - "k8s.io/api/storage/v1beta1.StorageClass", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + "k8s.io/api/storage/v1beta1.VolumeAttachment", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_k8sio_api_storage_v1beta1_TokenRequest(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_storage_v1beta1_VolumeAttachmentSource(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "TokenRequest contains parameters of a service account token.", + Description: "VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "audience": { + "persistentVolumeName": { SchemaProps: spec.SchemaProps{ - Description: "audience is the intended audience of the token in \"TokenRequestSpec\". It will default to the audiences of kube apiserver.", - Default: "", + Description: "persistentVolumeName represents the name of the persistent volume to attach.", Type: []string{"string"}, Format: "", }, }, - "expirationSeconds": { + "inlineVolumeSpec": { SchemaProps: spec.SchemaProps{ - Description: "expirationSeconds is the duration of validity of the token in \"TokenRequestSpec\". It has the same default value of \"ExpirationSeconds\" in \"TokenRequestSpec\"", - Type: []string{"integer"}, - Format: "int64", + Description: "inlineVolumeSpec contains all the information necessary to attach a persistent volume defined by a pod's inline VolumeSource. This field is populated only for the CSIMigration feature. It contains translated fields from a pod's inline VolumeSource to a PersistentVolumeSpec. This field is beta-level and is only honored by servers that enabled the CSIMigration feature.", + Ref: ref("k8s.io/api/core/v1.PersistentVolumeSpec"), }, }, }, - Required: []string{"audience"}, }, }, + Dependencies: []string{ + "k8s.io/api/core/v1.PersistentVolumeSpec"}, } } -func schema_k8sio_api_storage_v1beta1_VolumeAttachment(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_storage_v1beta1_VolumeAttachmentSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node.\n\nVolumeAttachment objects are non-namespaced.", + Description: "VolumeAttachmentSpec is the specification of a VolumeAttachment request.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { + "attacher": { SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Description: "attacher indicates the name of the volume driver that MUST handle this request. This is the name returned by GetPluginName().", + Default: "", Type: []string{"string"}, Format: "", }, }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { + "source": { SchemaProps: spec.SchemaProps{ - Description: "spec represents specification of the desired attach/detach volume behavior. Populated by the Kubernetes system.", + Description: "source represents the volume that should be attached.", Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/storage/v1beta1.VolumeAttachmentSpec"), + Ref: ref("k8s.io/api/storage/v1beta1.VolumeAttachmentSource"), }, }, - "status": { + "nodeName": { SchemaProps: spec.SchemaProps{ - Description: "status represents status of the VolumeAttachment request. Populated by the entity completing the attach or detach operation, i.e. the external-attacher.", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/storage/v1beta1.VolumeAttachmentStatus"), + Description: "nodeName represents the node that the volume should be attached to.", + Default: "", + Type: []string{"string"}, + Format: "", }, }, }, - Required: []string{"spec"}, + Required: []string{"attacher", "source", "nodeName"}, }, }, Dependencies: []string{ - "k8s.io/api/storage/v1beta1.VolumeAttachmentSpec", "k8s.io/api/storage/v1beta1.VolumeAttachmentStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "k8s.io/api/storage/v1beta1.VolumeAttachmentSource"}, } } -func schema_k8sio_api_storage_v1beta1_VolumeAttachmentList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_storage_v1beta1_VolumeAttachmentStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "VolumeAttachmentList is a collection of VolumeAttachment objects.", + Description: "VolumeAttachmentStatus is the status of a VolumeAttachment request.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { + "attached": { SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, + Description: "attached indicates the volume is successfully attached. This field must only be set by the entity completing the attach operation, i.e. the external-attacher.", + Default: false, + Type: []string{"boolean"}, Format: "", }, }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { + "attachmentMetadata": { SchemaProps: spec.SchemaProps{ - Description: "items is the list of VolumeAttachments", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ + Description: "attachmentMetadata is populated with any information returned by the attach operation, upon successful attach, that must be passed into subsequent WaitForAttach or Mount calls. This field must only be set by the entity completing the attach operation, i.e. the external-attacher.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/storage/v1beta1.VolumeAttachment"), + Default: "", + Type: []string{"string"}, + Format: "", }, }, }, }, }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/storage/v1beta1.VolumeAttachment", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_storage_v1beta1_VolumeAttachmentSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "persistentVolumeName": { + "attachError": { SchemaProps: spec.SchemaProps{ - Description: "persistentVolumeName represents the name of the persistent volume to attach.", - Type: []string{"string"}, - Format: "", + Description: "attachError represents the last error encountered during attach operation, if any. This field must only be set by the entity completing the attach operation, i.e. the external-attacher.", + Ref: ref("k8s.io/api/storage/v1beta1.VolumeError"), }, }, - "inlineVolumeSpec": { + "detachError": { SchemaProps: spec.SchemaProps{ - Description: "inlineVolumeSpec contains all the information necessary to attach a persistent volume defined by a pod's inline VolumeSource. This field is populated only for the CSIMigration feature. It contains translated fields from a pod's inline VolumeSource to a PersistentVolumeSpec. This field is beta-level and is only honored by servers that enabled the CSIMigration feature.", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeSpec"), + Description: "detachError represents the last error encountered during detach operation, if any. This field must only be set by the entity completing the detach operation, i.e. the external-attacher.", + Ref: ref("k8s.io/api/storage/v1beta1.VolumeError"), }, }, }, + Required: []string{"attached"}, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeSpec"}, + "k8s.io/api/storage/v1beta1.VolumeError"}, } } -func schema_k8sio_api_storage_v1beta1_VolumeAttachmentSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_storage_v1beta1_VolumeAttributesClass(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "VolumeAttachmentSpec is the specification of a VolumeAttachment request.", + Description: "VolumeAttributesClass represents a specification of mutable volume attributes defined by the CSI driver. The class can be specified during dynamic provisioning of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "attacher": { + "kind": { SchemaProps: spec.SchemaProps{ - Description: "attacher indicates the name of the volume driver that MUST handle this request. This is the name returned by GetPluginName().", - Default: "", + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", Type: []string{"string"}, Format: "", }, }, - "source": { + "apiVersion": { SchemaProps: spec.SchemaProps{ - Description: "source represents the volume that should be attached.", + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/storage/v1beta1.VolumeAttachmentSource"), + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, - "nodeName": { + "driverName": { SchemaProps: spec.SchemaProps{ - Description: "nodeName represents the node that the volume should be attached to.", + Description: "Name of the CSI driver This field is immutable.", Default: "", Type: []string{"string"}, Format: "", }, }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "parameters hold volume attributes defined by the CSI driver. These values are opaque to the Kubernetes and are passed directly to the CSI driver. The underlying storage provider supports changing these attributes on an existing volume, however the parameters field itself is immutable. To invoke a volume update, a new VolumeAttributesClass should be created with new parameters, and the PersistentVolumeClaim should be updated to reference the new VolumeAttributesClass.\n\nThis field is required and must contain at least one key/value pair. The keys cannot be empty, and the maximum number of parameters is 512, with a cumulative max size of 256K. If the CSI driver rejects invalid parameters, the target PersistentVolumeClaim will be set to an \"Infeasible\" state in the modifyVolumeStatus field.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, }, - Required: []string{"attacher", "source", "nodeName"}, + Required: []string{"driverName"}, }, }, Dependencies: []string{ - "k8s.io/api/storage/v1beta1.VolumeAttachmentSource"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_k8sio_api_storage_v1beta1_VolumeAttachmentStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_storage_v1beta1_VolumeAttributesClassList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "VolumeAttachmentStatus is the status of a VolumeAttachment request.", + Description: "VolumeAttributesClassList is a collection of VolumeAttributesClass objects.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "attached": { + "kind": { SchemaProps: spec.SchemaProps{ - Description: "attached indicates the volume is successfully attached. This field must only be set by the entity completing the attach operation, i.e. the external-attacher.", - Default: false, - Type: []string{"boolean"}, + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, Format: "", }, }, - "attachmentMetadata": { + "apiVersion": { SchemaProps: spec.SchemaProps{ - Description: "attachmentMetadata is populated with any information returned by the attach operation, upon successful attach, that must be passed into subsequent WaitForAttach or Mount calls. This field must only be set by the entity completing the attach operation, i.e. the external-attacher.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", }, }, - "attachError": { + "metadata": { SchemaProps: spec.SchemaProps{ - Description: "attachError represents the last error encountered during attach operation, if any. This field must only be set by the entity completing the attach operation, i.e. the external-attacher.", - Ref: ref("k8s.io/api/storage/v1beta1.VolumeError"), + Description: "Standard list metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, - "detachError": { + "items": { SchemaProps: spec.SchemaProps{ - Description: "detachError represents the last error encountered during detach operation, if any. This field must only be set by the entity completing the detach operation, i.e. the external-attacher.", - Ref: ref("k8s.io/api/storage/v1beta1.VolumeError"), + Description: "items is the list of VolumeAttributesClass objects.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/storage/v1beta1.VolumeAttributesClass"), + }, + }, + }, }, }, }, - Required: []string{"attached"}, + Required: []string{"items"}, }, }, Dependencies: []string{ - "k8s.io/api/storage/v1beta1.VolumeError"}, + "k8s.io/api/storage/v1beta1.VolumeAttributesClass", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -67144,8 +67236,58 @@ func schema_pkg_apis_meta_v1_Duration(ref common.ReferenceCallback) common.OpenA Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Description: "Duration is a wrapper around time.Duration which supports correct marshaling to YAML and JSON. In particular, it marshals into strings, which can be used as map keys in json.", - Type: v1.Duration{}.OpenAPISchemaType(), - Format: v1.Duration{}.OpenAPISchemaFormat(), + Type: metav1.Duration{}.OpenAPISchemaType(), + Format: metav1.Duration{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Description: "key is the field selector key that the requirement applies to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "operator": { + SchemaProps: spec.SchemaProps{ + Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "values": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"key", "operator"}, }, }, } @@ -67769,8 +67911,8 @@ func schema_pkg_apis_meta_v1_MicroTime(ref common.ReferenceCallback) common.Open Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Description: "MicroTime is version of Time with microsecond level precision.", - Type: v1.MicroTime{}.OpenAPISchemaType(), - Format: v1.MicroTime{}.OpenAPISchemaFormat(), + Type: metav1.MicroTime{}.OpenAPISchemaType(), + Format: metav1.MicroTime{}.OpenAPISchemaFormat(), }, }, } @@ -68727,8 +68869,8 @@ func schema_pkg_apis_meta_v1_Time(ref common.ReferenceCallback) common.OpenAPIDe Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Description: "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.", - Type: v1.Time{}.OpenAPISchemaType(), - Format: v1.Time{}.OpenAPISchemaFormat(), + Type: metav1.Time{}.OpenAPISchemaType(), + Format: metav1.Time{}.OpenAPISchemaFormat(), }, }, }