From f5d3a73270ff9d4ceea00f33fb1583227b7d67c7 Mon Sep 17 00:00:00 2001 From: Ramon de Klein Date: Wed, 16 Oct 2024 16:18:55 +0200 Subject: [PATCH 1/3] upgrade k8s API and code generators tp v0.31.1 --- go.mod | 13 +- go.sum | 40 ++-- .../minio.min.io/v2/bucket.go | 4 +- .../minio.min.io/v2/certificateconfig.go | 4 +- .../minio.min.io/v2/certificatestatus.go | 4 +- .../v2/customcertificateconfig.go | 4 +- .../minio.min.io/v2/customcertificates.go | 4 +- .../minio.min.io/v2/exposeservices.go | 4 +- .../minio.min.io/v2/features.go | 4 +- .../minio.min.io/v2/kesconfig.go | 4 +- .../v2/localcertificatereference.go | 4 +- .../minio.min.io/v2/logging.go | 4 +- .../minio.min.io/v2/pool.go | 4 +- .../minio.min.io/v2/poolstatus.go | 4 +- .../minio.min.io/v2/servicemetadata.go | 4 +- .../minio.min.io/v2/sidecars.go | 4 +- .../minio.min.io/v2/tenant.go | 10 +- .../minio.min.io/v2/tenantdomains.go | 4 +- .../minio.min.io/v2/tenantscheduler.go | 4 +- .../minio.min.io/v2/tenantspec.go | 4 +- .../minio.min.io/v2/tenantstatus.go | 4 +- .../minio.min.io/v2/tenantusage.go | 4 +- .../minio.min.io/v2/tierusage.go | 4 +- .../sts.min.io/v1alpha1/application.go | 4 +- .../sts.min.io/v1alpha1/policybinding.go | 10 +- .../sts.min.io/v1alpha1/policybindingspec.go | 4 +- .../v1alpha1/policybindingstatus.go | 4 +- .../sts.min.io/v1alpha1/policybindingusage.go | 4 +- .../sts.min.io/v1beta1/application.go | 4 +- .../sts.min.io/v1beta1/policybinding.go | 10 +- .../sts.min.io/v1beta1/policybindingspec.go | 4 +- .../sts.min.io/v1beta1/policybindingstatus.go | 4 +- .../sts.min.io/v1beta1/policybindingusage.go | 4 +- pkg/client/applyconfiguration/utils.go | 7 + .../versioned/fake/clientset_generated.go | 39 +++- .../typed/minio.min.io/v2/fake/fake_tenant.go | 46 ++-- .../versioned/typed/minio.min.io/v2/tenant.go | 205 +----------------- .../v1alpha1/fake/fake_policybinding.go | 46 ++-- .../sts.min.io/v1alpha1/policybinding.go | 205 +----------------- .../v1beta1/fake/fake_policybinding.go | 46 ++-- .../typed/sts.min.io/v1beta1/policybinding.go | 205 +----------------- .../informers/externalversions/factory.go | 1 + pkg/client/listers/minio.min.io/v2/tenant.go | 39 +--- .../sts.min.io/v1alpha1/policybinding.go | 39 +--- .../sts.min.io/v1beta1/policybinding.go | 39 +--- 45 files changed, 287 insertions(+), 825 deletions(-) diff --git a/go.mod b/go.mod index f398ce04147..32130080ea9 100644 --- a/go.mod +++ b/go.mod @@ -34,12 +34,12 @@ require ( golang.org/x/text v0.18.0 // indirect golang.org/x/time v0.5.0 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.30.2 - k8s.io/apimachinery v0.30.2 - k8s.io/client-go v0.30.2 - k8s.io/code-generator v0.30.2 + k8s.io/api v0.31.1 + k8s.io/apimachinery v0.31.1 + k8s.io/client-go v0.31.1 + k8s.io/code-generator v0.31.1 k8s.io/klog/v2 v2.130.1 - k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 ) @@ -61,6 +61,7 @@ require ( github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/evanphx/json-patch v5.9.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect @@ -112,6 +113,7 @@ require ( github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect github.com/vbatts/tar-split v0.11.5 // indirect + github.com/x448/float16 v0.8.4 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 // indirect @@ -120,6 +122,7 @@ require ( golang.org/x/term v0.24.0 // indirect golang.org/x/tools v0.22.0 // 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/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 6b3dd88c14f..51ae63c80c8 100644 --- a/go.sum +++ b/go.sum @@ -31,6 +31,8 @@ github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0 github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= @@ -73,8 +75,8 @@ github.com/google/go-containerregistry v0.19.2/go.mod h1:YCMFNQeeXeLF+dnhhWkqDIt github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= 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/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= @@ -147,8 +149,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g= -github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= @@ -178,8 +180,8 @@ github.com/prometheus/prom2json v1.3.3 h1:IYfSMiZ7sSOfliBoo89PcufjWO4eAR0gznGcET github.com/prometheus/prom2json v1.3.3/go.mod h1:Pv4yIPktEkK7btWsrUTWDDDrnpUrAELaOCj+oFwlgmc= github.com/rjeczalik/notify v0.9.3 h1:6rJAzHTGKXGj76sbRgDiDcYj/HniypXmSJo1SWakZeY= github.com/rjeczalik/notify v0.9.3/go.mod h1:gF3zSOrafR9DQEWSE8TjfI9NkooDxbyT4UgRGKZA0lc= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/safchain/ethtool v0.4.1 h1:S6mEleTADqgynileXoiapt/nKnatyR6bmIHoF+h2ADo= @@ -216,11 +218,15 @@ github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYg github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE= github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= +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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +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= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= @@ -320,6 +326,8 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn 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/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= @@ -334,24 +342,24 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= -k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= +k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= +k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= k8s.io/apiextensions-apiserver v0.30.2 h1:l7Eue2t6QiLHErfn2vwK4KgF4NeDgjQkCXtEbOocKIE= k8s.io/apiextensions-apiserver v0.30.2/go.mod h1:lsJFLYyK40iguuinsb3nt+Sj6CmodSI4ACDLep1rgjw= -k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= -k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= -k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= -k8s.io/code-generator v0.30.2 h1:ZY1+aGkqZVwKIyGsOzquaeZ5rSfE6wZHur8z3jQAaiw= -k8s.io/code-generator v0.30.2/go.mod h1:RQP5L67QxqgkVquk704CyvWFIq0e6RCMmLTXxjE8dVA= +k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= +k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= +k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= +k8s.io/code-generator v0.31.1 h1:GvkRZEP2g2UnB2QKT2Dgc/kYxIkDxCHENv2Q1itioVs= +k8s.io/code-generator v0.31.1/go.mod h1:oL2ky46L48osNqqZAeOcWWy0S5BXj50vVdwOtTefqIs= k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= 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-20240620174524-b456828f718b h1:Q9xmGWBvOGd8UJyccgpYlLosk/JlfP3xQLNkQlHJeXw= k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b/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= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw= sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/bucket.go b/pkg/client/applyconfiguration/minio.min.io/v2/bucket.go index 6ab692a33ad..1795a9aede0 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/bucket.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/bucket.go @@ -18,7 +18,7 @@ package v2 -// BucketApplyConfiguration represents an declarative configuration of the Bucket type for use +// BucketApplyConfiguration represents a declarative configuration of the Bucket type for use // with apply. type BucketApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -26,7 +26,7 @@ type BucketApplyConfiguration struct { ObjectLocking *bool `json:"objectLock,omitempty"` } -// BucketApplyConfiguration constructs an declarative configuration of the Bucket type for use with +// BucketApplyConfiguration constructs a declarative configuration of the Bucket type for use with // apply. func Bucket() *BucketApplyConfiguration { return &BucketApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/certificateconfig.go b/pkg/client/applyconfiguration/minio.min.io/v2/certificateconfig.go index 2116c0039b1..115b40252c0 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/certificateconfig.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/certificateconfig.go @@ -18,7 +18,7 @@ package v2 -// CertificateConfigApplyConfiguration represents an declarative configuration of the CertificateConfig type for use +// CertificateConfigApplyConfiguration represents a declarative configuration of the CertificateConfig type for use // with apply. type CertificateConfigApplyConfiguration struct { CommonName *string `json:"commonName,omitempty"` @@ -26,7 +26,7 @@ type CertificateConfigApplyConfiguration struct { DNSNames []string `json:"dnsNames,omitempty"` } -// CertificateConfigApplyConfiguration constructs an declarative configuration of the CertificateConfig type for use with +// CertificateConfigApplyConfiguration constructs a declarative configuration of the CertificateConfig type for use with // apply. func CertificateConfig() *CertificateConfigApplyConfiguration { return &CertificateConfigApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/certificatestatus.go b/pkg/client/applyconfiguration/minio.min.io/v2/certificatestatus.go index beae2039146..e36ac8a0c4a 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/certificatestatus.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/certificatestatus.go @@ -18,14 +18,14 @@ package v2 -// CertificateStatusApplyConfiguration represents an declarative configuration of the CertificateStatus type for use +// CertificateStatusApplyConfiguration represents a declarative configuration of the CertificateStatus type for use // with apply. type CertificateStatusApplyConfiguration struct { AutoCertEnabled *bool `json:"autoCertEnabled,omitempty"` CustomCertificates *CustomCertificatesApplyConfiguration `json:"customCertificates,omitempty"` } -// CertificateStatusApplyConfiguration constructs an declarative configuration of the CertificateStatus type for use with +// CertificateStatusApplyConfiguration constructs a declarative configuration of the CertificateStatus type for use with // apply. func CertificateStatus() *CertificateStatusApplyConfiguration { return &CertificateStatusApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/customcertificateconfig.go b/pkg/client/applyconfiguration/minio.min.io/v2/customcertificateconfig.go index e4638b913b2..db4aa60b496 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/customcertificateconfig.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/customcertificateconfig.go @@ -18,7 +18,7 @@ package v2 -// CustomCertificateConfigApplyConfiguration represents an declarative configuration of the CustomCertificateConfig type for use +// CustomCertificateConfigApplyConfiguration represents a declarative configuration of the CustomCertificateConfig type for use // with apply. type CustomCertificateConfigApplyConfiguration struct { CertName *string `json:"certName,omitempty"` @@ -28,7 +28,7 @@ type CustomCertificateConfigApplyConfiguration struct { SerialNo *string `json:"serialNo,omitempty"` } -// CustomCertificateConfigApplyConfiguration constructs an declarative configuration of the CustomCertificateConfig type for use with +// CustomCertificateConfigApplyConfiguration constructs a declarative configuration of the CustomCertificateConfig type for use with // apply. func CustomCertificateConfig() *CustomCertificateConfigApplyConfiguration { return &CustomCertificateConfigApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/customcertificates.go b/pkg/client/applyconfiguration/minio.min.io/v2/customcertificates.go index fdce47b53f7..4ea5d95aced 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/customcertificates.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/customcertificates.go @@ -22,7 +22,7 @@ import ( v2 "github.com/minio/operator/pkg/apis/minio.min.io/v2" ) -// CustomCertificatesApplyConfiguration represents an declarative configuration of the CustomCertificates type for use +// CustomCertificatesApplyConfiguration represents a declarative configuration of the CustomCertificates type for use // with apply. type CustomCertificatesApplyConfiguration struct { Client []*v2.CustomCertificateConfig `json:"client,omitempty"` @@ -30,7 +30,7 @@ type CustomCertificatesApplyConfiguration struct { MinioCAs []*v2.CustomCertificateConfig `json:"minioCAs,omitempty"` } -// CustomCertificatesApplyConfiguration constructs an declarative configuration of the CustomCertificates type for use with +// CustomCertificatesApplyConfiguration constructs a declarative configuration of the CustomCertificates type for use with // apply. func CustomCertificates() *CustomCertificatesApplyConfiguration { return &CustomCertificatesApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/exposeservices.go b/pkg/client/applyconfiguration/minio.min.io/v2/exposeservices.go index 56ae87889a5..738c7808cfc 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/exposeservices.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/exposeservices.go @@ -18,14 +18,14 @@ package v2 -// ExposeServicesApplyConfiguration represents an declarative configuration of the ExposeServices type for use +// ExposeServicesApplyConfiguration represents a declarative configuration of the ExposeServices type for use // with apply. type ExposeServicesApplyConfiguration struct { MinIO *bool `json:"minio,omitempty"` Console *bool `json:"console,omitempty"` } -// ExposeServicesApplyConfiguration constructs an declarative configuration of the ExposeServices type for use with +// ExposeServicesApplyConfiguration constructs a declarative configuration of the ExposeServices type for use with // apply. func ExposeServices() *ExposeServicesApplyConfiguration { return &ExposeServicesApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/features.go b/pkg/client/applyconfiguration/minio.min.io/v2/features.go index 386b484ce14..bde51b7d7d2 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/features.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/features.go @@ -18,7 +18,7 @@ package v2 -// FeaturesApplyConfiguration represents an declarative configuration of the Features type for use +// FeaturesApplyConfiguration represents a declarative configuration of the Features type for use // with apply. type FeaturesApplyConfiguration struct { BucketDNS *bool `json:"bucketDNS,omitempty"` @@ -26,7 +26,7 @@ type FeaturesApplyConfiguration struct { EnableSFTP *bool `json:"enableSFTP,omitempty"` } -// FeaturesApplyConfiguration constructs an declarative configuration of the Features type for use with +// FeaturesApplyConfiguration constructs a declarative configuration of the Features type for use with // apply. func Features() *FeaturesApplyConfiguration { return &FeaturesApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/kesconfig.go b/pkg/client/applyconfiguration/minio.min.io/v2/kesconfig.go index 888adaaf9fb..7f0e7e5b689 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/kesconfig.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/kesconfig.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// KESConfigApplyConfiguration represents an declarative configuration of the KESConfig type for use +// KESConfigApplyConfiguration represents a declarative configuration of the KESConfig type for use // with apply. type KESConfigApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -47,7 +47,7 @@ type KESConfigApplyConfiguration struct { Env []v1.EnvVar `json:"env,omitempty"` } -// KESConfigApplyConfiguration constructs an declarative configuration of the KESConfig type for use with +// KESConfigApplyConfiguration constructs a declarative configuration of the KESConfig type for use with // apply. func KESConfig() *KESConfigApplyConfiguration { return &KESConfigApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/localcertificatereference.go b/pkg/client/applyconfiguration/minio.min.io/v2/localcertificatereference.go index ec9592c99b0..b4578768c15 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/localcertificatereference.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/localcertificatereference.go @@ -18,14 +18,14 @@ package v2 -// LocalCertificateReferenceApplyConfiguration represents an declarative configuration of the LocalCertificateReference type for use +// LocalCertificateReferenceApplyConfiguration represents a declarative configuration of the LocalCertificateReference type for use // with apply. type LocalCertificateReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` Type *string `json:"type,omitempty"` } -// LocalCertificateReferenceApplyConfiguration constructs an declarative configuration of the LocalCertificateReference type for use with +// LocalCertificateReferenceApplyConfiguration constructs a declarative configuration of the LocalCertificateReference type for use with // apply. func LocalCertificateReference() *LocalCertificateReferenceApplyConfiguration { return &LocalCertificateReferenceApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/logging.go b/pkg/client/applyconfiguration/minio.min.io/v2/logging.go index a5d059a1a1e..ddd9af1be57 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/logging.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/logging.go @@ -18,7 +18,7 @@ package v2 -// LoggingApplyConfiguration represents an declarative configuration of the Logging type for use +// LoggingApplyConfiguration represents a declarative configuration of the Logging type for use // with apply. type LoggingApplyConfiguration struct { JSON *bool `json:"json,omitempty"` @@ -26,7 +26,7 @@ type LoggingApplyConfiguration struct { Quiet *bool `json:"quiet,omitempty"` } -// LoggingApplyConfiguration constructs an declarative configuration of the Logging type for use with +// LoggingApplyConfiguration constructs a declarative configuration of the Logging type for use with // apply. func Logging() *LoggingApplyConfiguration { return &LoggingApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/pool.go b/pkg/client/applyconfiguration/minio.min.io/v2/pool.go index d466b44569b..ea637ea65bd 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/pool.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/pool.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// PoolApplyConfiguration represents an declarative configuration of the Pool type for use +// PoolApplyConfiguration represents a declarative configuration of the Pool type for use // with apply. type PoolApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -41,7 +41,7 @@ type PoolApplyConfiguration struct { RuntimeClassName *string `json:"runtimeClassName,omitempty"` } -// PoolApplyConfiguration constructs an declarative configuration of the Pool type for use with +// PoolApplyConfiguration constructs a declarative configuration of the Pool type for use with // apply. func Pool() *PoolApplyConfiguration { return &PoolApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/poolstatus.go b/pkg/client/applyconfiguration/minio.min.io/v2/poolstatus.go index 881c0599054..217a3e15248 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/poolstatus.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/poolstatus.go @@ -22,7 +22,7 @@ import ( v2 "github.com/minio/operator/pkg/apis/minio.min.io/v2" ) -// PoolStatusApplyConfiguration represents an declarative configuration of the PoolStatus type for use +// PoolStatusApplyConfiguration represents a declarative configuration of the PoolStatus type for use // with apply. type PoolStatusApplyConfiguration struct { SSName *string `json:"ssName,omitempty"` @@ -30,7 +30,7 @@ type PoolStatusApplyConfiguration struct { LegacySecurityContext *bool `json:"legacySecurityContext,omitempty"` } -// PoolStatusApplyConfiguration constructs an declarative configuration of the PoolStatus type for use with +// PoolStatusApplyConfiguration constructs a declarative configuration of the PoolStatus type for use with // apply. func PoolStatus() *PoolStatusApplyConfiguration { return &PoolStatusApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/servicemetadata.go b/pkg/client/applyconfiguration/minio.min.io/v2/servicemetadata.go index c1a30275ee4..d04cadf13c7 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/servicemetadata.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/servicemetadata.go @@ -18,7 +18,7 @@ package v2 -// ServiceMetadataApplyConfiguration represents an declarative configuration of the ServiceMetadata type for use +// ServiceMetadataApplyConfiguration represents a declarative configuration of the ServiceMetadata type for use // with apply. type ServiceMetadataApplyConfiguration struct { MinIOServiceLabels map[string]string `json:"minioServiceLabels,omitempty"` @@ -27,7 +27,7 @@ type ServiceMetadataApplyConfiguration struct { ConsoleServiceAnnotations map[string]string `json:"consoleServiceAnnotations,omitempty"` } -// ServiceMetadataApplyConfiguration constructs an declarative configuration of the ServiceMetadata type for use with +// ServiceMetadataApplyConfiguration constructs a declarative configuration of the ServiceMetadata type for use with // apply. func ServiceMetadata() *ServiceMetadataApplyConfiguration { return &ServiceMetadataApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/sidecars.go b/pkg/client/applyconfiguration/minio.min.io/v2/sidecars.go index 1849d49216b..fb62e9bd38b 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/sidecars.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/sidecars.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// SideCarsApplyConfiguration represents an declarative configuration of the SideCars type for use +// SideCarsApplyConfiguration represents a declarative configuration of the SideCars type for use // with apply. type SideCarsApplyConfiguration struct { Containers []v1.Container `json:"containers,omitempty"` @@ -31,7 +31,7 @@ type SideCarsApplyConfiguration struct { Resources *v1.ResourceRequirements `json:"resources,omitempty"` } -// SideCarsApplyConfiguration constructs an declarative configuration of the SideCars type for use with +// SideCarsApplyConfiguration constructs a declarative configuration of the SideCars type for use with // apply. func SideCars() *SideCarsApplyConfiguration { return &SideCarsApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/tenant.go b/pkg/client/applyconfiguration/minio.min.io/v2/tenant.go index afd1c57cec2..40a222fd902 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/tenant.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/tenant.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// TenantApplyConfiguration represents an declarative configuration of the Tenant type for use +// TenantApplyConfiguration represents a declarative configuration of the Tenant type for use // with apply. type TenantApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -34,7 +34,7 @@ type TenantApplyConfiguration struct { Status *TenantStatusApplyConfiguration `json:"status,omitempty"` } -// Tenant constructs an declarative configuration of the Tenant type for use with +// Tenant constructs a declarative configuration of the Tenant type for use with // apply. func Tenant(name, namespace string) *TenantApplyConfiguration { b := &TenantApplyConfiguration{} @@ -226,3 +226,9 @@ func (b *TenantApplyConfiguration) WithStatus(value *TenantStatusApplyConfigurat b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *TenantApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/tenantdomains.go b/pkg/client/applyconfiguration/minio.min.io/v2/tenantdomains.go index c2525e92a1b..b3f755da7b8 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/tenantdomains.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/tenantdomains.go @@ -18,14 +18,14 @@ package v2 -// TenantDomainsApplyConfiguration represents an declarative configuration of the TenantDomains type for use +// TenantDomainsApplyConfiguration represents a declarative configuration of the TenantDomains type for use // with apply. type TenantDomainsApplyConfiguration struct { Minio []string `json:"minio,omitempty"` Console *string `json:"console,omitempty"` } -// TenantDomainsApplyConfiguration constructs an declarative configuration of the TenantDomains type for use with +// TenantDomainsApplyConfiguration constructs a declarative configuration of the TenantDomains type for use with // apply. func TenantDomains() *TenantDomainsApplyConfiguration { return &TenantDomainsApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/tenantscheduler.go b/pkg/client/applyconfiguration/minio.min.io/v2/tenantscheduler.go index b2d240610b5..b8856afbe81 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/tenantscheduler.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/tenantscheduler.go @@ -18,13 +18,13 @@ package v2 -// TenantSchedulerApplyConfiguration represents an declarative configuration of the TenantScheduler type for use +// TenantSchedulerApplyConfiguration represents a declarative configuration of the TenantScheduler type for use // with apply. type TenantSchedulerApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// TenantSchedulerApplyConfiguration constructs an declarative configuration of the TenantScheduler type for use with +// TenantSchedulerApplyConfiguration constructs a declarative configuration of the TenantScheduler type for use with // apply. func TenantScheduler() *TenantSchedulerApplyConfiguration { return &TenantSchedulerApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/tenantspec.go b/pkg/client/applyconfiguration/minio.min.io/v2/tenantspec.go index abc30b5c57d..a4f9f955875 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/tenantspec.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/tenantspec.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// TenantSpecApplyConfiguration represents an declarative configuration of the TenantSpec type for use +// TenantSpecApplyConfiguration represents a declarative configuration of the TenantSpec type for use // with apply. type TenantSpecApplyConfiguration struct { Pools []PoolApplyConfiguration `json:"pools,omitempty"` @@ -63,7 +63,7 @@ type TenantSpecApplyConfiguration struct { AdditionalVolumeMounts []v1.VolumeMount `json:"additionalVolumeMounts,omitempty"` } -// TenantSpecApplyConfiguration constructs an declarative configuration of the TenantSpec type for use with +// TenantSpecApplyConfiguration constructs a declarative configuration of the TenantSpec type for use with // apply. func TenantSpec() *TenantSpecApplyConfiguration { return &TenantSpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/tenantstatus.go b/pkg/client/applyconfiguration/minio.min.io/v2/tenantstatus.go index d017570e919..a1bf084ba28 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/tenantstatus.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/tenantstatus.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// TenantStatusApplyConfiguration represents an declarative configuration of the TenantStatus type for use +// TenantStatusApplyConfiguration represents a declarative configuration of the TenantStatus type for use // with apply. type TenantStatusApplyConfiguration struct { CurrentState *string `json:"currentState,omitempty"` @@ -44,7 +44,7 @@ type TenantStatusApplyConfiguration struct { ProvisionedBuckets *bool `json:"provisionedBuckets,omitempty"` } -// TenantStatusApplyConfiguration constructs an declarative configuration of the TenantStatus type for use with +// TenantStatusApplyConfiguration constructs a declarative configuration of the TenantStatus type for use with // apply. func TenantStatus() *TenantStatusApplyConfiguration { return &TenantStatusApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/tenantusage.go b/pkg/client/applyconfiguration/minio.min.io/v2/tenantusage.go index 6a96cdf3a5a..317cc0ea26b 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/tenantusage.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/tenantusage.go @@ -18,7 +18,7 @@ package v2 -// TenantUsageApplyConfiguration represents an declarative configuration of the TenantUsage type for use +// TenantUsageApplyConfiguration represents a declarative configuration of the TenantUsage type for use // with apply. type TenantUsageApplyConfiguration struct { Capacity *int64 `json:"capacity,omitempty"` @@ -28,7 +28,7 @@ type TenantUsageApplyConfiguration struct { Tiers []TierUsageApplyConfiguration `json:"tiers,omitempty"` } -// TenantUsageApplyConfiguration constructs an declarative configuration of the TenantUsage type for use with +// TenantUsageApplyConfiguration constructs a declarative configuration of the TenantUsage type for use with // apply. func TenantUsage() *TenantUsageApplyConfiguration { return &TenantUsageApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/minio.min.io/v2/tierusage.go b/pkg/client/applyconfiguration/minio.min.io/v2/tierusage.go index 84dcffc1190..7edce7eaa4d 100644 --- a/pkg/client/applyconfiguration/minio.min.io/v2/tierusage.go +++ b/pkg/client/applyconfiguration/minio.min.io/v2/tierusage.go @@ -18,7 +18,7 @@ package v2 -// TierUsageApplyConfiguration represents an declarative configuration of the TierUsage type for use +// TierUsageApplyConfiguration represents a declarative configuration of the TierUsage type for use // with apply. type TierUsageApplyConfiguration struct { Name *string `json:"Name,omitempty"` @@ -26,7 +26,7 @@ type TierUsageApplyConfiguration struct { TotalSize *int64 `json:"totalSize,omitempty"` } -// TierUsageApplyConfiguration constructs an declarative configuration of the TierUsage type for use with +// TierUsageApplyConfiguration constructs a declarative configuration of the TierUsage type for use with // apply. func TierUsage() *TierUsageApplyConfiguration { return &TierUsageApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/sts.min.io/v1alpha1/application.go b/pkg/client/applyconfiguration/sts.min.io/v1alpha1/application.go index 81cab258a6e..87b9f2123dc 100644 --- a/pkg/client/applyconfiguration/sts.min.io/v1alpha1/application.go +++ b/pkg/client/applyconfiguration/sts.min.io/v1alpha1/application.go @@ -18,14 +18,14 @@ package v1alpha1 -// ApplicationApplyConfiguration represents an declarative configuration of the Application type for use +// ApplicationApplyConfiguration represents a declarative configuration of the Application type for use // with apply. type ApplicationApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` ServiceAccount *string `json:"serviceaccount,omitempty"` } -// ApplicationApplyConfiguration constructs an declarative configuration of the Application type for use with +// ApplicationApplyConfiguration constructs a declarative configuration of the Application type for use with // apply. func Application() *ApplicationApplyConfiguration { return &ApplicationApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybinding.go b/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybinding.go index 446d2ab2c38..abd80d8d8e5 100644 --- a/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybinding.go +++ b/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybinding.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PolicyBindingApplyConfiguration represents an declarative configuration of the PolicyBinding type for use +// PolicyBindingApplyConfiguration represents a declarative configuration of the PolicyBinding type for use // with apply. type PolicyBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -33,7 +33,7 @@ type PolicyBindingApplyConfiguration struct { Status *PolicyBindingStatusApplyConfiguration `json:"status,omitempty"` } -// PolicyBinding constructs an declarative configuration of the PolicyBinding type for use with +// PolicyBinding constructs a declarative configuration of the PolicyBinding type for use with // apply. func PolicyBinding(name, namespace string) *PolicyBindingApplyConfiguration { b := &PolicyBindingApplyConfiguration{} @@ -217,3 +217,9 @@ func (b *PolicyBindingApplyConfiguration) WithStatus(value *PolicyBindingStatusA b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PolicyBindingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybindingspec.go b/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybindingspec.go index c870a8bc787..4e863cac450 100644 --- a/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybindingspec.go +++ b/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybindingspec.go @@ -18,14 +18,14 @@ package v1alpha1 -// PolicyBindingSpecApplyConfiguration represents an declarative configuration of the PolicyBindingSpec type for use +// PolicyBindingSpecApplyConfiguration represents a declarative configuration of the PolicyBindingSpec type for use // with apply. type PolicyBindingSpecApplyConfiguration struct { Application *ApplicationApplyConfiguration `json:"application,omitempty"` Policies []string `json:"policies,omitempty"` } -// PolicyBindingSpecApplyConfiguration constructs an declarative configuration of the PolicyBindingSpec type for use with +// PolicyBindingSpecApplyConfiguration constructs a declarative configuration of the PolicyBindingSpec type for use with // apply. func PolicyBindingSpec() *PolicyBindingSpecApplyConfiguration { return &PolicyBindingSpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybindingstatus.go b/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybindingstatus.go index 121047337b0..c0f388f467d 100644 --- a/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybindingstatus.go +++ b/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybindingstatus.go @@ -18,14 +18,14 @@ package v1alpha1 -// PolicyBindingStatusApplyConfiguration represents an declarative configuration of the PolicyBindingStatus type for use +// PolicyBindingStatusApplyConfiguration represents a declarative configuration of the PolicyBindingStatus type for use // with apply. type PolicyBindingStatusApplyConfiguration struct { CurrentState *string `json:"currentState,omitempty"` Usage *PolicyBindingUsageApplyConfiguration `json:"usage,omitempty"` } -// PolicyBindingStatusApplyConfiguration constructs an declarative configuration of the PolicyBindingStatus type for use with +// PolicyBindingStatusApplyConfiguration constructs a declarative configuration of the PolicyBindingStatus type for use with // apply. func PolicyBindingStatus() *PolicyBindingStatusApplyConfiguration { return &PolicyBindingStatusApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybindingusage.go b/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybindingusage.go index 3973186f7e4..8d4457d5d1b 100644 --- a/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybindingusage.go +++ b/pkg/client/applyconfiguration/sts.min.io/v1alpha1/policybindingusage.go @@ -18,13 +18,13 @@ package v1alpha1 -// PolicyBindingUsageApplyConfiguration represents an declarative configuration of the PolicyBindingUsage type for use +// PolicyBindingUsageApplyConfiguration represents a declarative configuration of the PolicyBindingUsage type for use // with apply. type PolicyBindingUsageApplyConfiguration struct { Authorizations *int64 `json:"authotizations,omitempty"` } -// PolicyBindingUsageApplyConfiguration constructs an declarative configuration of the PolicyBindingUsage type for use with +// PolicyBindingUsageApplyConfiguration constructs a declarative configuration of the PolicyBindingUsage type for use with // apply. func PolicyBindingUsage() *PolicyBindingUsageApplyConfiguration { return &PolicyBindingUsageApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/sts.min.io/v1beta1/application.go b/pkg/client/applyconfiguration/sts.min.io/v1beta1/application.go index be14c2e74e2..c60caf2c57a 100644 --- a/pkg/client/applyconfiguration/sts.min.io/v1beta1/application.go +++ b/pkg/client/applyconfiguration/sts.min.io/v1beta1/application.go @@ -18,14 +18,14 @@ package v1beta1 -// ApplicationApplyConfiguration represents an declarative configuration of the Application type for use +// ApplicationApplyConfiguration represents a declarative configuration of the Application type for use // with apply. type ApplicationApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` ServiceAccount *string `json:"serviceaccount,omitempty"` } -// ApplicationApplyConfiguration constructs an declarative configuration of the Application type for use with +// ApplicationApplyConfiguration constructs a declarative configuration of the Application type for use with // apply. func Application() *ApplicationApplyConfiguration { return &ApplicationApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybinding.go b/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybinding.go index f597b79842f..545301dd942 100644 --- a/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybinding.go +++ b/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybinding.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PolicyBindingApplyConfiguration represents an declarative configuration of the PolicyBinding type for use +// PolicyBindingApplyConfiguration represents a declarative configuration of the PolicyBinding type for use // with apply. type PolicyBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -33,7 +33,7 @@ type PolicyBindingApplyConfiguration struct { Status *PolicyBindingStatusApplyConfiguration `json:"status,omitempty"` } -// PolicyBinding constructs an declarative configuration of the PolicyBinding type for use with +// PolicyBinding constructs a declarative configuration of the PolicyBinding type for use with // apply. func PolicyBinding(name, namespace string) *PolicyBindingApplyConfiguration { b := &PolicyBindingApplyConfiguration{} @@ -217,3 +217,9 @@ func (b *PolicyBindingApplyConfiguration) WithStatus(value *PolicyBindingStatusA b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PolicyBindingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybindingspec.go b/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybindingspec.go index b72dd0fd6ae..a07025ff977 100644 --- a/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybindingspec.go +++ b/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybindingspec.go @@ -18,14 +18,14 @@ package v1beta1 -// PolicyBindingSpecApplyConfiguration represents an declarative configuration of the PolicyBindingSpec type for use +// PolicyBindingSpecApplyConfiguration represents a declarative configuration of the PolicyBindingSpec type for use // with apply. type PolicyBindingSpecApplyConfiguration struct { Application *ApplicationApplyConfiguration `json:"application,omitempty"` Policies []string `json:"policies,omitempty"` } -// PolicyBindingSpecApplyConfiguration constructs an declarative configuration of the PolicyBindingSpec type for use with +// PolicyBindingSpecApplyConfiguration constructs a declarative configuration of the PolicyBindingSpec type for use with // apply. func PolicyBindingSpec() *PolicyBindingSpecApplyConfiguration { return &PolicyBindingSpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybindingstatus.go b/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybindingstatus.go index 9043171535c..04f9eee2a3b 100644 --- a/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybindingstatus.go +++ b/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybindingstatus.go @@ -18,14 +18,14 @@ package v1beta1 -// PolicyBindingStatusApplyConfiguration represents an declarative configuration of the PolicyBindingStatus type for use +// PolicyBindingStatusApplyConfiguration represents a declarative configuration of the PolicyBindingStatus type for use // with apply. type PolicyBindingStatusApplyConfiguration struct { CurrentState *string `json:"currentState,omitempty"` Usage *PolicyBindingUsageApplyConfiguration `json:"usage,omitempty"` } -// PolicyBindingStatusApplyConfiguration constructs an declarative configuration of the PolicyBindingStatus type for use with +// PolicyBindingStatusApplyConfiguration constructs a declarative configuration of the PolicyBindingStatus type for use with // apply. func PolicyBindingStatus() *PolicyBindingStatusApplyConfiguration { return &PolicyBindingStatusApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybindingusage.go b/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybindingusage.go index 1de3b632d44..a5bbf2103bf 100644 --- a/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybindingusage.go +++ b/pkg/client/applyconfiguration/sts.min.io/v1beta1/policybindingusage.go @@ -18,13 +18,13 @@ package v1beta1 -// PolicyBindingUsageApplyConfiguration represents an declarative configuration of the PolicyBindingUsage type for use +// PolicyBindingUsageApplyConfiguration represents a declarative configuration of the PolicyBindingUsage type for use // with apply. type PolicyBindingUsageApplyConfiguration struct { Authorizations *int64 `json:"authotizations,omitempty"` } -// PolicyBindingUsageApplyConfiguration constructs an declarative configuration of the PolicyBindingUsage type for use with +// PolicyBindingUsageApplyConfiguration constructs a declarative configuration of the PolicyBindingUsage type for use with // apply. func PolicyBindingUsage() *PolicyBindingUsageApplyConfiguration { return &PolicyBindingUsageApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/utils.go b/pkg/client/applyconfiguration/utils.go index ebcea32724f..98f3d786e06 100644 --- a/pkg/client/applyconfiguration/utils.go +++ b/pkg/client/applyconfiguration/utils.go @@ -22,10 +22,13 @@ import ( v2 "github.com/minio/operator/pkg/apis/minio.min.io/v2" v1alpha1 "github.com/minio/operator/pkg/apis/sts.min.io/v1alpha1" v1beta1 "github.com/minio/operator/pkg/apis/sts.min.io/v1beta1" + internal "github.com/minio/operator/pkg/client/applyconfiguration/internal" miniominiov2 "github.com/minio/operator/pkg/client/applyconfiguration/minio.min.io/v2" stsminiov1alpha1 "github.com/minio/operator/pkg/client/applyconfiguration/sts.min.io/v1alpha1" stsminiov1beta1 "github.com/minio/operator/pkg/client/applyconfiguration/sts.min.io/v1beta1" + runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + testing "k8s.io/client-go/testing" ) // ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no @@ -103,3 +106,7 @@ func ForKind(kind schema.GroupVersionKind) interface{} { } return nil } + +func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter { + return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()} +} diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index d0ec5adc5c3..eb1ca8aa10f 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -19,6 +19,7 @@ package fake import ( + applyconfiguration "github.com/minio/operator/pkg/client/applyconfiguration" clientset "github.com/minio/operator/pkg/client/clientset/versioned" miniov2 "github.com/minio/operator/pkg/client/clientset/versioned/typed/minio.min.io/v2" fakeminiov2 "github.com/minio/operator/pkg/client/clientset/versioned/typed/minio.min.io/v2/fake" @@ -35,8 +36,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 { @@ -78,6 +83,38 @@ func (c *Clientset) Tracker() testing.ObjectTracker { return c.tracker } +// NewClientset 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 +// for a real clientset and is mostly useful in simple unit tests. +func NewClientset(objects ...runtime.Object) *Clientset { + o := testing.NewFieldManagedObjectTracker( + scheme, + codecs.UniversalDecoder(), + applyconfiguration.NewTypeConverter(scheme), + ) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + var ( _ clientset.Interface = &Clientset{} _ testing.FakeClient = &Clientset{} diff --git a/pkg/client/clientset/versioned/typed/minio.min.io/v2/fake/fake_tenant.go b/pkg/client/clientset/versioned/typed/minio.min.io/v2/fake/fake_tenant.go index f3c808f50a5..e8f24fd7f47 100644 --- a/pkg/client/clientset/versioned/typed/minio.min.io/v2/fake/fake_tenant.go +++ b/pkg/client/clientset/versioned/typed/minio.min.io/v2/fake/fake_tenant.go @@ -44,22 +44,24 @@ var tenantsKind = v2.SchemeGroupVersion.WithKind("Tenant") // Get takes name of the tenant, and returns the corresponding tenant object, and an error if there is any. func (c *FakeTenants) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.Tenant, err error) { + emptyResult := &v2.Tenant{} obj, err := c.Fake. - Invokes(testing.NewGetAction(tenantsResource, c.ns, name), &v2.Tenant{}) + Invokes(testing.NewGetActionWithOptions(tenantsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.Tenant), err } // List takes label and field selectors, and returns the list of Tenants that match those selectors. func (c *FakeTenants) List(ctx context.Context, opts v1.ListOptions) (result *v2.TenantList, err error) { + emptyResult := &v2.TenantList{} obj, err := c.Fake. - Invokes(testing.NewListAction(tenantsResource, tenantsKind, c.ns, opts), &v2.TenantList{}) + Invokes(testing.NewListActionWithOptions(tenantsResource, tenantsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakeTenants) List(ctx context.Context, opts v1.ListOptions) (result *v2 // Watch returns a watch.Interface that watches the requested tenants. func (c *FakeTenants) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(tenantsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(tenantsResource, c.ns, opts)) } // Create takes the representation of a tenant and creates it. Returns the server's representation of the tenant, and an error, if there is any. func (c *FakeTenants) Create(ctx context.Context, tenant *v2.Tenant, opts v1.CreateOptions) (result *v2.Tenant, err error) { + emptyResult := &v2.Tenant{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(tenantsResource, c.ns, tenant), &v2.Tenant{}) + Invokes(testing.NewCreateActionWithOptions(tenantsResource, c.ns, tenant, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.Tenant), err } // Update takes the representation of a tenant and updates it. Returns the server's representation of the tenant, and an error, if there is any. func (c *FakeTenants) Update(ctx context.Context, tenant *v2.Tenant, opts v1.UpdateOptions) (result *v2.Tenant, err error) { + emptyResult := &v2.Tenant{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(tenantsResource, c.ns, tenant), &v2.Tenant{}) + Invokes(testing.NewUpdateActionWithOptions(tenantsResource, c.ns, tenant, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.Tenant), 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 *FakeTenants) UpdateStatus(ctx context.Context, tenant *v2.Tenant, opts v1.UpdateOptions) (*v2.Tenant, error) { +func (c *FakeTenants) UpdateStatus(ctx context.Context, tenant *v2.Tenant, opts v1.UpdateOptions) (result *v2.Tenant, err error) { + emptyResult := &v2.Tenant{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(tenantsResource, "status", c.ns, tenant), &v2.Tenant{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(tenantsResource, "status", c.ns, tenant, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.Tenant), err } @@ -126,7 +131,7 @@ func (c *FakeTenants) Delete(ctx context.Context, name string, opts v1.DeleteOpt // DeleteCollection deletes a collection of objects. func (c *FakeTenants) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(tenantsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(tenantsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v2.TenantList{}) return err @@ -134,11 +139,12 @@ func (c *FakeTenants) DeleteCollection(ctx context.Context, opts v1.DeleteOption // Patch applies the patch and returns the patched tenant. func (c *FakeTenants) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.Tenant, err error) { + emptyResult := &v2.Tenant{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tenantsResource, c.ns, name, pt, data, subresources...), &v2.Tenant{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(tenantsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.Tenant), err } @@ -156,11 +162,12 @@ func (c *FakeTenants) Apply(ctx context.Context, tenant *miniominiov2.TenantAppl if name == nil { return nil, fmt.Errorf("tenant.Name must be provided to Apply") } + emptyResult := &v2.Tenant{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tenantsResource, c.ns, *name, types.ApplyPatchType, data), &v2.Tenant{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(tenantsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.Tenant), err } @@ -179,11 +186,12 @@ func (c *FakeTenants) ApplyStatus(ctx context.Context, tenant *miniominiov2.Tena if name == nil { return nil, fmt.Errorf("tenant.Name must be provided to Apply") } + emptyResult := &v2.Tenant{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tenantsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v2.Tenant{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(tenantsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.Tenant), err } diff --git a/pkg/client/clientset/versioned/typed/minio.min.io/v2/tenant.go b/pkg/client/clientset/versioned/typed/minio.min.io/v2/tenant.go index a4bf31ff81a..f0bcc59616b 100644 --- a/pkg/client/clientset/versioned/typed/minio.min.io/v2/tenant.go +++ b/pkg/client/clientset/versioned/typed/minio.min.io/v2/tenant.go @@ -20,9 +20,6 @@ package v2 import ( "context" - json "encoding/json" - "fmt" - "time" v2 "github.com/minio/operator/pkg/apis/minio.min.io/v2" miniominiov2 "github.com/minio/operator/pkg/client/applyconfiguration/minio.min.io/v2" @@ -30,7 +27,7 @@ import ( v1 "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" ) // TenantsGetter has a method to return a TenantInterface. @@ -43,6 +40,7 @@ type TenantsGetter interface { type TenantInterface interface { Create(ctx context.Context, tenant *v2.Tenant, opts v1.CreateOptions) (*v2.Tenant, error) Update(ctx context.Context, tenant *v2.Tenant, opts v1.UpdateOptions) (*v2.Tenant, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, tenant *v2.Tenant, opts v1.UpdateOptions) (*v2.Tenant, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,206 +49,25 @@ type TenantInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.Tenant, err error) Apply(ctx context.Context, tenant *miniominiov2.TenantApplyConfiguration, opts v1.ApplyOptions) (result *v2.Tenant, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, tenant *miniominiov2.TenantApplyConfiguration, opts v1.ApplyOptions) (result *v2.Tenant, err error) TenantExpansion } // tenants implements TenantInterface type tenants struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v2.Tenant, *v2.TenantList, *miniominiov2.TenantApplyConfiguration] } // newTenants returns a Tenants func newTenants(c *MinioV2Client, namespace string) *tenants { return &tenants{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v2.Tenant, *v2.TenantList, *miniominiov2.TenantApplyConfiguration]( + "tenants", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v2.Tenant { return &v2.Tenant{} }, + func() *v2.TenantList { return &v2.TenantList{} }), } } - -// Get takes name of the tenant, and returns the corresponding tenant object, and an error if there is any. -func (c *tenants) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.Tenant, err error) { - result = &v2.Tenant{} - err = c.client.Get(). - Namespace(c.ns). - Resource("tenants"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Tenants that match those selectors. -func (c *tenants) List(ctx context.Context, opts v1.ListOptions) (result *v2.TenantList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v2.TenantList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("tenants"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested tenants. -func (c *tenants) Watch(ctx context.Context, opts v1.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("tenants"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a tenant and creates it. Returns the server's representation of the tenant, and an error, if there is any. -func (c *tenants) Create(ctx context.Context, tenant *v2.Tenant, opts v1.CreateOptions) (result *v2.Tenant, err error) { - result = &v2.Tenant{} - err = c.client.Post(). - Namespace(c.ns). - Resource("tenants"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tenant). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a tenant and updates it. Returns the server's representation of the tenant, and an error, if there is any. -func (c *tenants) Update(ctx context.Context, tenant *v2.Tenant, opts v1.UpdateOptions) (result *v2.Tenant, err error) { - result = &v2.Tenant{} - err = c.client.Put(). - Namespace(c.ns). - Resource("tenants"). - Name(tenant.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tenant). - 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 *tenants) UpdateStatus(ctx context.Context, tenant *v2.Tenant, opts v1.UpdateOptions) (result *v2.Tenant, err error) { - result = &v2.Tenant{} - err = c.client.Put(). - Namespace(c.ns). - Resource("tenants"). - Name(tenant.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tenant). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the tenant and deletes it. Returns an error if one occurs. -func (c *tenants) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("tenants"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *tenants) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.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("tenants"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched tenant. -func (c *tenants) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.Tenant, err error) { - result = &v2.Tenant{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("tenants"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied tenant. -func (c *tenants) Apply(ctx context.Context, tenant *miniominiov2.TenantApplyConfiguration, opts v1.ApplyOptions) (result *v2.Tenant, err error) { - if tenant == nil { - return nil, fmt.Errorf("tenant provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(tenant) - if err != nil { - return nil, err - } - name := tenant.Name - if name == nil { - return nil, fmt.Errorf("tenant.Name must be provided to Apply") - } - result = &v2.Tenant{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("tenants"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *tenants) ApplyStatus(ctx context.Context, tenant *miniominiov2.TenantApplyConfiguration, opts v1.ApplyOptions) (result *v2.Tenant, err error) { - if tenant == nil { - return nil, fmt.Errorf("tenant provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(tenant) - if err != nil { - return nil, err - } - - name := tenant.Name - if name == nil { - return nil, fmt.Errorf("tenant.Name must be provided to Apply") - } - - result = &v2.Tenant{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("tenants"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/sts.min.io/v1alpha1/fake/fake_policybinding.go b/pkg/client/clientset/versioned/typed/sts.min.io/v1alpha1/fake/fake_policybinding.go index dd69167bae7..f4268ac2690 100644 --- a/pkg/client/clientset/versioned/typed/sts.min.io/v1alpha1/fake/fake_policybinding.go +++ b/pkg/client/clientset/versioned/typed/sts.min.io/v1alpha1/fake/fake_policybinding.go @@ -44,22 +44,24 @@ var policybindingsKind = v1alpha1.SchemeGroupVersion.WithKind("PolicyBinding") // Get takes name of the policyBinding, and returns the corresponding policyBinding object, and an error if there is any. func (c *FakePolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PolicyBinding, err error) { + emptyResult := &v1alpha1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewGetAction(policybindingsResource, c.ns, name), &v1alpha1.PolicyBinding{}) + Invokes(testing.NewGetActionWithOptions(policybindingsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PolicyBinding), err } // List takes label and field selectors, and returns the list of PolicyBindings that match those selectors. func (c *FakePolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PolicyBindingList, err error) { + emptyResult := &v1alpha1.PolicyBindingList{} obj, err := c.Fake. - Invokes(testing.NewListAction(policybindingsResource, policybindingsKind, c.ns, opts), &v1alpha1.PolicyBindingList{}) + Invokes(testing.NewListActionWithOptions(policybindingsResource, policybindingsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakePolicyBindings) List(ctx context.Context, opts v1.ListOptions) (res // Watch returns a watch.Interface that watches the requested policyBindings. func (c *FakePolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(policybindingsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(policybindingsResource, c.ns, opts)) } // Create takes the representation of a policyBinding and creates it. Returns the server's representation of the policyBinding, and an error, if there is any. func (c *FakePolicyBindings) Create(ctx context.Context, policyBinding *v1alpha1.PolicyBinding, opts v1.CreateOptions) (result *v1alpha1.PolicyBinding, err error) { + emptyResult := &v1alpha1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(policybindingsResource, c.ns, policyBinding), &v1alpha1.PolicyBinding{}) + Invokes(testing.NewCreateActionWithOptions(policybindingsResource, c.ns, policyBinding, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PolicyBinding), err } // Update takes the representation of a policyBinding and updates it. Returns the server's representation of the policyBinding, and an error, if there is any. func (c *FakePolicyBindings) Update(ctx context.Context, policyBinding *v1alpha1.PolicyBinding, opts v1.UpdateOptions) (result *v1alpha1.PolicyBinding, err error) { + emptyResult := &v1alpha1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(policybindingsResource, c.ns, policyBinding), &v1alpha1.PolicyBinding{}) + Invokes(testing.NewUpdateActionWithOptions(policybindingsResource, c.ns, policyBinding, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PolicyBinding), 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 *FakePolicyBindings) UpdateStatus(ctx context.Context, policyBinding *v1alpha1.PolicyBinding, opts v1.UpdateOptions) (*v1alpha1.PolicyBinding, error) { +func (c *FakePolicyBindings) UpdateStatus(ctx context.Context, policyBinding *v1alpha1.PolicyBinding, opts v1.UpdateOptions) (result *v1alpha1.PolicyBinding, err error) { + emptyResult := &v1alpha1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(policybindingsResource, "status", c.ns, policyBinding), &v1alpha1.PolicyBinding{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(policybindingsResource, "status", c.ns, policyBinding, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PolicyBinding), err } @@ -126,7 +131,7 @@ func (c *FakePolicyBindings) Delete(ctx context.Context, name string, opts v1.De // DeleteCollection deletes a collection of objects. func (c *FakePolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(policybindingsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(policybindingsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.PolicyBindingList{}) return err @@ -134,11 +139,12 @@ func (c *FakePolicyBindings) DeleteCollection(ctx context.Context, opts v1.Delet // Patch applies the patch and returns the patched policyBinding. func (c *FakePolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PolicyBinding, err error) { + emptyResult := &v1alpha1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(policybindingsResource, c.ns, name, pt, data, subresources...), &v1alpha1.PolicyBinding{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(policybindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PolicyBinding), err } @@ -156,11 +162,12 @@ func (c *FakePolicyBindings) Apply(ctx context.Context, policyBinding *stsminiov if name == nil { return nil, fmt.Errorf("policyBinding.Name must be provided to Apply") } + emptyResult := &v1alpha1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(policybindingsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.PolicyBinding{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(policybindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PolicyBinding), err } @@ -179,11 +186,12 @@ func (c *FakePolicyBindings) ApplyStatus(ctx context.Context, policyBinding *sts if name == nil { return nil, fmt.Errorf("policyBinding.Name must be provided to Apply") } + emptyResult := &v1alpha1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(policybindingsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.PolicyBinding{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(policybindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PolicyBinding), err } diff --git a/pkg/client/clientset/versioned/typed/sts.min.io/v1alpha1/policybinding.go b/pkg/client/clientset/versioned/typed/sts.min.io/v1alpha1/policybinding.go index e4b37b3b33e..9df148b7927 100644 --- a/pkg/client/clientset/versioned/typed/sts.min.io/v1alpha1/policybinding.go +++ b/pkg/client/clientset/versioned/typed/sts.min.io/v1alpha1/policybinding.go @@ -20,9 +20,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/minio/operator/pkg/apis/sts.min.io/v1alpha1" stsminiov1alpha1 "github.com/minio/operator/pkg/client/applyconfiguration/sts.min.io/v1alpha1" @@ -30,7 +27,7 @@ import ( v1 "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" ) // PolicyBindingsGetter has a method to return a PolicyBindingInterface. @@ -43,6 +40,7 @@ type PolicyBindingsGetter interface { type PolicyBindingInterface interface { Create(ctx context.Context, policyBinding *v1alpha1.PolicyBinding, opts v1.CreateOptions) (*v1alpha1.PolicyBinding, error) Update(ctx context.Context, policyBinding *v1alpha1.PolicyBinding, opts v1.UpdateOptions) (*v1alpha1.PolicyBinding, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, policyBinding *v1alpha1.PolicyBinding, opts v1.UpdateOptions) (*v1alpha1.PolicyBinding, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,206 +49,25 @@ type PolicyBindingInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PolicyBinding, err error) Apply(ctx context.Context, policyBinding *stsminiov1alpha1.PolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PolicyBinding, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, policyBinding *stsminiov1alpha1.PolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PolicyBinding, err error) PolicyBindingExpansion } // policyBindings implements PolicyBindingInterface type policyBindings struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.PolicyBinding, *v1alpha1.PolicyBindingList, *stsminiov1alpha1.PolicyBindingApplyConfiguration] } // newPolicyBindings returns a PolicyBindings func newPolicyBindings(c *StsV1alpha1Client, namespace string) *policyBindings { return &policyBindings{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.PolicyBinding, *v1alpha1.PolicyBindingList, *stsminiov1alpha1.PolicyBindingApplyConfiguration]( + "policybindings", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.PolicyBinding { return &v1alpha1.PolicyBinding{} }, + func() *v1alpha1.PolicyBindingList { return &v1alpha1.PolicyBindingList{} }), } } - -// Get takes name of the policyBinding, and returns the corresponding policyBinding object, and an error if there is any. -func (c *policyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PolicyBinding, err error) { - result = &v1alpha1.PolicyBinding{} - err = c.client.Get(). - Namespace(c.ns). - Resource("policybindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PolicyBindings that match those selectors. -func (c *policyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PolicyBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.PolicyBindingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("policybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested policyBindings. -func (c *policyBindings) Watch(ctx context.Context, opts v1.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("policybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a policyBinding and creates it. Returns the server's representation of the policyBinding, and an error, if there is any. -func (c *policyBindings) Create(ctx context.Context, policyBinding *v1alpha1.PolicyBinding, opts v1.CreateOptions) (result *v1alpha1.PolicyBinding, err error) { - result = &v1alpha1.PolicyBinding{} - err = c.client.Post(). - Namespace(c.ns). - Resource("policybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(policyBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a policyBinding and updates it. Returns the server's representation of the policyBinding, and an error, if there is any. -func (c *policyBindings) Update(ctx context.Context, policyBinding *v1alpha1.PolicyBinding, opts v1.UpdateOptions) (result *v1alpha1.PolicyBinding, err error) { - result = &v1alpha1.PolicyBinding{} - err = c.client.Put(). - Namespace(c.ns). - Resource("policybindings"). - Name(policyBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(policyBinding). - 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 *policyBindings) UpdateStatus(ctx context.Context, policyBinding *v1alpha1.PolicyBinding, opts v1.UpdateOptions) (result *v1alpha1.PolicyBinding, err error) { - result = &v1alpha1.PolicyBinding{} - err = c.client.Put(). - Namespace(c.ns). - Resource("policybindings"). - Name(policyBinding.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(policyBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the policyBinding and deletes it. Returns an error if one occurs. -func (c *policyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("policybindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *policyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.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("policybindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched policyBinding. -func (c *policyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PolicyBinding, err error) { - result = &v1alpha1.PolicyBinding{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("policybindings"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied policyBinding. -func (c *policyBindings) Apply(ctx context.Context, policyBinding *stsminiov1alpha1.PolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PolicyBinding, err error) { - if policyBinding == nil { - return nil, fmt.Errorf("policyBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(policyBinding) - if err != nil { - return nil, err - } - name := policyBinding.Name - if name == nil { - return nil, fmt.Errorf("policyBinding.Name must be provided to Apply") - } - result = &v1alpha1.PolicyBinding{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("policybindings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *policyBindings) ApplyStatus(ctx context.Context, policyBinding *stsminiov1alpha1.PolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PolicyBinding, err error) { - if policyBinding == nil { - return nil, fmt.Errorf("policyBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(policyBinding) - if err != nil { - return nil, err - } - - name := policyBinding.Name - if name == nil { - return nil, fmt.Errorf("policyBinding.Name must be provided to Apply") - } - - result = &v1alpha1.PolicyBinding{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("policybindings"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/sts.min.io/v1beta1/fake/fake_policybinding.go b/pkg/client/clientset/versioned/typed/sts.min.io/v1beta1/fake/fake_policybinding.go index 61fd7a49ed8..da7eab93fa4 100644 --- a/pkg/client/clientset/versioned/typed/sts.min.io/v1beta1/fake/fake_policybinding.go +++ b/pkg/client/clientset/versioned/typed/sts.min.io/v1beta1/fake/fake_policybinding.go @@ -44,22 +44,24 @@ var policybindingsKind = v1beta1.SchemeGroupVersion.WithKind("PolicyBinding") // Get takes name of the policyBinding, and returns the corresponding policyBinding object, and an error if there is any. func (c *FakePolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PolicyBinding, err error) { + emptyResult := &v1beta1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewGetAction(policybindingsResource, c.ns, name), &v1beta1.PolicyBinding{}) + Invokes(testing.NewGetActionWithOptions(policybindingsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PolicyBinding), err } // List takes label and field selectors, and returns the list of PolicyBindings that match those selectors. func (c *FakePolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PolicyBindingList, err error) { + emptyResult := &v1beta1.PolicyBindingList{} obj, err := c.Fake. - Invokes(testing.NewListAction(policybindingsResource, policybindingsKind, c.ns, opts), &v1beta1.PolicyBindingList{}) + Invokes(testing.NewListActionWithOptions(policybindingsResource, policybindingsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakePolicyBindings) List(ctx context.Context, opts v1.ListOptions) (res // Watch returns a watch.Interface that watches the requested policyBindings. func (c *FakePolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(policybindingsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(policybindingsResource, c.ns, opts)) } // Create takes the representation of a policyBinding and creates it. Returns the server's representation of the policyBinding, and an error, if there is any. func (c *FakePolicyBindings) Create(ctx context.Context, policyBinding *v1beta1.PolicyBinding, opts v1.CreateOptions) (result *v1beta1.PolicyBinding, err error) { + emptyResult := &v1beta1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(policybindingsResource, c.ns, policyBinding), &v1beta1.PolicyBinding{}) + Invokes(testing.NewCreateActionWithOptions(policybindingsResource, c.ns, policyBinding, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PolicyBinding), err } // Update takes the representation of a policyBinding and updates it. Returns the server's representation of the policyBinding, and an error, if there is any. func (c *FakePolicyBindings) Update(ctx context.Context, policyBinding *v1beta1.PolicyBinding, opts v1.UpdateOptions) (result *v1beta1.PolicyBinding, err error) { + emptyResult := &v1beta1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(policybindingsResource, c.ns, policyBinding), &v1beta1.PolicyBinding{}) + Invokes(testing.NewUpdateActionWithOptions(policybindingsResource, c.ns, policyBinding, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PolicyBinding), 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 *FakePolicyBindings) UpdateStatus(ctx context.Context, policyBinding *v1beta1.PolicyBinding, opts v1.UpdateOptions) (*v1beta1.PolicyBinding, error) { +func (c *FakePolicyBindings) UpdateStatus(ctx context.Context, policyBinding *v1beta1.PolicyBinding, opts v1.UpdateOptions) (result *v1beta1.PolicyBinding, err error) { + emptyResult := &v1beta1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(policybindingsResource, "status", c.ns, policyBinding), &v1beta1.PolicyBinding{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(policybindingsResource, "status", c.ns, policyBinding, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PolicyBinding), err } @@ -126,7 +131,7 @@ func (c *FakePolicyBindings) Delete(ctx context.Context, name string, opts v1.De // DeleteCollection deletes a collection of objects. func (c *FakePolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(policybindingsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(policybindingsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.PolicyBindingList{}) return err @@ -134,11 +139,12 @@ func (c *FakePolicyBindings) DeleteCollection(ctx context.Context, opts v1.Delet // Patch applies the patch and returns the patched policyBinding. func (c *FakePolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PolicyBinding, err error) { + emptyResult := &v1beta1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(policybindingsResource, c.ns, name, pt, data, subresources...), &v1beta1.PolicyBinding{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(policybindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PolicyBinding), err } @@ -156,11 +162,12 @@ func (c *FakePolicyBindings) Apply(ctx context.Context, policyBinding *stsminiov if name == nil { return nil, fmt.Errorf("policyBinding.Name must be provided to Apply") } + emptyResult := &v1beta1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(policybindingsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.PolicyBinding{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(policybindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PolicyBinding), err } @@ -179,11 +186,12 @@ func (c *FakePolicyBindings) ApplyStatus(ctx context.Context, policyBinding *sts if name == nil { return nil, fmt.Errorf("policyBinding.Name must be provided to Apply") } + emptyResult := &v1beta1.PolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(policybindingsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.PolicyBinding{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(policybindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PolicyBinding), err } diff --git a/pkg/client/clientset/versioned/typed/sts.min.io/v1beta1/policybinding.go b/pkg/client/clientset/versioned/typed/sts.min.io/v1beta1/policybinding.go index 6738d72ce22..02391c261dd 100644 --- a/pkg/client/clientset/versioned/typed/sts.min.io/v1beta1/policybinding.go +++ b/pkg/client/clientset/versioned/typed/sts.min.io/v1beta1/policybinding.go @@ -20,9 +20,6 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "github.com/minio/operator/pkg/apis/sts.min.io/v1beta1" stsminiov1beta1 "github.com/minio/operator/pkg/client/applyconfiguration/sts.min.io/v1beta1" @@ -30,7 +27,7 @@ import ( v1 "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" ) // PolicyBindingsGetter has a method to return a PolicyBindingInterface. @@ -43,6 +40,7 @@ type PolicyBindingsGetter interface { type PolicyBindingInterface interface { Create(ctx context.Context, policyBinding *v1beta1.PolicyBinding, opts v1.CreateOptions) (*v1beta1.PolicyBinding, error) Update(ctx context.Context, policyBinding *v1beta1.PolicyBinding, opts v1.UpdateOptions) (*v1beta1.PolicyBinding, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, policyBinding *v1beta1.PolicyBinding, opts v1.UpdateOptions) (*v1beta1.PolicyBinding, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,206 +49,25 @@ type PolicyBindingInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PolicyBinding, err error) Apply(ctx context.Context, policyBinding *stsminiov1beta1.PolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PolicyBinding, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, policyBinding *stsminiov1beta1.PolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PolicyBinding, err error) PolicyBindingExpansion } // policyBindings implements PolicyBindingInterface type policyBindings struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.PolicyBinding, *v1beta1.PolicyBindingList, *stsminiov1beta1.PolicyBindingApplyConfiguration] } // newPolicyBindings returns a PolicyBindings func newPolicyBindings(c *StsV1beta1Client, namespace string) *policyBindings { return &policyBindings{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.PolicyBinding, *v1beta1.PolicyBindingList, *stsminiov1beta1.PolicyBindingApplyConfiguration]( + "policybindings", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.PolicyBinding { return &v1beta1.PolicyBinding{} }, + func() *v1beta1.PolicyBindingList { return &v1beta1.PolicyBindingList{} }), } } - -// Get takes name of the policyBinding, and returns the corresponding policyBinding object, and an error if there is any. -func (c *policyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PolicyBinding, err error) { - result = &v1beta1.PolicyBinding{} - err = c.client.Get(). - Namespace(c.ns). - Resource("policybindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PolicyBindings that match those selectors. -func (c *policyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PolicyBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.PolicyBindingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("policybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested policyBindings. -func (c *policyBindings) Watch(ctx context.Context, opts v1.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("policybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a policyBinding and creates it. Returns the server's representation of the policyBinding, and an error, if there is any. -func (c *policyBindings) Create(ctx context.Context, policyBinding *v1beta1.PolicyBinding, opts v1.CreateOptions) (result *v1beta1.PolicyBinding, err error) { - result = &v1beta1.PolicyBinding{} - err = c.client.Post(). - Namespace(c.ns). - Resource("policybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(policyBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a policyBinding and updates it. Returns the server's representation of the policyBinding, and an error, if there is any. -func (c *policyBindings) Update(ctx context.Context, policyBinding *v1beta1.PolicyBinding, opts v1.UpdateOptions) (result *v1beta1.PolicyBinding, err error) { - result = &v1beta1.PolicyBinding{} - err = c.client.Put(). - Namespace(c.ns). - Resource("policybindings"). - Name(policyBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(policyBinding). - 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 *policyBindings) UpdateStatus(ctx context.Context, policyBinding *v1beta1.PolicyBinding, opts v1.UpdateOptions) (result *v1beta1.PolicyBinding, err error) { - result = &v1beta1.PolicyBinding{} - err = c.client.Put(). - Namespace(c.ns). - Resource("policybindings"). - Name(policyBinding.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(policyBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the policyBinding and deletes it. Returns an error if one occurs. -func (c *policyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("policybindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *policyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.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("policybindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched policyBinding. -func (c *policyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PolicyBinding, err error) { - result = &v1beta1.PolicyBinding{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("policybindings"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied policyBinding. -func (c *policyBindings) Apply(ctx context.Context, policyBinding *stsminiov1beta1.PolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PolicyBinding, err error) { - if policyBinding == nil { - return nil, fmt.Errorf("policyBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(policyBinding) - if err != nil { - return nil, err - } - name := policyBinding.Name - if name == nil { - return nil, fmt.Errorf("policyBinding.Name must be provided to Apply") - } - result = &v1beta1.PolicyBinding{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("policybindings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *policyBindings) ApplyStatus(ctx context.Context, policyBinding *stsminiov1beta1.PolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PolicyBinding, err error) { - if policyBinding == nil { - return nil, fmt.Errorf("policyBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(policyBinding) - if err != nil { - return nil, err - } - - name := policyBinding.Name - if name == nil { - return nil, fmt.Errorf("policyBinding.Name must be provided to Apply") - } - - result = &v1beta1.PolicyBinding{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("policybindings"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 195bce08851..6b409a8c502 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -229,6 +229,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/client/listers/minio.min.io/v2/tenant.go b/pkg/client/listers/minio.min.io/v2/tenant.go index f1dee9e9858..d30f5b28688 100644 --- a/pkg/client/listers/minio.min.io/v2/tenant.go +++ b/pkg/client/listers/minio.min.io/v2/tenant.go @@ -20,8 +20,8 @@ package v2 import ( v2 "github.com/minio/operator/pkg/apis/minio.min.io/v2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type TenantLister interface { // tenantLister implements the TenantLister interface. type tenantLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v2.Tenant] } // NewTenantLister returns a new TenantLister. func NewTenantLister(indexer cache.Indexer) TenantLister { - return &tenantLister{indexer: indexer} -} - -// List lists all Tenants in the indexer. -func (s *tenantLister) List(selector labels.Selector) (ret []*v2.Tenant, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2.Tenant)) - }) - return ret, err + return &tenantLister{listers.New[*v2.Tenant](indexer, v2.Resource("tenant"))} } // Tenants returns an object that can list and get Tenants. func (s *tenantLister) Tenants(namespace string) TenantNamespaceLister { - return tenantNamespaceLister{indexer: s.indexer, namespace: namespace} + return tenantNamespaceLister{listers.NewNamespaced[*v2.Tenant](s.ResourceIndexer, namespace)} } // TenantNamespaceLister helps list and get Tenants. @@ -74,26 +66,5 @@ type TenantNamespaceLister interface { // tenantNamespaceLister implements the TenantNamespaceLister // interface. type tenantNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Tenants in the indexer for a given namespace. -func (s tenantNamespaceLister) List(selector labels.Selector) (ret []*v2.Tenant, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v2.Tenant)) - }) - return ret, err -} - -// Get retrieves the Tenant from the indexer for a given namespace and name. -func (s tenantNamespaceLister) Get(name string) (*v2.Tenant, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v2.Resource("tenant"), name) - } - return obj.(*v2.Tenant), nil + listers.ResourceIndexer[*v2.Tenant] } diff --git a/pkg/client/listers/sts.min.io/v1alpha1/policybinding.go b/pkg/client/listers/sts.min.io/v1alpha1/policybinding.go index 54695c78329..7e17b14e36e 100644 --- a/pkg/client/listers/sts.min.io/v1alpha1/policybinding.go +++ b/pkg/client/listers/sts.min.io/v1alpha1/policybinding.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "github.com/minio/operator/pkg/apis/sts.min.io/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type PolicyBindingLister interface { // policyBindingLister implements the PolicyBindingLister interface. type policyBindingLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.PolicyBinding] } // NewPolicyBindingLister returns a new PolicyBindingLister. func NewPolicyBindingLister(indexer cache.Indexer) PolicyBindingLister { - return &policyBindingLister{indexer: indexer} -} - -// List lists all PolicyBindings in the indexer. -func (s *policyBindingLister) List(selector labels.Selector) (ret []*v1alpha1.PolicyBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.PolicyBinding)) - }) - return ret, err + return &policyBindingLister{listers.New[*v1alpha1.PolicyBinding](indexer, v1alpha1.Resource("policybinding"))} } // PolicyBindings returns an object that can list and get PolicyBindings. func (s *policyBindingLister) PolicyBindings(namespace string) PolicyBindingNamespaceLister { - return policyBindingNamespaceLister{indexer: s.indexer, namespace: namespace} + return policyBindingNamespaceLister{listers.NewNamespaced[*v1alpha1.PolicyBinding](s.ResourceIndexer, namespace)} } // PolicyBindingNamespaceLister helps list and get PolicyBindings. @@ -74,26 +66,5 @@ type PolicyBindingNamespaceLister interface { // policyBindingNamespaceLister implements the PolicyBindingNamespaceLister // interface. type policyBindingNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all PolicyBindings in the indexer for a given namespace. -func (s policyBindingNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.PolicyBinding, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.PolicyBinding)) - }) - return ret, err -} - -// Get retrieves the PolicyBinding from the indexer for a given namespace and name. -func (s policyBindingNamespaceLister) Get(name string) (*v1alpha1.PolicyBinding, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("policybinding"), name) - } - return obj.(*v1alpha1.PolicyBinding), nil + listers.ResourceIndexer[*v1alpha1.PolicyBinding] } diff --git a/pkg/client/listers/sts.min.io/v1beta1/policybinding.go b/pkg/client/listers/sts.min.io/v1beta1/policybinding.go index c9592aba0cb..ef2b221171d 100644 --- a/pkg/client/listers/sts.min.io/v1beta1/policybinding.go +++ b/pkg/client/listers/sts.min.io/v1beta1/policybinding.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "github.com/minio/operator/pkg/apis/sts.min.io/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type PolicyBindingLister interface { // policyBindingLister implements the PolicyBindingLister interface. type policyBindingLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.PolicyBinding] } // NewPolicyBindingLister returns a new PolicyBindingLister. func NewPolicyBindingLister(indexer cache.Indexer) PolicyBindingLister { - return &policyBindingLister{indexer: indexer} -} - -// List lists all PolicyBindings in the indexer. -func (s *policyBindingLister) List(selector labels.Selector) (ret []*v1beta1.PolicyBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.PolicyBinding)) - }) - return ret, err + return &policyBindingLister{listers.New[*v1beta1.PolicyBinding](indexer, v1beta1.Resource("policybinding"))} } // PolicyBindings returns an object that can list and get PolicyBindings. func (s *policyBindingLister) PolicyBindings(namespace string) PolicyBindingNamespaceLister { - return policyBindingNamespaceLister{indexer: s.indexer, namespace: namespace} + return policyBindingNamespaceLister{listers.NewNamespaced[*v1beta1.PolicyBinding](s.ResourceIndexer, namespace)} } // PolicyBindingNamespaceLister helps list and get PolicyBindings. @@ -74,26 +66,5 @@ type PolicyBindingNamespaceLister interface { // policyBindingNamespaceLister implements the PolicyBindingNamespaceLister // interface. type policyBindingNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all PolicyBindings in the indexer for a given namespace. -func (s policyBindingNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.PolicyBinding, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.PolicyBinding)) - }) - return ret, err -} - -// Get retrieves the PolicyBinding from the indexer for a given namespace and name. -func (s policyBindingNamespaceLister) Get(name string) (*v1beta1.PolicyBinding, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("policybinding"), name) - } - return obj.(*v1beta1.PolicyBinding), nil + listers.ResourceIndexer[*v1beta1.PolicyBinding] } From daba07d2faecbb37bdb2292551a622a00f6e8605 Mon Sep 17 00:00:00 2001 From: Ramon de Klein Date: Wed, 16 Oct 2024 16:25:12 +0200 Subject: [PATCH 2/3] downgrade to Go v1.22.0 --- go.mod | 2 +- sidecar/go.mod | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 32130080ea9..032c579dce5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/minio/operator -go 1.22.5 +go 1.22.0 require ( github.com/blang/semver/v4 v4.0.0 diff --git a/sidecar/go.mod b/sidecar/go.mod index 4a6da0b8c80..a86233c0518 100644 --- a/sidecar/go.mod +++ b/sidecar/go.mod @@ -1,15 +1,15 @@ module github.com/minio/operator/sidecar -go 1.22.5 +go 1.22.0 require ( github.com/gorilla/mux v1.8.1 github.com/minio/cli v1.24.2 github.com/minio/operator v0.0.0-20240506170406-f963b2796cae github.com/minio/pkg v1.7.5 - k8s.io/api v0.30.2 - k8s.io/apimachinery v0.30.2 - k8s.io/client-go v0.30.2 + k8s.io/api v0.31.1 + k8s.io/apimachinery v0.31.1 + k8s.io/client-go v0.31.1 k8s.io/klog/v2 v2.130.1 ) @@ -20,6 +20,7 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/fatih/color v1.17.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect @@ -64,6 +65,7 @@ require ( github.com/tinylib/msgp v1.1.9 // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect + github.com/x448/float16 v0.8.4 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect golang.org/x/crypto v0.27.0 // indirect golang.org/x/mod v0.18.0 // indirect @@ -81,7 +83,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b // indirect - k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // 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 From fa02a481a336a5935e6d19470a729b9ce73fc412 Mon Sep 17 00:00:00 2001 From: Ramon de Klein Date: Wed, 16 Oct 2024 16:31:49 +0200 Subject: [PATCH 3/3] fix build --- go.mod | 13 +++++++++---- go.sum | 18 ++++++++++++++++++ sidecar/go.mod | 2 +- sidecar/go.sum | 37 ++++++++++++++++++++----------------- 4 files changed, 48 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 032c579dce5..774fbd42e82 100644 --- a/go.mod +++ b/go.mod @@ -47,11 +47,13 @@ require ( github.com/go-test/deep v1.1.1 github.com/minio/kes-go v0.2.1 golang.org/x/mod v0.18.0 - sigs.k8s.io/controller-runtime v0.18.4 + sigs.k8s.io/controller-runtime v0.19.0 ) require ( aead.dev/mem v0.2.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect @@ -61,6 +63,7 @@ require ( github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/evanphx/json-patch v5.9.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.0 // 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-ole/go-ole v1.3.0 // indirect @@ -99,8 +102,9 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect + github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.54.0 // indirect + github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/prometheus/prom2json v1.3.3 // indirect github.com/rjeczalik/notify v0.9.3 // indirect @@ -116,17 +120,18 @@ require ( github.com/x448/float16 v0.8.4 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 // indirect + golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.25.0 // indirect golang.org/x/term v0.24.0 // indirect golang.org/x/tools v0.22.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // 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/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.30.2 // indirect + k8s.io/apiextensions-apiserver v0.31.0 // indirect k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index 51ae63c80c8..2710d19040e 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,12 @@ aead.dev/mem v0.2.0 h1:ufgkESS9+lHV/GUjxgc2ObF43FLZGSemh+W+y27QFMI= aead.dev/mem v0.2.0/go.mod h1:4qj+sh8fjDhlvne9gm/ZaMRIX9EkmDrKOLwmyDtoMWM= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +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= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU= github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -31,6 +35,8 @@ github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0 github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +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/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= @@ -170,10 +176,14 @@ github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0 h github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.74.0/go.mod h1:wAR5JopumPtAZnu0Cjv2PSqV4p4QB09LMhc6fZZTXuA= github.com/prometheus-operator/prometheus-operator/pkg/client v0.74.0 h1:SyBTzvFuVshDNjDVALs6+NgOy3qh8/xlAsyqB1SzHbI= github.com/prometheus-operator/prometheus-operator/pkg/client v0.74.0/go.mod h1:FlcnLo14zQxL6P1yPrV22kYBqyAT0ZRRytv98+B7lBQ= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= 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.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= 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/prometheus/prom2json v1.3.3 h1:IYfSMiZ7sSOfliBoo89PcufjWO4eAR0gznGcETyaUgo= @@ -242,6 +252,8 @@ 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-20220909182711-5c715a9e8561 h1:MDc5xs78ZrZr3HMQugiXOAkSZtfTpbJLDr/lwfgO53E= golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= 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.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -321,6 +333,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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/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= @@ -346,6 +360,8 @@ k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= k8s.io/apiextensions-apiserver v0.30.2 h1:l7Eue2t6QiLHErfn2vwK4KgF4NeDgjQkCXtEbOocKIE= k8s.io/apiextensions-apiserver v0.30.2/go.mod h1:lsJFLYyK40iguuinsb3nt+Sj6CmodSI4ACDLep1rgjw= +k8s.io/apiextensions-apiserver v0.31.0 h1:fZgCVhGwsclj3qCw1buVXCV6khjRzKC5eCFt24kyLSk= +k8s.io/apiextensions-apiserver v0.31.0/go.mod h1:b9aMDEYaEe5sdK+1T0KU78ApR/5ZVp4i56VacZYEHxk= k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= @@ -362,6 +378,8 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw= sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= +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/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/sidecar/go.mod b/sidecar/go.mod index a86233c0518..4bf5f52397d 100644 --- a/sidecar/go.mod +++ b/sidecar/go.mod @@ -54,7 +54,7 @@ require ( github.com/philhofer/fwd v1.1.2 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.54.0 // indirect + github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/prometheus/prom2json v1.3.3 // indirect github.com/rs/xid v1.5.0 // indirect diff --git a/sidecar/go.sum b/sidecar/go.sum index 7f16e44376e..0fe5d557195 100644 --- a/sidecar/go.sum +++ b/sidecar/go.sum @@ -9,6 +9,8 @@ github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtz github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= @@ -20,7 +22,6 @@ github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF 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 v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= 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/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= @@ -42,8 +43,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= 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/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= @@ -93,8 +94,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g= -github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw= @@ -106,14 +107,14 @@ github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= 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.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= -github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= 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/prometheus/prom2json v1.3.3 h1:IYfSMiZ7sSOfliBoo89PcufjWO4eAR0gznGcETyaUgo= github.com/prometheus/prom2json v1.3.3/go.mod h1:Pv4yIPktEkK7btWsrUTWDDDrnpUrAELaOCj+oFwlgmc= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/safchain/ethtool v0.4.1 h1:S6mEleTADqgynileXoiapt/nKnatyR6bmIHoF+h2ADo= @@ -138,6 +139,8 @@ github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZ github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY= github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE= +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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= @@ -213,18 +216,18 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= -k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= -k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= -k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= -k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= +k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= +k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= +k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= +k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= +k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= 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-20240620174524-b456828f718b h1:Q9xmGWBvOGd8UJyccgpYlLosk/JlfP3xQLNkQlHJeXw= k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b/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= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= 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=