diff --git a/api/client/informers/externalversions/factory.go b/api/client/informers/externalversions/factory.go index 1de8c37f..95392b06 100644 --- a/api/client/informers/externalversions/factory.go +++ b/api/client/informers/externalversions/factory.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package externalversions @@ -227,6 +227,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/api/client/informers/externalversions/generic.go b/api/client/informers/externalversions/generic.go index e6eec22c..a2fd80af 100644 --- a/api/client/informers/externalversions/generic.go +++ b/api/client/informers/externalversions/generic.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package externalversions diff --git a/api/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/api/client/informers/externalversions/internalinterfaces/factory_interfaces.go index f7e48dd8..43a2776c 100644 --- a/api/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/api/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package internalinterfaces diff --git a/api/client/informers/externalversions/operator/interface.go b/api/client/informers/externalversions/operator/interface.go index 1e5e15d6..2ff48433 100644 --- a/api/client/informers/externalversions/operator/interface.go +++ b/api/client/informers/externalversions/operator/interface.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package operator diff --git a/api/client/informers/externalversions/operator/v1beta1/interface.go b/api/client/informers/externalversions/operator/v1beta1/interface.go index 5e031db3..6b441a3b 100644 --- a/api/client/informers/externalversions/operator/v1beta1/interface.go +++ b/api/client/informers/externalversions/operator/v1beta1/interface.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vlogs.go b/api/client/informers/externalversions/operator/v1beta1/vlogs.go index ef7b3435..84c5f968 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vlogs.go +++ b/api/client/informers/externalversions/operator/v1beta1/vlogs.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmagent.go b/api/client/informers/externalversions/operator/v1beta1/vmagent.go index f4d501eb..fd9eccad 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmagent.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmagent.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmalert.go b/api/client/informers/externalversions/operator/v1beta1/vmalert.go index a526ce59..e56d3e66 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmalert.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmalert.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmalertmanager.go b/api/client/informers/externalversions/operator/v1beta1/vmalertmanager.go index 84271ee3..0e465a30 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmalertmanager.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmalertmanager.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmalertmanagerconfig.go b/api/client/informers/externalversions/operator/v1beta1/vmalertmanagerconfig.go index 37c1679f..410a446c 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmalertmanagerconfig.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmalertmanagerconfig.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmauth.go b/api/client/informers/externalversions/operator/v1beta1/vmauth.go index fa041ce1..c2e60574 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmauth.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmauth.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmcluster.go b/api/client/informers/externalversions/operator/v1beta1/vmcluster.go index b1b31cd2..5f99a2ba 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmcluster.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmcluster.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmnodescrape.go b/api/client/informers/externalversions/operator/v1beta1/vmnodescrape.go index 996a38e8..0a2f4623 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmnodescrape.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmnodescrape.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmpodscrape.go b/api/client/informers/externalversions/operator/v1beta1/vmpodscrape.go index e6673d99..91d082b8 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmpodscrape.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmpodscrape.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmprobe.go b/api/client/informers/externalversions/operator/v1beta1/vmprobe.go index a4a37351..ce77dc0e 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmprobe.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmprobe.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmrule.go b/api/client/informers/externalversions/operator/v1beta1/vmrule.go index a00ab869..ad897ea6 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmrule.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmrule.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmscrapeconfig.go b/api/client/informers/externalversions/operator/v1beta1/vmscrapeconfig.go index 2dcfd519..dc9cd0fe 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmscrapeconfig.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmscrapeconfig.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmservicescrape.go b/api/client/informers/externalversions/operator/v1beta1/vmservicescrape.go index f12110da..af2316d9 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmservicescrape.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmservicescrape.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmsingle.go b/api/client/informers/externalversions/operator/v1beta1/vmsingle.go index 210631f4..f945d597 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmsingle.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmsingle.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmstaticscrape.go b/api/client/informers/externalversions/operator/v1beta1/vmstaticscrape.go index 5b6728a3..25802d0a 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmstaticscrape.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmstaticscrape.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/informers/externalversions/operator/v1beta1/vmuser.go b/api/client/informers/externalversions/operator/v1beta1/vmuser.go index b8a0bcf5..e287be50 100644 --- a/api/client/informers/externalversions/operator/v1beta1/vmuser.go +++ b/api/client/informers/externalversions/operator/v1beta1/vmuser.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by informer-gen-v0.30. DO NOT EDIT. +// Code generated by informer-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/listers/operator/v1beta1/expansion_generated.go b/api/client/listers/operator/v1beta1/expansion_generated.go index 13fab7c1..e811b80a 100644 --- a/api/client/listers/operator/v1beta1/expansion_generated.go +++ b/api/client/listers/operator/v1beta1/expansion_generated.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/listers/operator/v1beta1/vlogs.go b/api/client/listers/operator/v1beta1/vlogs.go index 1b76eb9f..cb1afcde 100644 --- a/api/client/listers/operator/v1beta1/vlogs.go +++ b/api/client/listers/operator/v1beta1/vlogs.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VLogsLister interface { // vLogsLister implements the VLogsLister interface. type vLogsLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VLogs] } // NewVLogsLister returns a new VLogsLister. func NewVLogsLister(indexer cache.Indexer) VLogsLister { - return &vLogsLister{indexer: indexer} -} - -// List lists all VLogs in the indexer. -func (s *vLogsLister) List(selector labels.Selector) (ret []*v1beta1.VLogs, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VLogs)) - }) - return ret, err + return &vLogsLister{listers.New[*v1beta1.VLogs](indexer, v1beta1.Resource("vlogs"))} } // VLogs returns an object that can list and get VLogs. func (s *vLogsLister) VLogs(namespace string) VLogsNamespaceLister { - return vLogsNamespaceLister{indexer: s.indexer, namespace: namespace} + return vLogsNamespaceLister{listers.NewNamespaced[*v1beta1.VLogs](s.ResourceIndexer, namespace)} } // VLogsNamespaceLister helps list and get VLogs. @@ -73,26 +65,5 @@ type VLogsNamespaceLister interface { // vLogsNamespaceLister implements the VLogsNamespaceLister // interface. type vLogsNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VLogs in the indexer for a given namespace. -func (s vLogsNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VLogs, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VLogs)) - }) - return ret, err -} - -// Get retrieves the VLogs from the indexer for a given namespace and name. -func (s vLogsNamespaceLister) Get(name string) (*v1beta1.VLogs, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vlogs"), name) - } - return obj.(*v1beta1.VLogs), nil + listers.ResourceIndexer[*v1beta1.VLogs] } diff --git a/api/client/listers/operator/v1beta1/vmagent.go b/api/client/listers/operator/v1beta1/vmagent.go index 34539e30..3a866639 100644 --- a/api/client/listers/operator/v1beta1/vmagent.go +++ b/api/client/listers/operator/v1beta1/vmagent.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMAgentLister interface { // vMAgentLister implements the VMAgentLister interface. type vMAgentLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMAgent] } // NewVMAgentLister returns a new VMAgentLister. func NewVMAgentLister(indexer cache.Indexer) VMAgentLister { - return &vMAgentLister{indexer: indexer} -} - -// List lists all VMAgents in the indexer. -func (s *vMAgentLister) List(selector labels.Selector) (ret []*v1beta1.VMAgent, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMAgent)) - }) - return ret, err + return &vMAgentLister{listers.New[*v1beta1.VMAgent](indexer, v1beta1.Resource("vmagent"))} } // VMAgents returns an object that can list and get VMAgents. func (s *vMAgentLister) VMAgents(namespace string) VMAgentNamespaceLister { - return vMAgentNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMAgentNamespaceLister{listers.NewNamespaced[*v1beta1.VMAgent](s.ResourceIndexer, namespace)} } // VMAgentNamespaceLister helps list and get VMAgents. @@ -73,26 +65,5 @@ type VMAgentNamespaceLister interface { // vMAgentNamespaceLister implements the VMAgentNamespaceLister // interface. type vMAgentNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMAgents in the indexer for a given namespace. -func (s vMAgentNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMAgent, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMAgent)) - }) - return ret, err -} - -// Get retrieves the VMAgent from the indexer for a given namespace and name. -func (s vMAgentNamespaceLister) Get(name string) (*v1beta1.VMAgent, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmagent"), name) - } - return obj.(*v1beta1.VMAgent), nil + listers.ResourceIndexer[*v1beta1.VMAgent] } diff --git a/api/client/listers/operator/v1beta1/vmalert.go b/api/client/listers/operator/v1beta1/vmalert.go index 1d3930a6..a829ab9e 100644 --- a/api/client/listers/operator/v1beta1/vmalert.go +++ b/api/client/listers/operator/v1beta1/vmalert.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMAlertLister interface { // vMAlertLister implements the VMAlertLister interface. type vMAlertLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMAlert] } // NewVMAlertLister returns a new VMAlertLister. func NewVMAlertLister(indexer cache.Indexer) VMAlertLister { - return &vMAlertLister{indexer: indexer} -} - -// List lists all VMAlerts in the indexer. -func (s *vMAlertLister) List(selector labels.Selector) (ret []*v1beta1.VMAlert, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMAlert)) - }) - return ret, err + return &vMAlertLister{listers.New[*v1beta1.VMAlert](indexer, v1beta1.Resource("vmalert"))} } // VMAlerts returns an object that can list and get VMAlerts. func (s *vMAlertLister) VMAlerts(namespace string) VMAlertNamespaceLister { - return vMAlertNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMAlertNamespaceLister{listers.NewNamespaced[*v1beta1.VMAlert](s.ResourceIndexer, namespace)} } // VMAlertNamespaceLister helps list and get VMAlerts. @@ -73,26 +65,5 @@ type VMAlertNamespaceLister interface { // vMAlertNamespaceLister implements the VMAlertNamespaceLister // interface. type vMAlertNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMAlerts in the indexer for a given namespace. -func (s vMAlertNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMAlert, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMAlert)) - }) - return ret, err -} - -// Get retrieves the VMAlert from the indexer for a given namespace and name. -func (s vMAlertNamespaceLister) Get(name string) (*v1beta1.VMAlert, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmalert"), name) - } - return obj.(*v1beta1.VMAlert), nil + listers.ResourceIndexer[*v1beta1.VMAlert] } diff --git a/api/client/listers/operator/v1beta1/vmalertmanager.go b/api/client/listers/operator/v1beta1/vmalertmanager.go index d4c95c43..e42b512c 100644 --- a/api/client/listers/operator/v1beta1/vmalertmanager.go +++ b/api/client/listers/operator/v1beta1/vmalertmanager.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMAlertmanagerLister interface { // vMAlertmanagerLister implements the VMAlertmanagerLister interface. type vMAlertmanagerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMAlertmanager] } // NewVMAlertmanagerLister returns a new VMAlertmanagerLister. func NewVMAlertmanagerLister(indexer cache.Indexer) VMAlertmanagerLister { - return &vMAlertmanagerLister{indexer: indexer} -} - -// List lists all VMAlertmanagers in the indexer. -func (s *vMAlertmanagerLister) List(selector labels.Selector) (ret []*v1beta1.VMAlertmanager, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMAlertmanager)) - }) - return ret, err + return &vMAlertmanagerLister{listers.New[*v1beta1.VMAlertmanager](indexer, v1beta1.Resource("vmalertmanager"))} } // VMAlertmanagers returns an object that can list and get VMAlertmanagers. func (s *vMAlertmanagerLister) VMAlertmanagers(namespace string) VMAlertmanagerNamespaceLister { - return vMAlertmanagerNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMAlertmanagerNamespaceLister{listers.NewNamespaced[*v1beta1.VMAlertmanager](s.ResourceIndexer, namespace)} } // VMAlertmanagerNamespaceLister helps list and get VMAlertmanagers. @@ -73,26 +65,5 @@ type VMAlertmanagerNamespaceLister interface { // vMAlertmanagerNamespaceLister implements the VMAlertmanagerNamespaceLister // interface. type vMAlertmanagerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMAlertmanagers in the indexer for a given namespace. -func (s vMAlertmanagerNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMAlertmanager, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMAlertmanager)) - }) - return ret, err -} - -// Get retrieves the VMAlertmanager from the indexer for a given namespace and name. -func (s vMAlertmanagerNamespaceLister) Get(name string) (*v1beta1.VMAlertmanager, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmalertmanager"), name) - } - return obj.(*v1beta1.VMAlertmanager), nil + listers.ResourceIndexer[*v1beta1.VMAlertmanager] } diff --git a/api/client/listers/operator/v1beta1/vmalertmanagerconfig.go b/api/client/listers/operator/v1beta1/vmalertmanagerconfig.go index 3e5e6759..a996af6d 100644 --- a/api/client/listers/operator/v1beta1/vmalertmanagerconfig.go +++ b/api/client/listers/operator/v1beta1/vmalertmanagerconfig.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMAlertmanagerConfigLister interface { // vMAlertmanagerConfigLister implements the VMAlertmanagerConfigLister interface. type vMAlertmanagerConfigLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMAlertmanagerConfig] } // NewVMAlertmanagerConfigLister returns a new VMAlertmanagerConfigLister. func NewVMAlertmanagerConfigLister(indexer cache.Indexer) VMAlertmanagerConfigLister { - return &vMAlertmanagerConfigLister{indexer: indexer} -} - -// List lists all VMAlertmanagerConfigs in the indexer. -func (s *vMAlertmanagerConfigLister) List(selector labels.Selector) (ret []*v1beta1.VMAlertmanagerConfig, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMAlertmanagerConfig)) - }) - return ret, err + return &vMAlertmanagerConfigLister{listers.New[*v1beta1.VMAlertmanagerConfig](indexer, v1beta1.Resource("vmalertmanagerconfig"))} } // VMAlertmanagerConfigs returns an object that can list and get VMAlertmanagerConfigs. func (s *vMAlertmanagerConfigLister) VMAlertmanagerConfigs(namespace string) VMAlertmanagerConfigNamespaceLister { - return vMAlertmanagerConfigNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMAlertmanagerConfigNamespaceLister{listers.NewNamespaced[*v1beta1.VMAlertmanagerConfig](s.ResourceIndexer, namespace)} } // VMAlertmanagerConfigNamespaceLister helps list and get VMAlertmanagerConfigs. @@ -73,26 +65,5 @@ type VMAlertmanagerConfigNamespaceLister interface { // vMAlertmanagerConfigNamespaceLister implements the VMAlertmanagerConfigNamespaceLister // interface. type vMAlertmanagerConfigNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMAlertmanagerConfigs in the indexer for a given namespace. -func (s vMAlertmanagerConfigNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMAlertmanagerConfig, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMAlertmanagerConfig)) - }) - return ret, err -} - -// Get retrieves the VMAlertmanagerConfig from the indexer for a given namespace and name. -func (s vMAlertmanagerConfigNamespaceLister) Get(name string) (*v1beta1.VMAlertmanagerConfig, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmalertmanagerconfig"), name) - } - return obj.(*v1beta1.VMAlertmanagerConfig), nil + listers.ResourceIndexer[*v1beta1.VMAlertmanagerConfig] } diff --git a/api/client/listers/operator/v1beta1/vmauth.go b/api/client/listers/operator/v1beta1/vmauth.go index b348c3ab..acc1d40d 100644 --- a/api/client/listers/operator/v1beta1/vmauth.go +++ b/api/client/listers/operator/v1beta1/vmauth.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMAuthLister interface { // vMAuthLister implements the VMAuthLister interface. type vMAuthLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMAuth] } // NewVMAuthLister returns a new VMAuthLister. func NewVMAuthLister(indexer cache.Indexer) VMAuthLister { - return &vMAuthLister{indexer: indexer} -} - -// List lists all VMAuths in the indexer. -func (s *vMAuthLister) List(selector labels.Selector) (ret []*v1beta1.VMAuth, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMAuth)) - }) - return ret, err + return &vMAuthLister{listers.New[*v1beta1.VMAuth](indexer, v1beta1.Resource("vmauth"))} } // VMAuths returns an object that can list and get VMAuths. func (s *vMAuthLister) VMAuths(namespace string) VMAuthNamespaceLister { - return vMAuthNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMAuthNamespaceLister{listers.NewNamespaced[*v1beta1.VMAuth](s.ResourceIndexer, namespace)} } // VMAuthNamespaceLister helps list and get VMAuths. @@ -73,26 +65,5 @@ type VMAuthNamespaceLister interface { // vMAuthNamespaceLister implements the VMAuthNamespaceLister // interface. type vMAuthNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMAuths in the indexer for a given namespace. -func (s vMAuthNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMAuth, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMAuth)) - }) - return ret, err -} - -// Get retrieves the VMAuth from the indexer for a given namespace and name. -func (s vMAuthNamespaceLister) Get(name string) (*v1beta1.VMAuth, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmauth"), name) - } - return obj.(*v1beta1.VMAuth), nil + listers.ResourceIndexer[*v1beta1.VMAuth] } diff --git a/api/client/listers/operator/v1beta1/vmcluster.go b/api/client/listers/operator/v1beta1/vmcluster.go index 7490508d..944d0b5a 100644 --- a/api/client/listers/operator/v1beta1/vmcluster.go +++ b/api/client/listers/operator/v1beta1/vmcluster.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMClusterLister interface { // vMClusterLister implements the VMClusterLister interface. type vMClusterLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMCluster] } // NewVMClusterLister returns a new VMClusterLister. func NewVMClusterLister(indexer cache.Indexer) VMClusterLister { - return &vMClusterLister{indexer: indexer} -} - -// List lists all VMClusters in the indexer. -func (s *vMClusterLister) List(selector labels.Selector) (ret []*v1beta1.VMCluster, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMCluster)) - }) - return ret, err + return &vMClusterLister{listers.New[*v1beta1.VMCluster](indexer, v1beta1.Resource("vmcluster"))} } // VMClusters returns an object that can list and get VMClusters. func (s *vMClusterLister) VMClusters(namespace string) VMClusterNamespaceLister { - return vMClusterNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMClusterNamespaceLister{listers.NewNamespaced[*v1beta1.VMCluster](s.ResourceIndexer, namespace)} } // VMClusterNamespaceLister helps list and get VMClusters. @@ -73,26 +65,5 @@ type VMClusterNamespaceLister interface { // vMClusterNamespaceLister implements the VMClusterNamespaceLister // interface. type vMClusterNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMClusters in the indexer for a given namespace. -func (s vMClusterNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMCluster, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMCluster)) - }) - return ret, err -} - -// Get retrieves the VMCluster from the indexer for a given namespace and name. -func (s vMClusterNamespaceLister) Get(name string) (*v1beta1.VMCluster, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmcluster"), name) - } - return obj.(*v1beta1.VMCluster), nil + listers.ResourceIndexer[*v1beta1.VMCluster] } diff --git a/api/client/listers/operator/v1beta1/vmnodescrape.go b/api/client/listers/operator/v1beta1/vmnodescrape.go index 2e8a25be..641f127e 100644 --- a/api/client/listers/operator/v1beta1/vmnodescrape.go +++ b/api/client/listers/operator/v1beta1/vmnodescrape.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMNodeScrapeLister interface { // vMNodeScrapeLister implements the VMNodeScrapeLister interface. type vMNodeScrapeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMNodeScrape] } // NewVMNodeScrapeLister returns a new VMNodeScrapeLister. func NewVMNodeScrapeLister(indexer cache.Indexer) VMNodeScrapeLister { - return &vMNodeScrapeLister{indexer: indexer} -} - -// List lists all VMNodeScrapes in the indexer. -func (s *vMNodeScrapeLister) List(selector labels.Selector) (ret []*v1beta1.VMNodeScrape, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMNodeScrape)) - }) - return ret, err + return &vMNodeScrapeLister{listers.New[*v1beta1.VMNodeScrape](indexer, v1beta1.Resource("vmnodescrape"))} } // VMNodeScrapes returns an object that can list and get VMNodeScrapes. func (s *vMNodeScrapeLister) VMNodeScrapes(namespace string) VMNodeScrapeNamespaceLister { - return vMNodeScrapeNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMNodeScrapeNamespaceLister{listers.NewNamespaced[*v1beta1.VMNodeScrape](s.ResourceIndexer, namespace)} } // VMNodeScrapeNamespaceLister helps list and get VMNodeScrapes. @@ -73,26 +65,5 @@ type VMNodeScrapeNamespaceLister interface { // vMNodeScrapeNamespaceLister implements the VMNodeScrapeNamespaceLister // interface. type vMNodeScrapeNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMNodeScrapes in the indexer for a given namespace. -func (s vMNodeScrapeNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMNodeScrape, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMNodeScrape)) - }) - return ret, err -} - -// Get retrieves the VMNodeScrape from the indexer for a given namespace and name. -func (s vMNodeScrapeNamespaceLister) Get(name string) (*v1beta1.VMNodeScrape, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmnodescrape"), name) - } - return obj.(*v1beta1.VMNodeScrape), nil + listers.ResourceIndexer[*v1beta1.VMNodeScrape] } diff --git a/api/client/listers/operator/v1beta1/vmpodscrape.go b/api/client/listers/operator/v1beta1/vmpodscrape.go index da3cb48c..66a88202 100644 --- a/api/client/listers/operator/v1beta1/vmpodscrape.go +++ b/api/client/listers/operator/v1beta1/vmpodscrape.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMPodScrapeLister interface { // vMPodScrapeLister implements the VMPodScrapeLister interface. type vMPodScrapeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMPodScrape] } // NewVMPodScrapeLister returns a new VMPodScrapeLister. func NewVMPodScrapeLister(indexer cache.Indexer) VMPodScrapeLister { - return &vMPodScrapeLister{indexer: indexer} -} - -// List lists all VMPodScrapes in the indexer. -func (s *vMPodScrapeLister) List(selector labels.Selector) (ret []*v1beta1.VMPodScrape, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMPodScrape)) - }) - return ret, err + return &vMPodScrapeLister{listers.New[*v1beta1.VMPodScrape](indexer, v1beta1.Resource("vmpodscrape"))} } // VMPodScrapes returns an object that can list and get VMPodScrapes. func (s *vMPodScrapeLister) VMPodScrapes(namespace string) VMPodScrapeNamespaceLister { - return vMPodScrapeNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMPodScrapeNamespaceLister{listers.NewNamespaced[*v1beta1.VMPodScrape](s.ResourceIndexer, namespace)} } // VMPodScrapeNamespaceLister helps list and get VMPodScrapes. @@ -73,26 +65,5 @@ type VMPodScrapeNamespaceLister interface { // vMPodScrapeNamespaceLister implements the VMPodScrapeNamespaceLister // interface. type vMPodScrapeNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMPodScrapes in the indexer for a given namespace. -func (s vMPodScrapeNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMPodScrape, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMPodScrape)) - }) - return ret, err -} - -// Get retrieves the VMPodScrape from the indexer for a given namespace and name. -func (s vMPodScrapeNamespaceLister) Get(name string) (*v1beta1.VMPodScrape, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmpodscrape"), name) - } - return obj.(*v1beta1.VMPodScrape), nil + listers.ResourceIndexer[*v1beta1.VMPodScrape] } diff --git a/api/client/listers/operator/v1beta1/vmprobe.go b/api/client/listers/operator/v1beta1/vmprobe.go index 15416d18..02c83ed4 100644 --- a/api/client/listers/operator/v1beta1/vmprobe.go +++ b/api/client/listers/operator/v1beta1/vmprobe.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMProbeLister interface { // vMProbeLister implements the VMProbeLister interface. type vMProbeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMProbe] } // NewVMProbeLister returns a new VMProbeLister. func NewVMProbeLister(indexer cache.Indexer) VMProbeLister { - return &vMProbeLister{indexer: indexer} -} - -// List lists all VMProbes in the indexer. -func (s *vMProbeLister) List(selector labels.Selector) (ret []*v1beta1.VMProbe, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMProbe)) - }) - return ret, err + return &vMProbeLister{listers.New[*v1beta1.VMProbe](indexer, v1beta1.Resource("vmprobe"))} } // VMProbes returns an object that can list and get VMProbes. func (s *vMProbeLister) VMProbes(namespace string) VMProbeNamespaceLister { - return vMProbeNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMProbeNamespaceLister{listers.NewNamespaced[*v1beta1.VMProbe](s.ResourceIndexer, namespace)} } // VMProbeNamespaceLister helps list and get VMProbes. @@ -73,26 +65,5 @@ type VMProbeNamespaceLister interface { // vMProbeNamespaceLister implements the VMProbeNamespaceLister // interface. type vMProbeNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMProbes in the indexer for a given namespace. -func (s vMProbeNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMProbe, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMProbe)) - }) - return ret, err -} - -// Get retrieves the VMProbe from the indexer for a given namespace and name. -func (s vMProbeNamespaceLister) Get(name string) (*v1beta1.VMProbe, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmprobe"), name) - } - return obj.(*v1beta1.VMProbe), nil + listers.ResourceIndexer[*v1beta1.VMProbe] } diff --git a/api/client/listers/operator/v1beta1/vmrule.go b/api/client/listers/operator/v1beta1/vmrule.go index 05b2f067..d4feceb1 100644 --- a/api/client/listers/operator/v1beta1/vmrule.go +++ b/api/client/listers/operator/v1beta1/vmrule.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMRuleLister interface { // vMRuleLister implements the VMRuleLister interface. type vMRuleLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMRule] } // NewVMRuleLister returns a new VMRuleLister. func NewVMRuleLister(indexer cache.Indexer) VMRuleLister { - return &vMRuleLister{indexer: indexer} -} - -// List lists all VMRules in the indexer. -func (s *vMRuleLister) List(selector labels.Selector) (ret []*v1beta1.VMRule, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMRule)) - }) - return ret, err + return &vMRuleLister{listers.New[*v1beta1.VMRule](indexer, v1beta1.Resource("vmrule"))} } // VMRules returns an object that can list and get VMRules. func (s *vMRuleLister) VMRules(namespace string) VMRuleNamespaceLister { - return vMRuleNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMRuleNamespaceLister{listers.NewNamespaced[*v1beta1.VMRule](s.ResourceIndexer, namespace)} } // VMRuleNamespaceLister helps list and get VMRules. @@ -73,26 +65,5 @@ type VMRuleNamespaceLister interface { // vMRuleNamespaceLister implements the VMRuleNamespaceLister // interface. type vMRuleNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMRules in the indexer for a given namespace. -func (s vMRuleNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMRule, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMRule)) - }) - return ret, err -} - -// Get retrieves the VMRule from the indexer for a given namespace and name. -func (s vMRuleNamespaceLister) Get(name string) (*v1beta1.VMRule, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmrule"), name) - } - return obj.(*v1beta1.VMRule), nil + listers.ResourceIndexer[*v1beta1.VMRule] } diff --git a/api/client/listers/operator/v1beta1/vmscrapeconfig.go b/api/client/listers/operator/v1beta1/vmscrapeconfig.go index 38d718cc..331a78f0 100644 --- a/api/client/listers/operator/v1beta1/vmscrapeconfig.go +++ b/api/client/listers/operator/v1beta1/vmscrapeconfig.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMScrapeConfigLister interface { // vMScrapeConfigLister implements the VMScrapeConfigLister interface. type vMScrapeConfigLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMScrapeConfig] } // NewVMScrapeConfigLister returns a new VMScrapeConfigLister. func NewVMScrapeConfigLister(indexer cache.Indexer) VMScrapeConfigLister { - return &vMScrapeConfigLister{indexer: indexer} -} - -// List lists all VMScrapeConfigs in the indexer. -func (s *vMScrapeConfigLister) List(selector labels.Selector) (ret []*v1beta1.VMScrapeConfig, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMScrapeConfig)) - }) - return ret, err + return &vMScrapeConfigLister{listers.New[*v1beta1.VMScrapeConfig](indexer, v1beta1.Resource("vmscrapeconfig"))} } // VMScrapeConfigs returns an object that can list and get VMScrapeConfigs. func (s *vMScrapeConfigLister) VMScrapeConfigs(namespace string) VMScrapeConfigNamespaceLister { - return vMScrapeConfigNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMScrapeConfigNamespaceLister{listers.NewNamespaced[*v1beta1.VMScrapeConfig](s.ResourceIndexer, namespace)} } // VMScrapeConfigNamespaceLister helps list and get VMScrapeConfigs. @@ -73,26 +65,5 @@ type VMScrapeConfigNamespaceLister interface { // vMScrapeConfigNamespaceLister implements the VMScrapeConfigNamespaceLister // interface. type vMScrapeConfigNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMScrapeConfigs in the indexer for a given namespace. -func (s vMScrapeConfigNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMScrapeConfig, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMScrapeConfig)) - }) - return ret, err -} - -// Get retrieves the VMScrapeConfig from the indexer for a given namespace and name. -func (s vMScrapeConfigNamespaceLister) Get(name string) (*v1beta1.VMScrapeConfig, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmscrapeconfig"), name) - } - return obj.(*v1beta1.VMScrapeConfig), nil + listers.ResourceIndexer[*v1beta1.VMScrapeConfig] } diff --git a/api/client/listers/operator/v1beta1/vmservicescrape.go b/api/client/listers/operator/v1beta1/vmservicescrape.go index aea4e63d..a8f176df 100644 --- a/api/client/listers/operator/v1beta1/vmservicescrape.go +++ b/api/client/listers/operator/v1beta1/vmservicescrape.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMServiceScrapeLister interface { // vMServiceScrapeLister implements the VMServiceScrapeLister interface. type vMServiceScrapeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMServiceScrape] } // NewVMServiceScrapeLister returns a new VMServiceScrapeLister. func NewVMServiceScrapeLister(indexer cache.Indexer) VMServiceScrapeLister { - return &vMServiceScrapeLister{indexer: indexer} -} - -// List lists all VMServiceScrapes in the indexer. -func (s *vMServiceScrapeLister) List(selector labels.Selector) (ret []*v1beta1.VMServiceScrape, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMServiceScrape)) - }) - return ret, err + return &vMServiceScrapeLister{listers.New[*v1beta1.VMServiceScrape](indexer, v1beta1.Resource("vmservicescrape"))} } // VMServiceScrapes returns an object that can list and get VMServiceScrapes. func (s *vMServiceScrapeLister) VMServiceScrapes(namespace string) VMServiceScrapeNamespaceLister { - return vMServiceScrapeNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMServiceScrapeNamespaceLister{listers.NewNamespaced[*v1beta1.VMServiceScrape](s.ResourceIndexer, namespace)} } // VMServiceScrapeNamespaceLister helps list and get VMServiceScrapes. @@ -73,26 +65,5 @@ type VMServiceScrapeNamespaceLister interface { // vMServiceScrapeNamespaceLister implements the VMServiceScrapeNamespaceLister // interface. type vMServiceScrapeNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMServiceScrapes in the indexer for a given namespace. -func (s vMServiceScrapeNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMServiceScrape, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMServiceScrape)) - }) - return ret, err -} - -// Get retrieves the VMServiceScrape from the indexer for a given namespace and name. -func (s vMServiceScrapeNamespaceLister) Get(name string) (*v1beta1.VMServiceScrape, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmservicescrape"), name) - } - return obj.(*v1beta1.VMServiceScrape), nil + listers.ResourceIndexer[*v1beta1.VMServiceScrape] } diff --git a/api/client/listers/operator/v1beta1/vmsingle.go b/api/client/listers/operator/v1beta1/vmsingle.go index 408648a7..e5cccbe9 100644 --- a/api/client/listers/operator/v1beta1/vmsingle.go +++ b/api/client/listers/operator/v1beta1/vmsingle.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMSingleLister interface { // vMSingleLister implements the VMSingleLister interface. type vMSingleLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMSingle] } // NewVMSingleLister returns a new VMSingleLister. func NewVMSingleLister(indexer cache.Indexer) VMSingleLister { - return &vMSingleLister{indexer: indexer} -} - -// List lists all VMSingles in the indexer. -func (s *vMSingleLister) List(selector labels.Selector) (ret []*v1beta1.VMSingle, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMSingle)) - }) - return ret, err + return &vMSingleLister{listers.New[*v1beta1.VMSingle](indexer, v1beta1.Resource("vmsingle"))} } // VMSingles returns an object that can list and get VMSingles. func (s *vMSingleLister) VMSingles(namespace string) VMSingleNamespaceLister { - return vMSingleNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMSingleNamespaceLister{listers.NewNamespaced[*v1beta1.VMSingle](s.ResourceIndexer, namespace)} } // VMSingleNamespaceLister helps list and get VMSingles. @@ -73,26 +65,5 @@ type VMSingleNamespaceLister interface { // vMSingleNamespaceLister implements the VMSingleNamespaceLister // interface. type vMSingleNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMSingles in the indexer for a given namespace. -func (s vMSingleNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMSingle, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMSingle)) - }) - return ret, err -} - -// Get retrieves the VMSingle from the indexer for a given namespace and name. -func (s vMSingleNamespaceLister) Get(name string) (*v1beta1.VMSingle, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmsingle"), name) - } - return obj.(*v1beta1.VMSingle), nil + listers.ResourceIndexer[*v1beta1.VMSingle] } diff --git a/api/client/listers/operator/v1beta1/vmstaticscrape.go b/api/client/listers/operator/v1beta1/vmstaticscrape.go index 8c88761a..c1d79089 100644 --- a/api/client/listers/operator/v1beta1/vmstaticscrape.go +++ b/api/client/listers/operator/v1beta1/vmstaticscrape.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMStaticScrapeLister interface { // vMStaticScrapeLister implements the VMStaticScrapeLister interface. type vMStaticScrapeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMStaticScrape] } // NewVMStaticScrapeLister returns a new VMStaticScrapeLister. func NewVMStaticScrapeLister(indexer cache.Indexer) VMStaticScrapeLister { - return &vMStaticScrapeLister{indexer: indexer} -} - -// List lists all VMStaticScrapes in the indexer. -func (s *vMStaticScrapeLister) List(selector labels.Selector) (ret []*v1beta1.VMStaticScrape, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMStaticScrape)) - }) - return ret, err + return &vMStaticScrapeLister{listers.New[*v1beta1.VMStaticScrape](indexer, v1beta1.Resource("vmstaticscrape"))} } // VMStaticScrapes returns an object that can list and get VMStaticScrapes. func (s *vMStaticScrapeLister) VMStaticScrapes(namespace string) VMStaticScrapeNamespaceLister { - return vMStaticScrapeNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMStaticScrapeNamespaceLister{listers.NewNamespaced[*v1beta1.VMStaticScrape](s.ResourceIndexer, namespace)} } // VMStaticScrapeNamespaceLister helps list and get VMStaticScrapes. @@ -73,26 +65,5 @@ type VMStaticScrapeNamespaceLister interface { // vMStaticScrapeNamespaceLister implements the VMStaticScrapeNamespaceLister // interface. type vMStaticScrapeNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMStaticScrapes in the indexer for a given namespace. -func (s vMStaticScrapeNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMStaticScrape, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMStaticScrape)) - }) - return ret, err -} - -// Get retrieves the VMStaticScrape from the indexer for a given namespace and name. -func (s vMStaticScrapeNamespaceLister) Get(name string) (*v1beta1.VMStaticScrape, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmstaticscrape"), name) - } - return obj.(*v1beta1.VMStaticScrape), nil + listers.ResourceIndexer[*v1beta1.VMStaticScrape] } diff --git a/api/client/listers/operator/v1beta1/vmuser.go b/api/client/listers/operator/v1beta1/vmuser.go index 7bf35300..718eded0 100644 --- a/api/client/listers/operator/v1beta1/vmuser.go +++ b/api/client/listers/operator/v1beta1/vmuser.go @@ -13,14 +13,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by lister-gen-v0.30. DO NOT EDIT. +// Code generated by lister-gen-v0.31. DO NOT EDIT. package v1beta1 import ( v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -37,25 +37,17 @@ type VMUserLister interface { // vMUserLister implements the VMUserLister interface. type vMUserLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VMUser] } // NewVMUserLister returns a new VMUserLister. func NewVMUserLister(indexer cache.Indexer) VMUserLister { - return &vMUserLister{indexer: indexer} -} - -// List lists all VMUsers in the indexer. -func (s *vMUserLister) List(selector labels.Selector) (ret []*v1beta1.VMUser, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMUser)) - }) - return ret, err + return &vMUserLister{listers.New[*v1beta1.VMUser](indexer, v1beta1.Resource("vmuser"))} } // VMUsers returns an object that can list and get VMUsers. func (s *vMUserLister) VMUsers(namespace string) VMUserNamespaceLister { - return vMUserNamespaceLister{indexer: s.indexer, namespace: namespace} + return vMUserNamespaceLister{listers.NewNamespaced[*v1beta1.VMUser](s.ResourceIndexer, namespace)} } // VMUserNamespaceLister helps list and get VMUsers. @@ -73,26 +65,5 @@ type VMUserNamespaceLister interface { // vMUserNamespaceLister implements the VMUserNamespaceLister // interface. type vMUserNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VMUsers in the indexer for a given namespace. -func (s vMUserNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VMUser, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VMUser)) - }) - return ret, err -} - -// Get retrieves the VMUser from the indexer for a given namespace and name. -func (s vMUserNamespaceLister) Get(name string) (*v1beta1.VMUser, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("vmuser"), name) - } - return obj.(*v1beta1.VMUser), nil + listers.ResourceIndexer[*v1beta1.VMUser] } diff --git a/api/client/versioned/clientset.go b/api/client/versioned/clientset.go index 91e2f237..fb591a47 100644 --- a/api/client/versioned/clientset.go +++ b/api/client/versioned/clientset.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package versioned diff --git a/api/client/versioned/fake/clientset_generated.go b/api/client/versioned/fake/clientset_generated.go index 6b6c49c8..488bbc92 100644 --- a/api/client/versioned/fake/clientset_generated.go +++ b/api/client/versioned/fake/clientset_generated.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -30,8 +30,12 @@ import ( // NewSimpleClientset returns a clientset that will respond with the provided objects. // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). func NewSimpleClientset(objects ...runtime.Object) *Clientset { o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects { diff --git a/api/client/versioned/fake/doc.go b/api/client/versioned/fake/doc.go index 162bb37e..7d0f1f29 100644 --- a/api/client/versioned/fake/doc.go +++ b/api/client/versioned/fake/doc.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. // This package has the automatically generated fake clientset. package fake diff --git a/api/client/versioned/fake/register.go b/api/client/versioned/fake/register.go index a98db04b..3df2212d 100644 --- a/api/client/versioned/fake/register.go +++ b/api/client/versioned/fake/register.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake diff --git a/api/client/versioned/scheme/doc.go b/api/client/versioned/scheme/doc.go index 328cb96d..da4d6b02 100644 --- a/api/client/versioned/scheme/doc.go +++ b/api/client/versioned/scheme/doc.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. // This package contains the scheme of the automatically generated clientset. package scheme diff --git a/api/client/versioned/scheme/register.go b/api/client/versioned/scheme/register.go index be5c7f0e..dd5c0325 100644 --- a/api/client/versioned/scheme/register.go +++ b/api/client/versioned/scheme/register.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package scheme diff --git a/api/client/versioned/typed/operator/v1beta1/doc.go b/api/client/versioned/typed/operator/v1beta1/doc.go index 7adf6b47..9588af1f 100644 --- a/api/client/versioned/typed/operator/v1beta1/doc.go +++ b/api/client/versioned/typed/operator/v1beta1/doc.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. // This package has the automatically generated typed clients. package v1beta1 diff --git a/api/client/versioned/typed/operator/v1beta1/fake/doc.go b/api/client/versioned/typed/operator/v1beta1/fake/doc.go index 3105dee2..7f4b3112 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/doc.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/doc.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. // Package fake has the automatically generated clients. package fake diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_operator_client.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_operator_client.go index 07bdec7f..6ead2526 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_operator_client.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_operator_client.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vlogs.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vlogs.go index 808386e1..c714887e 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vlogs.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vlogs.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vlogsKind = v1beta1.SchemeGroupVersion.WithKind("VLogs") // Get takes name of the vLogs, and returns the corresponding vLogs object, and an error if there is any. func (c *FakeVLogs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VLogs, err error) { + emptyResult := &v1beta1.VLogs{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vlogsResource, c.ns, name), &v1beta1.VLogs{}) + Invokes(testing.NewGetActionWithOptions(vlogsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VLogs), err } // List takes label and field selectors, and returns the list of VLogs that match those selectors. func (c *FakeVLogs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VLogsList, err error) { + emptyResult := &v1beta1.VLogsList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vlogsResource, vlogsKind, c.ns, opts), &v1beta1.VLogsList{}) + Invokes(testing.NewListActionWithOptions(vlogsResource, vlogsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVLogs) List(ctx context.Context, opts v1.ListOptions) (result *v1be // Watch returns a watch.Interface that watches the requested vLogs. func (c *FakeVLogs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vlogsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vlogsResource, c.ns, opts)) } // Create takes the representation of a vLogs and creates it. Returns the server's representation of the vLogs, and an error, if there is any. func (c *FakeVLogs) Create(ctx context.Context, vLogs *v1beta1.VLogs, opts v1.CreateOptions) (result *v1beta1.VLogs, err error) { + emptyResult := &v1beta1.VLogs{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vlogsResource, c.ns, vLogs), &v1beta1.VLogs{}) + Invokes(testing.NewCreateActionWithOptions(vlogsResource, c.ns, vLogs, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VLogs), err } // Update takes the representation of a vLogs and updates it. Returns the server's representation of the vLogs, and an error, if there is any. func (c *FakeVLogs) Update(ctx context.Context, vLogs *v1beta1.VLogs, opts v1.UpdateOptions) (result *v1beta1.VLogs, err error) { + emptyResult := &v1beta1.VLogs{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vlogsResource, c.ns, vLogs), &v1beta1.VLogs{}) + Invokes(testing.NewUpdateActionWithOptions(vlogsResource, c.ns, vLogs, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VLogs), 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 *FakeVLogs) UpdateStatus(ctx context.Context, vLogs *v1beta1.VLogs, opts v1.UpdateOptions) (*v1beta1.VLogs, error) { +func (c *FakeVLogs) UpdateStatus(ctx context.Context, vLogs *v1beta1.VLogs, opts v1.UpdateOptions) (result *v1beta1.VLogs, err error) { + emptyResult := &v1beta1.VLogs{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vlogsResource, "status", c.ns, vLogs), &v1beta1.VLogs{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vlogsResource, "status", c.ns, vLogs, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VLogs), err } @@ -122,7 +127,7 @@ func (c *FakeVLogs) Delete(ctx context.Context, name string, opts v1.DeleteOptio // DeleteCollection deletes a collection of objects. func (c *FakeVLogs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vlogsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vlogsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VLogsList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVLogs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, // Patch applies the patch and returns the patched vLogs. func (c *FakeVLogs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VLogs, err error) { + emptyResult := &v1beta1.VLogs{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vlogsResource, c.ns, name, pt, data, subresources...), &v1beta1.VLogs{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vlogsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VLogs), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmagent.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmagent.go index d5053a23..e084ac0b 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmagent.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmagent.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmagentsKind = v1beta1.SchemeGroupVersion.WithKind("VMAgent") // Get takes name of the vMAgent, and returns the corresponding vMAgent object, and an error if there is any. func (c *FakeVMAgents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMAgent, err error) { + emptyResult := &v1beta1.VMAgent{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmagentsResource, c.ns, name), &v1beta1.VMAgent{}) + Invokes(testing.NewGetActionWithOptions(vmagentsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAgent), err } // List takes label and field selectors, and returns the list of VMAgents that match those selectors. func (c *FakeVMAgents) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMAgentList, err error) { + emptyResult := &v1beta1.VMAgentList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmagentsResource, vmagentsKind, c.ns, opts), &v1beta1.VMAgentList{}) + Invokes(testing.NewListActionWithOptions(vmagentsResource, vmagentsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMAgents) List(ctx context.Context, opts v1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested vMAgents. func (c *FakeVMAgents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmagentsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmagentsResource, c.ns, opts)) } // Create takes the representation of a vMAgent and creates it. Returns the server's representation of the vMAgent, and an error, if there is any. func (c *FakeVMAgents) Create(ctx context.Context, vMAgent *v1beta1.VMAgent, opts v1.CreateOptions) (result *v1beta1.VMAgent, err error) { + emptyResult := &v1beta1.VMAgent{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmagentsResource, c.ns, vMAgent), &v1beta1.VMAgent{}) + Invokes(testing.NewCreateActionWithOptions(vmagentsResource, c.ns, vMAgent, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAgent), err } // Update takes the representation of a vMAgent and updates it. Returns the server's representation of the vMAgent, and an error, if there is any. func (c *FakeVMAgents) Update(ctx context.Context, vMAgent *v1beta1.VMAgent, opts v1.UpdateOptions) (result *v1beta1.VMAgent, err error) { + emptyResult := &v1beta1.VMAgent{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmagentsResource, c.ns, vMAgent), &v1beta1.VMAgent{}) + Invokes(testing.NewUpdateActionWithOptions(vmagentsResource, c.ns, vMAgent, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAgent), 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 *FakeVMAgents) UpdateStatus(ctx context.Context, vMAgent *v1beta1.VMAgent, opts v1.UpdateOptions) (*v1beta1.VMAgent, error) { +func (c *FakeVMAgents) UpdateStatus(ctx context.Context, vMAgent *v1beta1.VMAgent, opts v1.UpdateOptions) (result *v1beta1.VMAgent, err error) { + emptyResult := &v1beta1.VMAgent{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmagentsResource, "status", c.ns, vMAgent), &v1beta1.VMAgent{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmagentsResource, "status", c.ns, vMAgent, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAgent), err } @@ -122,7 +127,7 @@ func (c *FakeVMAgents) Delete(ctx context.Context, name string, opts v1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakeVMAgents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmagentsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmagentsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMAgentList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMAgents) DeleteCollection(ctx context.Context, opts v1.DeleteOptio // Patch applies the patch and returns the patched vMAgent. func (c *FakeVMAgents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMAgent, err error) { + emptyResult := &v1beta1.VMAgent{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmagentsResource, c.ns, name, pt, data, subresources...), &v1beta1.VMAgent{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmagentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAgent), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmalert.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmalert.go index e2dfb691..32598403 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmalert.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmalert.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmalertsKind = v1beta1.SchemeGroupVersion.WithKind("VMAlert") // Get takes name of the vMAlert, and returns the corresponding vMAlert object, and an error if there is any. func (c *FakeVMAlerts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMAlert, err error) { + emptyResult := &v1beta1.VMAlert{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmalertsResource, c.ns, name), &v1beta1.VMAlert{}) + Invokes(testing.NewGetActionWithOptions(vmalertsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlert), err } // List takes label and field selectors, and returns the list of VMAlerts that match those selectors. func (c *FakeVMAlerts) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMAlertList, err error) { + emptyResult := &v1beta1.VMAlertList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmalertsResource, vmalertsKind, c.ns, opts), &v1beta1.VMAlertList{}) + Invokes(testing.NewListActionWithOptions(vmalertsResource, vmalertsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMAlerts) List(ctx context.Context, opts v1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested vMAlerts. func (c *FakeVMAlerts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmalertsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmalertsResource, c.ns, opts)) } // Create takes the representation of a vMAlert and creates it. Returns the server's representation of the vMAlert, and an error, if there is any. func (c *FakeVMAlerts) Create(ctx context.Context, vMAlert *v1beta1.VMAlert, opts v1.CreateOptions) (result *v1beta1.VMAlert, err error) { + emptyResult := &v1beta1.VMAlert{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmalertsResource, c.ns, vMAlert), &v1beta1.VMAlert{}) + Invokes(testing.NewCreateActionWithOptions(vmalertsResource, c.ns, vMAlert, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlert), err } // Update takes the representation of a vMAlert and updates it. Returns the server's representation of the vMAlert, and an error, if there is any. func (c *FakeVMAlerts) Update(ctx context.Context, vMAlert *v1beta1.VMAlert, opts v1.UpdateOptions) (result *v1beta1.VMAlert, err error) { + emptyResult := &v1beta1.VMAlert{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmalertsResource, c.ns, vMAlert), &v1beta1.VMAlert{}) + Invokes(testing.NewUpdateActionWithOptions(vmalertsResource, c.ns, vMAlert, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlert), 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 *FakeVMAlerts) UpdateStatus(ctx context.Context, vMAlert *v1beta1.VMAlert, opts v1.UpdateOptions) (*v1beta1.VMAlert, error) { +func (c *FakeVMAlerts) UpdateStatus(ctx context.Context, vMAlert *v1beta1.VMAlert, opts v1.UpdateOptions) (result *v1beta1.VMAlert, err error) { + emptyResult := &v1beta1.VMAlert{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmalertsResource, "status", c.ns, vMAlert), &v1beta1.VMAlert{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmalertsResource, "status", c.ns, vMAlert, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlert), err } @@ -122,7 +127,7 @@ func (c *FakeVMAlerts) Delete(ctx context.Context, name string, opts v1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakeVMAlerts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmalertsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmalertsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMAlertList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMAlerts) DeleteCollection(ctx context.Context, opts v1.DeleteOptio // Patch applies the patch and returns the patched vMAlert. func (c *FakeVMAlerts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMAlert, err error) { + emptyResult := &v1beta1.VMAlert{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmalertsResource, c.ns, name, pt, data, subresources...), &v1beta1.VMAlert{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmalertsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlert), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmalertmanager.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmalertmanager.go index 644c207c..2fb15859 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmalertmanager.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmalertmanager.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmalertmanagersKind = v1beta1.SchemeGroupVersion.WithKind("VMAlertmanager") // Get takes name of the vMAlertmanager, and returns the corresponding vMAlertmanager object, and an error if there is any. func (c *FakeVMAlertmanagers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMAlertmanager, err error) { + emptyResult := &v1beta1.VMAlertmanager{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmalertmanagersResource, c.ns, name), &v1beta1.VMAlertmanager{}) + Invokes(testing.NewGetActionWithOptions(vmalertmanagersResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlertmanager), err } // List takes label and field selectors, and returns the list of VMAlertmanagers that match those selectors. func (c *FakeVMAlertmanagers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMAlertmanagerList, err error) { + emptyResult := &v1beta1.VMAlertmanagerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmalertmanagersResource, vmalertmanagersKind, c.ns, opts), &v1beta1.VMAlertmanagerList{}) + Invokes(testing.NewListActionWithOptions(vmalertmanagersResource, vmalertmanagersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMAlertmanagers) List(ctx context.Context, opts v1.ListOptions) (re // Watch returns a watch.Interface that watches the requested vMAlertmanagers. func (c *FakeVMAlertmanagers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmalertmanagersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmalertmanagersResource, c.ns, opts)) } // Create takes the representation of a vMAlertmanager and creates it. Returns the server's representation of the vMAlertmanager, and an error, if there is any. func (c *FakeVMAlertmanagers) Create(ctx context.Context, vMAlertmanager *v1beta1.VMAlertmanager, opts v1.CreateOptions) (result *v1beta1.VMAlertmanager, err error) { + emptyResult := &v1beta1.VMAlertmanager{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmalertmanagersResource, c.ns, vMAlertmanager), &v1beta1.VMAlertmanager{}) + Invokes(testing.NewCreateActionWithOptions(vmalertmanagersResource, c.ns, vMAlertmanager, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlertmanager), err } // Update takes the representation of a vMAlertmanager and updates it. Returns the server's representation of the vMAlertmanager, and an error, if there is any. func (c *FakeVMAlertmanagers) Update(ctx context.Context, vMAlertmanager *v1beta1.VMAlertmanager, opts v1.UpdateOptions) (result *v1beta1.VMAlertmanager, err error) { + emptyResult := &v1beta1.VMAlertmanager{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmalertmanagersResource, c.ns, vMAlertmanager), &v1beta1.VMAlertmanager{}) + Invokes(testing.NewUpdateActionWithOptions(vmalertmanagersResource, c.ns, vMAlertmanager, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlertmanager), 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 *FakeVMAlertmanagers) UpdateStatus(ctx context.Context, vMAlertmanager *v1beta1.VMAlertmanager, opts v1.UpdateOptions) (*v1beta1.VMAlertmanager, error) { +func (c *FakeVMAlertmanagers) UpdateStatus(ctx context.Context, vMAlertmanager *v1beta1.VMAlertmanager, opts v1.UpdateOptions) (result *v1beta1.VMAlertmanager, err error) { + emptyResult := &v1beta1.VMAlertmanager{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmalertmanagersResource, "status", c.ns, vMAlertmanager), &v1beta1.VMAlertmanager{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmalertmanagersResource, "status", c.ns, vMAlertmanager, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlertmanager), err } @@ -122,7 +127,7 @@ func (c *FakeVMAlertmanagers) Delete(ctx context.Context, name string, opts v1.D // DeleteCollection deletes a collection of objects. func (c *FakeVMAlertmanagers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmalertmanagersResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmalertmanagersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMAlertmanagerList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMAlertmanagers) DeleteCollection(ctx context.Context, opts v1.Dele // Patch applies the patch and returns the patched vMAlertmanager. func (c *FakeVMAlertmanagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMAlertmanager, err error) { + emptyResult := &v1beta1.VMAlertmanager{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmalertmanagersResource, c.ns, name, pt, data, subresources...), &v1beta1.VMAlertmanager{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmalertmanagersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlertmanager), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmalertmanagerconfig.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmalertmanagerconfig.go index 10e59162..ea039122 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmalertmanagerconfig.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmalertmanagerconfig.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmalertmanagerconfigsKind = v1beta1.SchemeGroupVersion.WithKind("VMAlertmana // Get takes name of the vMAlertmanagerConfig, and returns the corresponding vMAlertmanagerConfig object, and an error if there is any. func (c *FakeVMAlertmanagerConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMAlertmanagerConfig, err error) { + emptyResult := &v1beta1.VMAlertmanagerConfig{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmalertmanagerconfigsResource, c.ns, name), &v1beta1.VMAlertmanagerConfig{}) + Invokes(testing.NewGetActionWithOptions(vmalertmanagerconfigsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlertmanagerConfig), err } // List takes label and field selectors, and returns the list of VMAlertmanagerConfigs that match those selectors. func (c *FakeVMAlertmanagerConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMAlertmanagerConfigList, err error) { + emptyResult := &v1beta1.VMAlertmanagerConfigList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmalertmanagerconfigsResource, vmalertmanagerconfigsKind, c.ns, opts), &v1beta1.VMAlertmanagerConfigList{}) + Invokes(testing.NewListActionWithOptions(vmalertmanagerconfigsResource, vmalertmanagerconfigsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMAlertmanagerConfigs) List(ctx context.Context, opts v1.ListOption // Watch returns a watch.Interface that watches the requested vMAlertmanagerConfigs. func (c *FakeVMAlertmanagerConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmalertmanagerconfigsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmalertmanagerconfigsResource, c.ns, opts)) } // Create takes the representation of a vMAlertmanagerConfig and creates it. Returns the server's representation of the vMAlertmanagerConfig, and an error, if there is any. func (c *FakeVMAlertmanagerConfigs) Create(ctx context.Context, vMAlertmanagerConfig *v1beta1.VMAlertmanagerConfig, opts v1.CreateOptions) (result *v1beta1.VMAlertmanagerConfig, err error) { + emptyResult := &v1beta1.VMAlertmanagerConfig{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmalertmanagerconfigsResource, c.ns, vMAlertmanagerConfig), &v1beta1.VMAlertmanagerConfig{}) + Invokes(testing.NewCreateActionWithOptions(vmalertmanagerconfigsResource, c.ns, vMAlertmanagerConfig, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlertmanagerConfig), err } // Update takes the representation of a vMAlertmanagerConfig and updates it. Returns the server's representation of the vMAlertmanagerConfig, and an error, if there is any. func (c *FakeVMAlertmanagerConfigs) Update(ctx context.Context, vMAlertmanagerConfig *v1beta1.VMAlertmanagerConfig, opts v1.UpdateOptions) (result *v1beta1.VMAlertmanagerConfig, err error) { + emptyResult := &v1beta1.VMAlertmanagerConfig{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmalertmanagerconfigsResource, c.ns, vMAlertmanagerConfig), &v1beta1.VMAlertmanagerConfig{}) + Invokes(testing.NewUpdateActionWithOptions(vmalertmanagerconfigsResource, c.ns, vMAlertmanagerConfig, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlertmanagerConfig), 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 *FakeVMAlertmanagerConfigs) UpdateStatus(ctx context.Context, vMAlertmanagerConfig *v1beta1.VMAlertmanagerConfig, opts v1.UpdateOptions) (*v1beta1.VMAlertmanagerConfig, error) { +func (c *FakeVMAlertmanagerConfigs) UpdateStatus(ctx context.Context, vMAlertmanagerConfig *v1beta1.VMAlertmanagerConfig, opts v1.UpdateOptions) (result *v1beta1.VMAlertmanagerConfig, err error) { + emptyResult := &v1beta1.VMAlertmanagerConfig{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmalertmanagerconfigsResource, "status", c.ns, vMAlertmanagerConfig), &v1beta1.VMAlertmanagerConfig{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmalertmanagerconfigsResource, "status", c.ns, vMAlertmanagerConfig, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlertmanagerConfig), err } @@ -122,7 +127,7 @@ func (c *FakeVMAlertmanagerConfigs) Delete(ctx context.Context, name string, opt // DeleteCollection deletes a collection of objects. func (c *FakeVMAlertmanagerConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmalertmanagerconfigsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmalertmanagerconfigsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMAlertmanagerConfigList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMAlertmanagerConfigs) DeleteCollection(ctx context.Context, opts v // Patch applies the patch and returns the patched vMAlertmanagerConfig. func (c *FakeVMAlertmanagerConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMAlertmanagerConfig, err error) { + emptyResult := &v1beta1.VMAlertmanagerConfig{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmalertmanagerconfigsResource, c.ns, name, pt, data, subresources...), &v1beta1.VMAlertmanagerConfig{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmalertmanagerconfigsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAlertmanagerConfig), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmauth.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmauth.go index e5021d67..9959a930 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmauth.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmauth.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmauthsKind = v1beta1.SchemeGroupVersion.WithKind("VMAuth") // Get takes name of the vMAuth, and returns the corresponding vMAuth object, and an error if there is any. func (c *FakeVMAuths) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMAuth, err error) { + emptyResult := &v1beta1.VMAuth{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmauthsResource, c.ns, name), &v1beta1.VMAuth{}) + Invokes(testing.NewGetActionWithOptions(vmauthsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAuth), err } // List takes label and field selectors, and returns the list of VMAuths that match those selectors. func (c *FakeVMAuths) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMAuthList, err error) { + emptyResult := &v1beta1.VMAuthList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmauthsResource, vmauthsKind, c.ns, opts), &v1beta1.VMAuthList{}) + Invokes(testing.NewListActionWithOptions(vmauthsResource, vmauthsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMAuths) List(ctx context.Context, opts v1.ListOptions) (result *v1 // Watch returns a watch.Interface that watches the requested vMAuths. func (c *FakeVMAuths) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmauthsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmauthsResource, c.ns, opts)) } // Create takes the representation of a vMAuth and creates it. Returns the server's representation of the vMAuth, and an error, if there is any. func (c *FakeVMAuths) Create(ctx context.Context, vMAuth *v1beta1.VMAuth, opts v1.CreateOptions) (result *v1beta1.VMAuth, err error) { + emptyResult := &v1beta1.VMAuth{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmauthsResource, c.ns, vMAuth), &v1beta1.VMAuth{}) + Invokes(testing.NewCreateActionWithOptions(vmauthsResource, c.ns, vMAuth, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAuth), err } // Update takes the representation of a vMAuth and updates it. Returns the server's representation of the vMAuth, and an error, if there is any. func (c *FakeVMAuths) Update(ctx context.Context, vMAuth *v1beta1.VMAuth, opts v1.UpdateOptions) (result *v1beta1.VMAuth, err error) { + emptyResult := &v1beta1.VMAuth{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmauthsResource, c.ns, vMAuth), &v1beta1.VMAuth{}) + Invokes(testing.NewUpdateActionWithOptions(vmauthsResource, c.ns, vMAuth, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAuth), 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 *FakeVMAuths) UpdateStatus(ctx context.Context, vMAuth *v1beta1.VMAuth, opts v1.UpdateOptions) (*v1beta1.VMAuth, error) { +func (c *FakeVMAuths) UpdateStatus(ctx context.Context, vMAuth *v1beta1.VMAuth, opts v1.UpdateOptions) (result *v1beta1.VMAuth, err error) { + emptyResult := &v1beta1.VMAuth{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmauthsResource, "status", c.ns, vMAuth), &v1beta1.VMAuth{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmauthsResource, "status", c.ns, vMAuth, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAuth), err } @@ -122,7 +127,7 @@ func (c *FakeVMAuths) Delete(ctx context.Context, name string, opts v1.DeleteOpt // DeleteCollection deletes a collection of objects. func (c *FakeVMAuths) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmauthsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmauthsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMAuthList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMAuths) DeleteCollection(ctx context.Context, opts v1.DeleteOption // Patch applies the patch and returns the patched vMAuth. func (c *FakeVMAuths) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMAuth, err error) { + emptyResult := &v1beta1.VMAuth{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmauthsResource, c.ns, name, pt, data, subresources...), &v1beta1.VMAuth{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmauthsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMAuth), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmcluster.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmcluster.go index 8cbea830..19843d4e 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmcluster.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmcluster.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmclustersKind = v1beta1.SchemeGroupVersion.WithKind("VMCluster") // Get takes name of the vMCluster, and returns the corresponding vMCluster object, and an error if there is any. func (c *FakeVMClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMCluster, err error) { + emptyResult := &v1beta1.VMCluster{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmclustersResource, c.ns, name), &v1beta1.VMCluster{}) + Invokes(testing.NewGetActionWithOptions(vmclustersResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMCluster), err } // List takes label and field selectors, and returns the list of VMClusters that match those selectors. func (c *FakeVMClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMClusterList, err error) { + emptyResult := &v1beta1.VMClusterList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmclustersResource, vmclustersKind, c.ns, opts), &v1beta1.VMClusterList{}) + Invokes(testing.NewListActionWithOptions(vmclustersResource, vmclustersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMClusters) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested vMClusters. func (c *FakeVMClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmclustersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmclustersResource, c.ns, opts)) } // Create takes the representation of a vMCluster and creates it. Returns the server's representation of the vMCluster, and an error, if there is any. func (c *FakeVMClusters) Create(ctx context.Context, vMCluster *v1beta1.VMCluster, opts v1.CreateOptions) (result *v1beta1.VMCluster, err error) { + emptyResult := &v1beta1.VMCluster{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmclustersResource, c.ns, vMCluster), &v1beta1.VMCluster{}) + Invokes(testing.NewCreateActionWithOptions(vmclustersResource, c.ns, vMCluster, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMCluster), err } // Update takes the representation of a vMCluster and updates it. Returns the server's representation of the vMCluster, and an error, if there is any. func (c *FakeVMClusters) Update(ctx context.Context, vMCluster *v1beta1.VMCluster, opts v1.UpdateOptions) (result *v1beta1.VMCluster, err error) { + emptyResult := &v1beta1.VMCluster{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmclustersResource, c.ns, vMCluster), &v1beta1.VMCluster{}) + Invokes(testing.NewUpdateActionWithOptions(vmclustersResource, c.ns, vMCluster, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMCluster), 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 *FakeVMClusters) UpdateStatus(ctx context.Context, vMCluster *v1beta1.VMCluster, opts v1.UpdateOptions) (*v1beta1.VMCluster, error) { +func (c *FakeVMClusters) UpdateStatus(ctx context.Context, vMCluster *v1beta1.VMCluster, opts v1.UpdateOptions) (result *v1beta1.VMCluster, err error) { + emptyResult := &v1beta1.VMCluster{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmclustersResource, "status", c.ns, vMCluster), &v1beta1.VMCluster{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmclustersResource, "status", c.ns, vMCluster, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMCluster), err } @@ -122,7 +127,7 @@ func (c *FakeVMClusters) Delete(ctx context.Context, name string, opts v1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeVMClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmclustersResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmclustersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMClusterList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOpt // Patch applies the patch and returns the patched vMCluster. func (c *FakeVMClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMCluster, err error) { + emptyResult := &v1beta1.VMCluster{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmclustersResource, c.ns, name, pt, data, subresources...), &v1beta1.VMCluster{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmclustersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMCluster), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmnodescrape.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmnodescrape.go index 5cf88c4d..7186f6af 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmnodescrape.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmnodescrape.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmnodescrapesKind = v1beta1.SchemeGroupVersion.WithKind("VMNodeScrape") // Get takes name of the vMNodeScrape, and returns the corresponding vMNodeScrape object, and an error if there is any. func (c *FakeVMNodeScrapes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMNodeScrape, err error) { + emptyResult := &v1beta1.VMNodeScrape{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmnodescrapesResource, c.ns, name), &v1beta1.VMNodeScrape{}) + Invokes(testing.NewGetActionWithOptions(vmnodescrapesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMNodeScrape), err } // List takes label and field selectors, and returns the list of VMNodeScrapes that match those selectors. func (c *FakeVMNodeScrapes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMNodeScrapeList, err error) { + emptyResult := &v1beta1.VMNodeScrapeList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmnodescrapesResource, vmnodescrapesKind, c.ns, opts), &v1beta1.VMNodeScrapeList{}) + Invokes(testing.NewListActionWithOptions(vmnodescrapesResource, vmnodescrapesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMNodeScrapes) List(ctx context.Context, opts v1.ListOptions) (resu // Watch returns a watch.Interface that watches the requested vMNodeScrapes. func (c *FakeVMNodeScrapes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmnodescrapesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmnodescrapesResource, c.ns, opts)) } // Create takes the representation of a vMNodeScrape and creates it. Returns the server's representation of the vMNodeScrape, and an error, if there is any. func (c *FakeVMNodeScrapes) Create(ctx context.Context, vMNodeScrape *v1beta1.VMNodeScrape, opts v1.CreateOptions) (result *v1beta1.VMNodeScrape, err error) { + emptyResult := &v1beta1.VMNodeScrape{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmnodescrapesResource, c.ns, vMNodeScrape), &v1beta1.VMNodeScrape{}) + Invokes(testing.NewCreateActionWithOptions(vmnodescrapesResource, c.ns, vMNodeScrape, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMNodeScrape), err } // Update takes the representation of a vMNodeScrape and updates it. Returns the server's representation of the vMNodeScrape, and an error, if there is any. func (c *FakeVMNodeScrapes) Update(ctx context.Context, vMNodeScrape *v1beta1.VMNodeScrape, opts v1.UpdateOptions) (result *v1beta1.VMNodeScrape, err error) { + emptyResult := &v1beta1.VMNodeScrape{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmnodescrapesResource, c.ns, vMNodeScrape), &v1beta1.VMNodeScrape{}) + Invokes(testing.NewUpdateActionWithOptions(vmnodescrapesResource, c.ns, vMNodeScrape, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMNodeScrape), 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 *FakeVMNodeScrapes) UpdateStatus(ctx context.Context, vMNodeScrape *v1beta1.VMNodeScrape, opts v1.UpdateOptions) (*v1beta1.VMNodeScrape, error) { +func (c *FakeVMNodeScrapes) UpdateStatus(ctx context.Context, vMNodeScrape *v1beta1.VMNodeScrape, opts v1.UpdateOptions) (result *v1beta1.VMNodeScrape, err error) { + emptyResult := &v1beta1.VMNodeScrape{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmnodescrapesResource, "status", c.ns, vMNodeScrape), &v1beta1.VMNodeScrape{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmnodescrapesResource, "status", c.ns, vMNodeScrape, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMNodeScrape), err } @@ -122,7 +127,7 @@ func (c *FakeVMNodeScrapes) Delete(ctx context.Context, name string, opts v1.Del // DeleteCollection deletes a collection of objects. func (c *FakeVMNodeScrapes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmnodescrapesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmnodescrapesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMNodeScrapeList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMNodeScrapes) DeleteCollection(ctx context.Context, opts v1.Delete // Patch applies the patch and returns the patched vMNodeScrape. func (c *FakeVMNodeScrapes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMNodeScrape, err error) { + emptyResult := &v1beta1.VMNodeScrape{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmnodescrapesResource, c.ns, name, pt, data, subresources...), &v1beta1.VMNodeScrape{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmnodescrapesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMNodeScrape), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmpodscrape.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmpodscrape.go index 27f8b150..6d342cd4 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmpodscrape.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmpodscrape.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmpodscrapesKind = v1beta1.SchemeGroupVersion.WithKind("VMPodScrape") // Get takes name of the vMPodScrape, and returns the corresponding vMPodScrape object, and an error if there is any. func (c *FakeVMPodScrapes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMPodScrape, err error) { + emptyResult := &v1beta1.VMPodScrape{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmpodscrapesResource, c.ns, name), &v1beta1.VMPodScrape{}) + Invokes(testing.NewGetActionWithOptions(vmpodscrapesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMPodScrape), err } // List takes label and field selectors, and returns the list of VMPodScrapes that match those selectors. func (c *FakeVMPodScrapes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMPodScrapeList, err error) { + emptyResult := &v1beta1.VMPodScrapeList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmpodscrapesResource, vmpodscrapesKind, c.ns, opts), &v1beta1.VMPodScrapeList{}) + Invokes(testing.NewListActionWithOptions(vmpodscrapesResource, vmpodscrapesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMPodScrapes) List(ctx context.Context, opts v1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested vMPodScrapes. func (c *FakeVMPodScrapes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmpodscrapesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmpodscrapesResource, c.ns, opts)) } // Create takes the representation of a vMPodScrape and creates it. Returns the server's representation of the vMPodScrape, and an error, if there is any. func (c *FakeVMPodScrapes) Create(ctx context.Context, vMPodScrape *v1beta1.VMPodScrape, opts v1.CreateOptions) (result *v1beta1.VMPodScrape, err error) { + emptyResult := &v1beta1.VMPodScrape{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmpodscrapesResource, c.ns, vMPodScrape), &v1beta1.VMPodScrape{}) + Invokes(testing.NewCreateActionWithOptions(vmpodscrapesResource, c.ns, vMPodScrape, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMPodScrape), err } // Update takes the representation of a vMPodScrape and updates it. Returns the server's representation of the vMPodScrape, and an error, if there is any. func (c *FakeVMPodScrapes) Update(ctx context.Context, vMPodScrape *v1beta1.VMPodScrape, opts v1.UpdateOptions) (result *v1beta1.VMPodScrape, err error) { + emptyResult := &v1beta1.VMPodScrape{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmpodscrapesResource, c.ns, vMPodScrape), &v1beta1.VMPodScrape{}) + Invokes(testing.NewUpdateActionWithOptions(vmpodscrapesResource, c.ns, vMPodScrape, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMPodScrape), 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 *FakeVMPodScrapes) UpdateStatus(ctx context.Context, vMPodScrape *v1beta1.VMPodScrape, opts v1.UpdateOptions) (*v1beta1.VMPodScrape, error) { +func (c *FakeVMPodScrapes) UpdateStatus(ctx context.Context, vMPodScrape *v1beta1.VMPodScrape, opts v1.UpdateOptions) (result *v1beta1.VMPodScrape, err error) { + emptyResult := &v1beta1.VMPodScrape{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmpodscrapesResource, "status", c.ns, vMPodScrape), &v1beta1.VMPodScrape{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmpodscrapesResource, "status", c.ns, vMPodScrape, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMPodScrape), err } @@ -122,7 +127,7 @@ func (c *FakeVMPodScrapes) Delete(ctx context.Context, name string, opts v1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeVMPodScrapes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmpodscrapesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmpodscrapesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMPodScrapeList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMPodScrapes) DeleteCollection(ctx context.Context, opts v1.DeleteO // Patch applies the patch and returns the patched vMPodScrape. func (c *FakeVMPodScrapes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMPodScrape, err error) { + emptyResult := &v1beta1.VMPodScrape{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmpodscrapesResource, c.ns, name, pt, data, subresources...), &v1beta1.VMPodScrape{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmpodscrapesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMPodScrape), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmprobe.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmprobe.go index 858113c0..352ef0cc 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmprobe.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmprobe.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmprobesKind = v1beta1.SchemeGroupVersion.WithKind("VMProbe") // Get takes name of the vMProbe, and returns the corresponding vMProbe object, and an error if there is any. func (c *FakeVMProbes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMProbe, err error) { + emptyResult := &v1beta1.VMProbe{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmprobesResource, c.ns, name), &v1beta1.VMProbe{}) + Invokes(testing.NewGetActionWithOptions(vmprobesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMProbe), err } // List takes label and field selectors, and returns the list of VMProbes that match those selectors. func (c *FakeVMProbes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMProbeList, err error) { + emptyResult := &v1beta1.VMProbeList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmprobesResource, vmprobesKind, c.ns, opts), &v1beta1.VMProbeList{}) + Invokes(testing.NewListActionWithOptions(vmprobesResource, vmprobesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMProbes) List(ctx context.Context, opts v1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested vMProbes. func (c *FakeVMProbes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmprobesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmprobesResource, c.ns, opts)) } // Create takes the representation of a vMProbe and creates it. Returns the server's representation of the vMProbe, and an error, if there is any. func (c *FakeVMProbes) Create(ctx context.Context, vMProbe *v1beta1.VMProbe, opts v1.CreateOptions) (result *v1beta1.VMProbe, err error) { + emptyResult := &v1beta1.VMProbe{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmprobesResource, c.ns, vMProbe), &v1beta1.VMProbe{}) + Invokes(testing.NewCreateActionWithOptions(vmprobesResource, c.ns, vMProbe, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMProbe), err } // Update takes the representation of a vMProbe and updates it. Returns the server's representation of the vMProbe, and an error, if there is any. func (c *FakeVMProbes) Update(ctx context.Context, vMProbe *v1beta1.VMProbe, opts v1.UpdateOptions) (result *v1beta1.VMProbe, err error) { + emptyResult := &v1beta1.VMProbe{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmprobesResource, c.ns, vMProbe), &v1beta1.VMProbe{}) + Invokes(testing.NewUpdateActionWithOptions(vmprobesResource, c.ns, vMProbe, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMProbe), 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 *FakeVMProbes) UpdateStatus(ctx context.Context, vMProbe *v1beta1.VMProbe, opts v1.UpdateOptions) (*v1beta1.VMProbe, error) { +func (c *FakeVMProbes) UpdateStatus(ctx context.Context, vMProbe *v1beta1.VMProbe, opts v1.UpdateOptions) (result *v1beta1.VMProbe, err error) { + emptyResult := &v1beta1.VMProbe{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmprobesResource, "status", c.ns, vMProbe), &v1beta1.VMProbe{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmprobesResource, "status", c.ns, vMProbe, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMProbe), err } @@ -122,7 +127,7 @@ func (c *FakeVMProbes) Delete(ctx context.Context, name string, opts v1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakeVMProbes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmprobesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmprobesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMProbeList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMProbes) DeleteCollection(ctx context.Context, opts v1.DeleteOptio // Patch applies the patch and returns the patched vMProbe. func (c *FakeVMProbes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMProbe, err error) { + emptyResult := &v1beta1.VMProbe{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmprobesResource, c.ns, name, pt, data, subresources...), &v1beta1.VMProbe{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmprobesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMProbe), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmrule.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmrule.go index a2ba51fe..0b54805c 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmrule.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmrule.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmrulesKind = v1beta1.SchemeGroupVersion.WithKind("VMRule") // Get takes name of the vMRule, and returns the corresponding vMRule object, and an error if there is any. func (c *FakeVMRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMRule, err error) { + emptyResult := &v1beta1.VMRule{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmrulesResource, c.ns, name), &v1beta1.VMRule{}) + Invokes(testing.NewGetActionWithOptions(vmrulesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMRule), err } // List takes label and field selectors, and returns the list of VMRules that match those selectors. func (c *FakeVMRules) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMRuleList, err error) { + emptyResult := &v1beta1.VMRuleList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmrulesResource, vmrulesKind, c.ns, opts), &v1beta1.VMRuleList{}) + Invokes(testing.NewListActionWithOptions(vmrulesResource, vmrulesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMRules) List(ctx context.Context, opts v1.ListOptions) (result *v1 // Watch returns a watch.Interface that watches the requested vMRules. func (c *FakeVMRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmrulesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmrulesResource, c.ns, opts)) } // Create takes the representation of a vMRule and creates it. Returns the server's representation of the vMRule, and an error, if there is any. func (c *FakeVMRules) Create(ctx context.Context, vMRule *v1beta1.VMRule, opts v1.CreateOptions) (result *v1beta1.VMRule, err error) { + emptyResult := &v1beta1.VMRule{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmrulesResource, c.ns, vMRule), &v1beta1.VMRule{}) + Invokes(testing.NewCreateActionWithOptions(vmrulesResource, c.ns, vMRule, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMRule), err } // Update takes the representation of a vMRule and updates it. Returns the server's representation of the vMRule, and an error, if there is any. func (c *FakeVMRules) Update(ctx context.Context, vMRule *v1beta1.VMRule, opts v1.UpdateOptions) (result *v1beta1.VMRule, err error) { + emptyResult := &v1beta1.VMRule{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmrulesResource, c.ns, vMRule), &v1beta1.VMRule{}) + Invokes(testing.NewUpdateActionWithOptions(vmrulesResource, c.ns, vMRule, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMRule), 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 *FakeVMRules) UpdateStatus(ctx context.Context, vMRule *v1beta1.VMRule, opts v1.UpdateOptions) (*v1beta1.VMRule, error) { +func (c *FakeVMRules) UpdateStatus(ctx context.Context, vMRule *v1beta1.VMRule, opts v1.UpdateOptions) (result *v1beta1.VMRule, err error) { + emptyResult := &v1beta1.VMRule{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmrulesResource, "status", c.ns, vMRule), &v1beta1.VMRule{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmrulesResource, "status", c.ns, vMRule, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMRule), err } @@ -122,7 +127,7 @@ func (c *FakeVMRules) Delete(ctx context.Context, name string, opts v1.DeleteOpt // DeleteCollection deletes a collection of objects. func (c *FakeVMRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmrulesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmrulesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMRuleList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMRules) DeleteCollection(ctx context.Context, opts v1.DeleteOption // Patch applies the patch and returns the patched vMRule. func (c *FakeVMRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMRule, err error) { + emptyResult := &v1beta1.VMRule{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmrulesResource, c.ns, name, pt, data, subresources...), &v1beta1.VMRule{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmrulesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMRule), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmscrapeconfig.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmscrapeconfig.go index 677f6cda..2e5c310d 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmscrapeconfig.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmscrapeconfig.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmscrapeconfigsKind = v1beta1.SchemeGroupVersion.WithKind("VMScrapeConfig") // Get takes name of the vMScrapeConfig, and returns the corresponding vMScrapeConfig object, and an error if there is any. func (c *FakeVMScrapeConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMScrapeConfig, err error) { + emptyResult := &v1beta1.VMScrapeConfig{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmscrapeconfigsResource, c.ns, name), &v1beta1.VMScrapeConfig{}) + Invokes(testing.NewGetActionWithOptions(vmscrapeconfigsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMScrapeConfig), err } // List takes label and field selectors, and returns the list of VMScrapeConfigs that match those selectors. func (c *FakeVMScrapeConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMScrapeConfigList, err error) { + emptyResult := &v1beta1.VMScrapeConfigList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmscrapeconfigsResource, vmscrapeconfigsKind, c.ns, opts), &v1beta1.VMScrapeConfigList{}) + Invokes(testing.NewListActionWithOptions(vmscrapeconfigsResource, vmscrapeconfigsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMScrapeConfigs) List(ctx context.Context, opts v1.ListOptions) (re // Watch returns a watch.Interface that watches the requested vMScrapeConfigs. func (c *FakeVMScrapeConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmscrapeconfigsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmscrapeconfigsResource, c.ns, opts)) } // Create takes the representation of a vMScrapeConfig and creates it. Returns the server's representation of the vMScrapeConfig, and an error, if there is any. func (c *FakeVMScrapeConfigs) Create(ctx context.Context, vMScrapeConfig *v1beta1.VMScrapeConfig, opts v1.CreateOptions) (result *v1beta1.VMScrapeConfig, err error) { + emptyResult := &v1beta1.VMScrapeConfig{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmscrapeconfigsResource, c.ns, vMScrapeConfig), &v1beta1.VMScrapeConfig{}) + Invokes(testing.NewCreateActionWithOptions(vmscrapeconfigsResource, c.ns, vMScrapeConfig, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMScrapeConfig), err } // Update takes the representation of a vMScrapeConfig and updates it. Returns the server's representation of the vMScrapeConfig, and an error, if there is any. func (c *FakeVMScrapeConfigs) Update(ctx context.Context, vMScrapeConfig *v1beta1.VMScrapeConfig, opts v1.UpdateOptions) (result *v1beta1.VMScrapeConfig, err error) { + emptyResult := &v1beta1.VMScrapeConfig{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmscrapeconfigsResource, c.ns, vMScrapeConfig), &v1beta1.VMScrapeConfig{}) + Invokes(testing.NewUpdateActionWithOptions(vmscrapeconfigsResource, c.ns, vMScrapeConfig, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMScrapeConfig), 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 *FakeVMScrapeConfigs) UpdateStatus(ctx context.Context, vMScrapeConfig *v1beta1.VMScrapeConfig, opts v1.UpdateOptions) (*v1beta1.VMScrapeConfig, error) { +func (c *FakeVMScrapeConfigs) UpdateStatus(ctx context.Context, vMScrapeConfig *v1beta1.VMScrapeConfig, opts v1.UpdateOptions) (result *v1beta1.VMScrapeConfig, err error) { + emptyResult := &v1beta1.VMScrapeConfig{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmscrapeconfigsResource, "status", c.ns, vMScrapeConfig), &v1beta1.VMScrapeConfig{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmscrapeconfigsResource, "status", c.ns, vMScrapeConfig, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMScrapeConfig), err } @@ -122,7 +127,7 @@ func (c *FakeVMScrapeConfigs) Delete(ctx context.Context, name string, opts v1.D // DeleteCollection deletes a collection of objects. func (c *FakeVMScrapeConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmscrapeconfigsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmscrapeconfigsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMScrapeConfigList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMScrapeConfigs) DeleteCollection(ctx context.Context, opts v1.Dele // Patch applies the patch and returns the patched vMScrapeConfig. func (c *FakeVMScrapeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMScrapeConfig, err error) { + emptyResult := &v1beta1.VMScrapeConfig{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmscrapeconfigsResource, c.ns, name, pt, data, subresources...), &v1beta1.VMScrapeConfig{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmscrapeconfigsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMScrapeConfig), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmservicescrape.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmservicescrape.go index bd6a1375..6ed23e9a 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmservicescrape.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmservicescrape.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmservicescrapesKind = v1beta1.SchemeGroupVersion.WithKind("VMServiceScrape" // Get takes name of the vMServiceScrape, and returns the corresponding vMServiceScrape object, and an error if there is any. func (c *FakeVMServiceScrapes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMServiceScrape, err error) { + emptyResult := &v1beta1.VMServiceScrape{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmservicescrapesResource, c.ns, name), &v1beta1.VMServiceScrape{}) + Invokes(testing.NewGetActionWithOptions(vmservicescrapesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMServiceScrape), err } // List takes label and field selectors, and returns the list of VMServiceScrapes that match those selectors. func (c *FakeVMServiceScrapes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMServiceScrapeList, err error) { + emptyResult := &v1beta1.VMServiceScrapeList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmservicescrapesResource, vmservicescrapesKind, c.ns, opts), &v1beta1.VMServiceScrapeList{}) + Invokes(testing.NewListActionWithOptions(vmservicescrapesResource, vmservicescrapesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMServiceScrapes) List(ctx context.Context, opts v1.ListOptions) (r // Watch returns a watch.Interface that watches the requested vMServiceScrapes. func (c *FakeVMServiceScrapes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmservicescrapesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmservicescrapesResource, c.ns, opts)) } // Create takes the representation of a vMServiceScrape and creates it. Returns the server's representation of the vMServiceScrape, and an error, if there is any. func (c *FakeVMServiceScrapes) Create(ctx context.Context, vMServiceScrape *v1beta1.VMServiceScrape, opts v1.CreateOptions) (result *v1beta1.VMServiceScrape, err error) { + emptyResult := &v1beta1.VMServiceScrape{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmservicescrapesResource, c.ns, vMServiceScrape), &v1beta1.VMServiceScrape{}) + Invokes(testing.NewCreateActionWithOptions(vmservicescrapesResource, c.ns, vMServiceScrape, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMServiceScrape), err } // Update takes the representation of a vMServiceScrape and updates it. Returns the server's representation of the vMServiceScrape, and an error, if there is any. func (c *FakeVMServiceScrapes) Update(ctx context.Context, vMServiceScrape *v1beta1.VMServiceScrape, opts v1.UpdateOptions) (result *v1beta1.VMServiceScrape, err error) { + emptyResult := &v1beta1.VMServiceScrape{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmservicescrapesResource, c.ns, vMServiceScrape), &v1beta1.VMServiceScrape{}) + Invokes(testing.NewUpdateActionWithOptions(vmservicescrapesResource, c.ns, vMServiceScrape, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMServiceScrape), 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 *FakeVMServiceScrapes) UpdateStatus(ctx context.Context, vMServiceScrape *v1beta1.VMServiceScrape, opts v1.UpdateOptions) (*v1beta1.VMServiceScrape, error) { +func (c *FakeVMServiceScrapes) UpdateStatus(ctx context.Context, vMServiceScrape *v1beta1.VMServiceScrape, opts v1.UpdateOptions) (result *v1beta1.VMServiceScrape, err error) { + emptyResult := &v1beta1.VMServiceScrape{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmservicescrapesResource, "status", c.ns, vMServiceScrape), &v1beta1.VMServiceScrape{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmservicescrapesResource, "status", c.ns, vMServiceScrape, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMServiceScrape), err } @@ -122,7 +127,7 @@ func (c *FakeVMServiceScrapes) Delete(ctx context.Context, name string, opts v1. // DeleteCollection deletes a collection of objects. func (c *FakeVMServiceScrapes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmservicescrapesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmservicescrapesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMServiceScrapeList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMServiceScrapes) DeleteCollection(ctx context.Context, opts v1.Del // Patch applies the patch and returns the patched vMServiceScrape. func (c *FakeVMServiceScrapes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMServiceScrape, err error) { + emptyResult := &v1beta1.VMServiceScrape{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmservicescrapesResource, c.ns, name, pt, data, subresources...), &v1beta1.VMServiceScrape{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmservicescrapesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMServiceScrape), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmsingle.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmsingle.go index 9ac4c93e..1c6c676c 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmsingle.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmsingle.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmsinglesKind = v1beta1.SchemeGroupVersion.WithKind("VMSingle") // Get takes name of the vMSingle, and returns the corresponding vMSingle object, and an error if there is any. func (c *FakeVMSingles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMSingle, err error) { + emptyResult := &v1beta1.VMSingle{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmsinglesResource, c.ns, name), &v1beta1.VMSingle{}) + Invokes(testing.NewGetActionWithOptions(vmsinglesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMSingle), err } // List takes label and field selectors, and returns the list of VMSingles that match those selectors. func (c *FakeVMSingles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMSingleList, err error) { + emptyResult := &v1beta1.VMSingleList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmsinglesResource, vmsinglesKind, c.ns, opts), &v1beta1.VMSingleList{}) + Invokes(testing.NewListActionWithOptions(vmsinglesResource, vmsinglesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMSingles) List(ctx context.Context, opts v1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested vMSingles. func (c *FakeVMSingles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmsinglesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmsinglesResource, c.ns, opts)) } // Create takes the representation of a vMSingle and creates it. Returns the server's representation of the vMSingle, and an error, if there is any. func (c *FakeVMSingles) Create(ctx context.Context, vMSingle *v1beta1.VMSingle, opts v1.CreateOptions) (result *v1beta1.VMSingle, err error) { + emptyResult := &v1beta1.VMSingle{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmsinglesResource, c.ns, vMSingle), &v1beta1.VMSingle{}) + Invokes(testing.NewCreateActionWithOptions(vmsinglesResource, c.ns, vMSingle, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMSingle), err } // Update takes the representation of a vMSingle and updates it. Returns the server's representation of the vMSingle, and an error, if there is any. func (c *FakeVMSingles) Update(ctx context.Context, vMSingle *v1beta1.VMSingle, opts v1.UpdateOptions) (result *v1beta1.VMSingle, err error) { + emptyResult := &v1beta1.VMSingle{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmsinglesResource, c.ns, vMSingle), &v1beta1.VMSingle{}) + Invokes(testing.NewUpdateActionWithOptions(vmsinglesResource, c.ns, vMSingle, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMSingle), 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 *FakeVMSingles) UpdateStatus(ctx context.Context, vMSingle *v1beta1.VMSingle, opts v1.UpdateOptions) (*v1beta1.VMSingle, error) { +func (c *FakeVMSingles) UpdateStatus(ctx context.Context, vMSingle *v1beta1.VMSingle, opts v1.UpdateOptions) (result *v1beta1.VMSingle, err error) { + emptyResult := &v1beta1.VMSingle{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmsinglesResource, "status", c.ns, vMSingle), &v1beta1.VMSingle{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmsinglesResource, "status", c.ns, vMSingle, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMSingle), err } @@ -122,7 +127,7 @@ func (c *FakeVMSingles) Delete(ctx context.Context, name string, opts v1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeVMSingles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmsinglesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmsinglesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMSingleList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMSingles) DeleteCollection(ctx context.Context, opts v1.DeleteOpti // Patch applies the patch and returns the patched vMSingle. func (c *FakeVMSingles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMSingle, err error) { + emptyResult := &v1beta1.VMSingle{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmsinglesResource, c.ns, name, pt, data, subresources...), &v1beta1.VMSingle{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmsinglesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMSingle), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmstaticscrape.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmstaticscrape.go index 4764546e..402d4e89 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmstaticscrape.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmstaticscrape.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmstaticscrapesKind = v1beta1.SchemeGroupVersion.WithKind("VMStaticScrape") // Get takes name of the vMStaticScrape, and returns the corresponding vMStaticScrape object, and an error if there is any. func (c *FakeVMStaticScrapes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMStaticScrape, err error) { + emptyResult := &v1beta1.VMStaticScrape{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmstaticscrapesResource, c.ns, name), &v1beta1.VMStaticScrape{}) + Invokes(testing.NewGetActionWithOptions(vmstaticscrapesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMStaticScrape), err } // List takes label and field selectors, and returns the list of VMStaticScrapes that match those selectors. func (c *FakeVMStaticScrapes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMStaticScrapeList, err error) { + emptyResult := &v1beta1.VMStaticScrapeList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmstaticscrapesResource, vmstaticscrapesKind, c.ns, opts), &v1beta1.VMStaticScrapeList{}) + Invokes(testing.NewListActionWithOptions(vmstaticscrapesResource, vmstaticscrapesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMStaticScrapes) List(ctx context.Context, opts v1.ListOptions) (re // Watch returns a watch.Interface that watches the requested vMStaticScrapes. func (c *FakeVMStaticScrapes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmstaticscrapesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmstaticscrapesResource, c.ns, opts)) } // Create takes the representation of a vMStaticScrape and creates it. Returns the server's representation of the vMStaticScrape, and an error, if there is any. func (c *FakeVMStaticScrapes) Create(ctx context.Context, vMStaticScrape *v1beta1.VMStaticScrape, opts v1.CreateOptions) (result *v1beta1.VMStaticScrape, err error) { + emptyResult := &v1beta1.VMStaticScrape{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmstaticscrapesResource, c.ns, vMStaticScrape), &v1beta1.VMStaticScrape{}) + Invokes(testing.NewCreateActionWithOptions(vmstaticscrapesResource, c.ns, vMStaticScrape, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMStaticScrape), err } // Update takes the representation of a vMStaticScrape and updates it. Returns the server's representation of the vMStaticScrape, and an error, if there is any. func (c *FakeVMStaticScrapes) Update(ctx context.Context, vMStaticScrape *v1beta1.VMStaticScrape, opts v1.UpdateOptions) (result *v1beta1.VMStaticScrape, err error) { + emptyResult := &v1beta1.VMStaticScrape{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmstaticscrapesResource, c.ns, vMStaticScrape), &v1beta1.VMStaticScrape{}) + Invokes(testing.NewUpdateActionWithOptions(vmstaticscrapesResource, c.ns, vMStaticScrape, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMStaticScrape), 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 *FakeVMStaticScrapes) UpdateStatus(ctx context.Context, vMStaticScrape *v1beta1.VMStaticScrape, opts v1.UpdateOptions) (*v1beta1.VMStaticScrape, error) { +func (c *FakeVMStaticScrapes) UpdateStatus(ctx context.Context, vMStaticScrape *v1beta1.VMStaticScrape, opts v1.UpdateOptions) (result *v1beta1.VMStaticScrape, err error) { + emptyResult := &v1beta1.VMStaticScrape{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmstaticscrapesResource, "status", c.ns, vMStaticScrape), &v1beta1.VMStaticScrape{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmstaticscrapesResource, "status", c.ns, vMStaticScrape, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMStaticScrape), err } @@ -122,7 +127,7 @@ func (c *FakeVMStaticScrapes) Delete(ctx context.Context, name string, opts v1.D // DeleteCollection deletes a collection of objects. func (c *FakeVMStaticScrapes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmstaticscrapesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmstaticscrapesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMStaticScrapeList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMStaticScrapes) DeleteCollection(ctx context.Context, opts v1.Dele // Patch applies the patch and returns the patched vMStaticScrape. func (c *FakeVMStaticScrapes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMStaticScrape, err error) { + emptyResult := &v1beta1.VMStaticScrape{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmstaticscrapesResource, c.ns, name, pt, data, subresources...), &v1beta1.VMStaticScrape{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmstaticscrapesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMStaticScrape), err } diff --git a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmuser.go b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmuser.go index a8664b09..3791e5d1 100644 --- a/api/client/versioned/typed/operator/v1beta1/fake/fake_vmuser.go +++ b/api/client/versioned/typed/operator/v1beta1/fake/fake_vmuser.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package fake @@ -40,22 +40,24 @@ var vmusersKind = v1beta1.SchemeGroupVersion.WithKind("VMUser") // Get takes name of the vMUser, and returns the corresponding vMUser object, and an error if there is any. func (c *FakeVMUsers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMUser, err error) { + emptyResult := &v1beta1.VMUser{} obj, err := c.Fake. - Invokes(testing.NewGetAction(vmusersResource, c.ns, name), &v1beta1.VMUser{}) + Invokes(testing.NewGetActionWithOptions(vmusersResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMUser), err } // List takes label and field selectors, and returns the list of VMUsers that match those selectors. func (c *FakeVMUsers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMUserList, err error) { + emptyResult := &v1beta1.VMUserList{} obj, err := c.Fake. - Invokes(testing.NewListAction(vmusersResource, vmusersKind, c.ns, opts), &v1beta1.VMUserList{}) + Invokes(testing.NewListActionWithOptions(vmusersResource, vmusersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -74,40 +76,43 @@ func (c *FakeVMUsers) List(ctx context.Context, opts v1.ListOptions) (result *v1 // Watch returns a watch.Interface that watches the requested vMUsers. func (c *FakeVMUsers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(vmusersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(vmusersResource, c.ns, opts)) } // Create takes the representation of a vMUser and creates it. Returns the server's representation of the vMUser, and an error, if there is any. func (c *FakeVMUsers) Create(ctx context.Context, vMUser *v1beta1.VMUser, opts v1.CreateOptions) (result *v1beta1.VMUser, err error) { + emptyResult := &v1beta1.VMUser{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(vmusersResource, c.ns, vMUser), &v1beta1.VMUser{}) + Invokes(testing.NewCreateActionWithOptions(vmusersResource, c.ns, vMUser, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMUser), err } // Update takes the representation of a vMUser and updates it. Returns the server's representation of the vMUser, and an error, if there is any. func (c *FakeVMUsers) Update(ctx context.Context, vMUser *v1beta1.VMUser, opts v1.UpdateOptions) (result *v1beta1.VMUser, err error) { + emptyResult := &v1beta1.VMUser{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(vmusersResource, c.ns, vMUser), &v1beta1.VMUser{}) + Invokes(testing.NewUpdateActionWithOptions(vmusersResource, c.ns, vMUser, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMUser), 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 *FakeVMUsers) UpdateStatus(ctx context.Context, vMUser *v1beta1.VMUser, opts v1.UpdateOptions) (*v1beta1.VMUser, error) { +func (c *FakeVMUsers) UpdateStatus(ctx context.Context, vMUser *v1beta1.VMUser, opts v1.UpdateOptions) (result *v1beta1.VMUser, err error) { + emptyResult := &v1beta1.VMUser{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(vmusersResource, "status", c.ns, vMUser), &v1beta1.VMUser{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(vmusersResource, "status", c.ns, vMUser, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMUser), err } @@ -122,7 +127,7 @@ func (c *FakeVMUsers) Delete(ctx context.Context, name string, opts v1.DeleteOpt // DeleteCollection deletes a collection of objects. func (c *FakeVMUsers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(vmusersResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(vmusersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VMUserList{}) return err @@ -130,11 +135,12 @@ func (c *FakeVMUsers) DeleteCollection(ctx context.Context, opts v1.DeleteOption // Patch applies the patch and returns the patched vMUser. func (c *FakeVMUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMUser, err error) { + emptyResult := &v1beta1.VMUser{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(vmusersResource, c.ns, name, pt, data, subresources...), &v1beta1.VMUser{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(vmusersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VMUser), err } diff --git a/api/client/versioned/typed/operator/v1beta1/generated_expansion.go b/api/client/versioned/typed/operator/v1beta1/generated_expansion.go index 5063bec0..48b66486 100644 --- a/api/client/versioned/typed/operator/v1beta1/generated_expansion.go +++ b/api/client/versioned/typed/operator/v1beta1/generated_expansion.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/versioned/typed/operator/v1beta1/operator_client.go b/api/client/versioned/typed/operator/v1beta1/operator_client.go index 93e9c67f..20a9d92d 100644 --- a/api/client/versioned/typed/operator/v1beta1/operator_client.go +++ b/api/client/versioned/typed/operator/v1beta1/operator_client.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 diff --git a/api/client/versioned/typed/operator/v1beta1/vlogs.go b/api/client/versioned/typed/operator/v1beta1/vlogs.go index 10c22db0..93742cf5 100644 --- a/api/client/versioned/typed/operator/v1beta1/vlogs.go +++ b/api/client/versioned/typed/operator/v1beta1/vlogs.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VLogsGetter has a method to return a VLogsInterface. @@ -39,6 +38,7 @@ type VLogsGetter interface { type VLogsInterface interface { Create(ctx context.Context, vLogs *v1beta1.VLogs, opts v1.CreateOptions) (*v1beta1.VLogs, error) Update(ctx context.Context, vLogs *v1beta1.VLogs, opts v1.UpdateOptions) (*v1beta1.VLogs, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vLogs *v1beta1.VLogs, opts v1.UpdateOptions) (*v1beta1.VLogs, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VLogsInterface interface { // vLogs implements VLogsInterface type vLogs struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VLogs, *v1beta1.VLogsList] } // newVLogs returns a VLogs func newVLogs(c *OperatorV1beta1Client, namespace string) *vLogs { return &vLogs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VLogs, *v1beta1.VLogsList]( + "vlogs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VLogs { return &v1beta1.VLogs{} }, + func() *v1beta1.VLogsList { return &v1beta1.VLogsList{} }), } } - -// Get takes name of the vLogs, and returns the corresponding vLogs object, and an error if there is any. -func (c *vLogs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VLogs, err error) { - result = &v1beta1.VLogs{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vlogs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VLogs that match those selectors. -func (c *vLogs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VLogsList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VLogsList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vlogs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vLogs. -func (c *vLogs) 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("vlogs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vLogs and creates it. Returns the server's representation of the vLogs, and an error, if there is any. -func (c *vLogs) Create(ctx context.Context, vLogs *v1beta1.VLogs, opts v1.CreateOptions) (result *v1beta1.VLogs, err error) { - result = &v1beta1.VLogs{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vlogs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vLogs). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vLogs and updates it. Returns the server's representation of the vLogs, and an error, if there is any. -func (c *vLogs) Update(ctx context.Context, vLogs *v1beta1.VLogs, opts v1.UpdateOptions) (result *v1beta1.VLogs, err error) { - result = &v1beta1.VLogs{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vlogs"). - Name(vLogs.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vLogs). - 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 *vLogs) UpdateStatus(ctx context.Context, vLogs *v1beta1.VLogs, opts v1.UpdateOptions) (result *v1beta1.VLogs, err error) { - result = &v1beta1.VLogs{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vlogs"). - Name(vLogs.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vLogs). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vLogs and deletes it. Returns an error if one occurs. -func (c *vLogs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vlogs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vLogs) 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("vlogs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vLogs. -func (c *vLogs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VLogs, err error) { - result = &v1beta1.VLogs{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vlogs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmagent.go b/api/client/versioned/typed/operator/v1beta1/vmagent.go index 9b0b57c0..86e5a22d 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmagent.go +++ b/api/client/versioned/typed/operator/v1beta1/vmagent.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMAgentsGetter has a method to return a VMAgentInterface. @@ -39,6 +38,7 @@ type VMAgentsGetter interface { type VMAgentInterface interface { Create(ctx context.Context, vMAgent *v1beta1.VMAgent, opts v1.CreateOptions) (*v1beta1.VMAgent, error) Update(ctx context.Context, vMAgent *v1beta1.VMAgent, opts v1.UpdateOptions) (*v1beta1.VMAgent, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMAgent *v1beta1.VMAgent, opts v1.UpdateOptions) (*v1beta1.VMAgent, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMAgentInterface interface { // vMAgents implements VMAgentInterface type vMAgents struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMAgent, *v1beta1.VMAgentList] } // newVMAgents returns a VMAgents func newVMAgents(c *OperatorV1beta1Client, namespace string) *vMAgents { return &vMAgents{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMAgent, *v1beta1.VMAgentList]( + "vmagents", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMAgent { return &v1beta1.VMAgent{} }, + func() *v1beta1.VMAgentList { return &v1beta1.VMAgentList{} }), } } - -// Get takes name of the vMAgent, and returns the corresponding vMAgent object, and an error if there is any. -func (c *vMAgents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMAgent, err error) { - result = &v1beta1.VMAgent{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmagents"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMAgents that match those selectors. -func (c *vMAgents) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMAgentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMAgentList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmagents"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMAgents. -func (c *vMAgents) 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("vmagents"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMAgent and creates it. Returns the server's representation of the vMAgent, and an error, if there is any. -func (c *vMAgents) Create(ctx context.Context, vMAgent *v1beta1.VMAgent, opts v1.CreateOptions) (result *v1beta1.VMAgent, err error) { - result = &v1beta1.VMAgent{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmagents"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAgent). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMAgent and updates it. Returns the server's representation of the vMAgent, and an error, if there is any. -func (c *vMAgents) Update(ctx context.Context, vMAgent *v1beta1.VMAgent, opts v1.UpdateOptions) (result *v1beta1.VMAgent, err error) { - result = &v1beta1.VMAgent{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmagents"). - Name(vMAgent.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAgent). - 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 *vMAgents) UpdateStatus(ctx context.Context, vMAgent *v1beta1.VMAgent, opts v1.UpdateOptions) (result *v1beta1.VMAgent, err error) { - result = &v1beta1.VMAgent{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmagents"). - Name(vMAgent.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAgent). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMAgent and deletes it. Returns an error if one occurs. -func (c *vMAgents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmagents"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMAgents) 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("vmagents"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMAgent. -func (c *vMAgents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMAgent, err error) { - result = &v1beta1.VMAgent{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmagents"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmalert.go b/api/client/versioned/typed/operator/v1beta1/vmalert.go index 0f9b8896..33e1a2f5 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmalert.go +++ b/api/client/versioned/typed/operator/v1beta1/vmalert.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMAlertsGetter has a method to return a VMAlertInterface. @@ -39,6 +38,7 @@ type VMAlertsGetter interface { type VMAlertInterface interface { Create(ctx context.Context, vMAlert *v1beta1.VMAlert, opts v1.CreateOptions) (*v1beta1.VMAlert, error) Update(ctx context.Context, vMAlert *v1beta1.VMAlert, opts v1.UpdateOptions) (*v1beta1.VMAlert, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMAlert *v1beta1.VMAlert, opts v1.UpdateOptions) (*v1beta1.VMAlert, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMAlertInterface interface { // vMAlerts implements VMAlertInterface type vMAlerts struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMAlert, *v1beta1.VMAlertList] } // newVMAlerts returns a VMAlerts func newVMAlerts(c *OperatorV1beta1Client, namespace string) *vMAlerts { return &vMAlerts{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMAlert, *v1beta1.VMAlertList]( + "vmalerts", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMAlert { return &v1beta1.VMAlert{} }, + func() *v1beta1.VMAlertList { return &v1beta1.VMAlertList{} }), } } - -// Get takes name of the vMAlert, and returns the corresponding vMAlert object, and an error if there is any. -func (c *vMAlerts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMAlert, err error) { - result = &v1beta1.VMAlert{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmalerts"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMAlerts that match those selectors. -func (c *vMAlerts) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMAlertList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMAlertList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmalerts"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMAlerts. -func (c *vMAlerts) 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("vmalerts"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMAlert and creates it. Returns the server's representation of the vMAlert, and an error, if there is any. -func (c *vMAlerts) Create(ctx context.Context, vMAlert *v1beta1.VMAlert, opts v1.CreateOptions) (result *v1beta1.VMAlert, err error) { - result = &v1beta1.VMAlert{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmalerts"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAlert). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMAlert and updates it. Returns the server's representation of the vMAlert, and an error, if there is any. -func (c *vMAlerts) Update(ctx context.Context, vMAlert *v1beta1.VMAlert, opts v1.UpdateOptions) (result *v1beta1.VMAlert, err error) { - result = &v1beta1.VMAlert{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmalerts"). - Name(vMAlert.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAlert). - 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 *vMAlerts) UpdateStatus(ctx context.Context, vMAlert *v1beta1.VMAlert, opts v1.UpdateOptions) (result *v1beta1.VMAlert, err error) { - result = &v1beta1.VMAlert{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmalerts"). - Name(vMAlert.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAlert). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMAlert and deletes it. Returns an error if one occurs. -func (c *vMAlerts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmalerts"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMAlerts) 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("vmalerts"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMAlert. -func (c *vMAlerts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMAlert, err error) { - result = &v1beta1.VMAlert{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmalerts"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmalertmanager.go b/api/client/versioned/typed/operator/v1beta1/vmalertmanager.go index 2d2ff7be..3148d709 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmalertmanager.go +++ b/api/client/versioned/typed/operator/v1beta1/vmalertmanager.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMAlertmanagersGetter has a method to return a VMAlertmanagerInterface. @@ -39,6 +38,7 @@ type VMAlertmanagersGetter interface { type VMAlertmanagerInterface interface { Create(ctx context.Context, vMAlertmanager *v1beta1.VMAlertmanager, opts v1.CreateOptions) (*v1beta1.VMAlertmanager, error) Update(ctx context.Context, vMAlertmanager *v1beta1.VMAlertmanager, opts v1.UpdateOptions) (*v1beta1.VMAlertmanager, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMAlertmanager *v1beta1.VMAlertmanager, opts v1.UpdateOptions) (*v1beta1.VMAlertmanager, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMAlertmanagerInterface interface { // vMAlertmanagers implements VMAlertmanagerInterface type vMAlertmanagers struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMAlertmanager, *v1beta1.VMAlertmanagerList] } // newVMAlertmanagers returns a VMAlertmanagers func newVMAlertmanagers(c *OperatorV1beta1Client, namespace string) *vMAlertmanagers { return &vMAlertmanagers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMAlertmanager, *v1beta1.VMAlertmanagerList]( + "vmalertmanagers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMAlertmanager { return &v1beta1.VMAlertmanager{} }, + func() *v1beta1.VMAlertmanagerList { return &v1beta1.VMAlertmanagerList{} }), } } - -// Get takes name of the vMAlertmanager, and returns the corresponding vMAlertmanager object, and an error if there is any. -func (c *vMAlertmanagers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMAlertmanager, err error) { - result = &v1beta1.VMAlertmanager{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmalertmanagers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMAlertmanagers that match those selectors. -func (c *vMAlertmanagers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMAlertmanagerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMAlertmanagerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmalertmanagers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMAlertmanagers. -func (c *vMAlertmanagers) 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("vmalertmanagers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMAlertmanager and creates it. Returns the server's representation of the vMAlertmanager, and an error, if there is any. -func (c *vMAlertmanagers) Create(ctx context.Context, vMAlertmanager *v1beta1.VMAlertmanager, opts v1.CreateOptions) (result *v1beta1.VMAlertmanager, err error) { - result = &v1beta1.VMAlertmanager{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmalertmanagers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAlertmanager). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMAlertmanager and updates it. Returns the server's representation of the vMAlertmanager, and an error, if there is any. -func (c *vMAlertmanagers) Update(ctx context.Context, vMAlertmanager *v1beta1.VMAlertmanager, opts v1.UpdateOptions) (result *v1beta1.VMAlertmanager, err error) { - result = &v1beta1.VMAlertmanager{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmalertmanagers"). - Name(vMAlertmanager.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAlertmanager). - 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 *vMAlertmanagers) UpdateStatus(ctx context.Context, vMAlertmanager *v1beta1.VMAlertmanager, opts v1.UpdateOptions) (result *v1beta1.VMAlertmanager, err error) { - result = &v1beta1.VMAlertmanager{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmalertmanagers"). - Name(vMAlertmanager.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAlertmanager). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMAlertmanager and deletes it. Returns an error if one occurs. -func (c *vMAlertmanagers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmalertmanagers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMAlertmanagers) 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("vmalertmanagers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMAlertmanager. -func (c *vMAlertmanagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMAlertmanager, err error) { - result = &v1beta1.VMAlertmanager{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmalertmanagers"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmalertmanagerconfig.go b/api/client/versioned/typed/operator/v1beta1/vmalertmanagerconfig.go index d8451b44..f715f751 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmalertmanagerconfig.go +++ b/api/client/versioned/typed/operator/v1beta1/vmalertmanagerconfig.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMAlertmanagerConfigsGetter has a method to return a VMAlertmanagerConfigInterface. @@ -39,6 +38,7 @@ type VMAlertmanagerConfigsGetter interface { type VMAlertmanagerConfigInterface interface { Create(ctx context.Context, vMAlertmanagerConfig *v1beta1.VMAlertmanagerConfig, opts v1.CreateOptions) (*v1beta1.VMAlertmanagerConfig, error) Update(ctx context.Context, vMAlertmanagerConfig *v1beta1.VMAlertmanagerConfig, opts v1.UpdateOptions) (*v1beta1.VMAlertmanagerConfig, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMAlertmanagerConfig *v1beta1.VMAlertmanagerConfig, opts v1.UpdateOptions) (*v1beta1.VMAlertmanagerConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMAlertmanagerConfigInterface interface { // vMAlertmanagerConfigs implements VMAlertmanagerConfigInterface type vMAlertmanagerConfigs struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMAlertmanagerConfig, *v1beta1.VMAlertmanagerConfigList] } // newVMAlertmanagerConfigs returns a VMAlertmanagerConfigs func newVMAlertmanagerConfigs(c *OperatorV1beta1Client, namespace string) *vMAlertmanagerConfigs { return &vMAlertmanagerConfigs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMAlertmanagerConfig, *v1beta1.VMAlertmanagerConfigList]( + "vmalertmanagerconfigs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMAlertmanagerConfig { return &v1beta1.VMAlertmanagerConfig{} }, + func() *v1beta1.VMAlertmanagerConfigList { return &v1beta1.VMAlertmanagerConfigList{} }), } } - -// Get takes name of the vMAlertmanagerConfig, and returns the corresponding vMAlertmanagerConfig object, and an error if there is any. -func (c *vMAlertmanagerConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMAlertmanagerConfig, err error) { - result = &v1beta1.VMAlertmanagerConfig{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmalertmanagerconfigs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMAlertmanagerConfigs that match those selectors. -func (c *vMAlertmanagerConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMAlertmanagerConfigList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMAlertmanagerConfigList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmalertmanagerconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMAlertmanagerConfigs. -func (c *vMAlertmanagerConfigs) 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("vmalertmanagerconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMAlertmanagerConfig and creates it. Returns the server's representation of the vMAlertmanagerConfig, and an error, if there is any. -func (c *vMAlertmanagerConfigs) Create(ctx context.Context, vMAlertmanagerConfig *v1beta1.VMAlertmanagerConfig, opts v1.CreateOptions) (result *v1beta1.VMAlertmanagerConfig, err error) { - result = &v1beta1.VMAlertmanagerConfig{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmalertmanagerconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAlertmanagerConfig). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMAlertmanagerConfig and updates it. Returns the server's representation of the vMAlertmanagerConfig, and an error, if there is any. -func (c *vMAlertmanagerConfigs) Update(ctx context.Context, vMAlertmanagerConfig *v1beta1.VMAlertmanagerConfig, opts v1.UpdateOptions) (result *v1beta1.VMAlertmanagerConfig, err error) { - result = &v1beta1.VMAlertmanagerConfig{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmalertmanagerconfigs"). - Name(vMAlertmanagerConfig.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAlertmanagerConfig). - 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 *vMAlertmanagerConfigs) UpdateStatus(ctx context.Context, vMAlertmanagerConfig *v1beta1.VMAlertmanagerConfig, opts v1.UpdateOptions) (result *v1beta1.VMAlertmanagerConfig, err error) { - result = &v1beta1.VMAlertmanagerConfig{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmalertmanagerconfigs"). - Name(vMAlertmanagerConfig.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAlertmanagerConfig). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMAlertmanagerConfig and deletes it. Returns an error if one occurs. -func (c *vMAlertmanagerConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmalertmanagerconfigs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMAlertmanagerConfigs) 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("vmalertmanagerconfigs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMAlertmanagerConfig. -func (c *vMAlertmanagerConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMAlertmanagerConfig, err error) { - result = &v1beta1.VMAlertmanagerConfig{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmalertmanagerconfigs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmauth.go b/api/client/versioned/typed/operator/v1beta1/vmauth.go index cdaa890c..54e9aec3 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmauth.go +++ b/api/client/versioned/typed/operator/v1beta1/vmauth.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMAuthsGetter has a method to return a VMAuthInterface. @@ -39,6 +38,7 @@ type VMAuthsGetter interface { type VMAuthInterface interface { Create(ctx context.Context, vMAuth *v1beta1.VMAuth, opts v1.CreateOptions) (*v1beta1.VMAuth, error) Update(ctx context.Context, vMAuth *v1beta1.VMAuth, opts v1.UpdateOptions) (*v1beta1.VMAuth, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMAuth *v1beta1.VMAuth, opts v1.UpdateOptions) (*v1beta1.VMAuth, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMAuthInterface interface { // vMAuths implements VMAuthInterface type vMAuths struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMAuth, *v1beta1.VMAuthList] } // newVMAuths returns a VMAuths func newVMAuths(c *OperatorV1beta1Client, namespace string) *vMAuths { return &vMAuths{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMAuth, *v1beta1.VMAuthList]( + "vmauths", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMAuth { return &v1beta1.VMAuth{} }, + func() *v1beta1.VMAuthList { return &v1beta1.VMAuthList{} }), } } - -// Get takes name of the vMAuth, and returns the corresponding vMAuth object, and an error if there is any. -func (c *vMAuths) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMAuth, err error) { - result = &v1beta1.VMAuth{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmauths"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMAuths that match those selectors. -func (c *vMAuths) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMAuthList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMAuthList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmauths"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMAuths. -func (c *vMAuths) 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("vmauths"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMAuth and creates it. Returns the server's representation of the vMAuth, and an error, if there is any. -func (c *vMAuths) Create(ctx context.Context, vMAuth *v1beta1.VMAuth, opts v1.CreateOptions) (result *v1beta1.VMAuth, err error) { - result = &v1beta1.VMAuth{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmauths"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAuth). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMAuth and updates it. Returns the server's representation of the vMAuth, and an error, if there is any. -func (c *vMAuths) Update(ctx context.Context, vMAuth *v1beta1.VMAuth, opts v1.UpdateOptions) (result *v1beta1.VMAuth, err error) { - result = &v1beta1.VMAuth{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmauths"). - Name(vMAuth.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAuth). - 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 *vMAuths) UpdateStatus(ctx context.Context, vMAuth *v1beta1.VMAuth, opts v1.UpdateOptions) (result *v1beta1.VMAuth, err error) { - result = &v1beta1.VMAuth{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmauths"). - Name(vMAuth.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMAuth). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMAuth and deletes it. Returns an error if one occurs. -func (c *vMAuths) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmauths"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMAuths) 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("vmauths"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMAuth. -func (c *vMAuths) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMAuth, err error) { - result = &v1beta1.VMAuth{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmauths"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmcluster.go b/api/client/versioned/typed/operator/v1beta1/vmcluster.go index 650d60e8..fe4dcc6e 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmcluster.go +++ b/api/client/versioned/typed/operator/v1beta1/vmcluster.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMClustersGetter has a method to return a VMClusterInterface. @@ -39,6 +38,7 @@ type VMClustersGetter interface { type VMClusterInterface interface { Create(ctx context.Context, vMCluster *v1beta1.VMCluster, opts v1.CreateOptions) (*v1beta1.VMCluster, error) Update(ctx context.Context, vMCluster *v1beta1.VMCluster, opts v1.UpdateOptions) (*v1beta1.VMCluster, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMCluster *v1beta1.VMCluster, opts v1.UpdateOptions) (*v1beta1.VMCluster, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMClusterInterface interface { // vMClusters implements VMClusterInterface type vMClusters struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMCluster, *v1beta1.VMClusterList] } // newVMClusters returns a VMClusters func newVMClusters(c *OperatorV1beta1Client, namespace string) *vMClusters { return &vMClusters{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMCluster, *v1beta1.VMClusterList]( + "vmclusters", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMCluster { return &v1beta1.VMCluster{} }, + func() *v1beta1.VMClusterList { return &v1beta1.VMClusterList{} }), } } - -// Get takes name of the vMCluster, and returns the corresponding vMCluster object, and an error if there is any. -func (c *vMClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMCluster, err error) { - result = &v1beta1.VMCluster{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmclusters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMClusters that match those selectors. -func (c *vMClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMClusterList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMClusterList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMClusters. -func (c *vMClusters) 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("vmclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMCluster and creates it. Returns the server's representation of the vMCluster, and an error, if there is any. -func (c *vMClusters) Create(ctx context.Context, vMCluster *v1beta1.VMCluster, opts v1.CreateOptions) (result *v1beta1.VMCluster, err error) { - result = &v1beta1.VMCluster{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMCluster). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMCluster and updates it. Returns the server's representation of the vMCluster, and an error, if there is any. -func (c *vMClusters) Update(ctx context.Context, vMCluster *v1beta1.VMCluster, opts v1.UpdateOptions) (result *v1beta1.VMCluster, err error) { - result = &v1beta1.VMCluster{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmclusters"). - Name(vMCluster.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMCluster). - 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 *vMClusters) UpdateStatus(ctx context.Context, vMCluster *v1beta1.VMCluster, opts v1.UpdateOptions) (result *v1beta1.VMCluster, err error) { - result = &v1beta1.VMCluster{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmclusters"). - Name(vMCluster.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMCluster). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMCluster and deletes it. Returns an error if one occurs. -func (c *vMClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmclusters"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMClusters) 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("vmclusters"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMCluster. -func (c *vMClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMCluster, err error) { - result = &v1beta1.VMCluster{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmclusters"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmnodescrape.go b/api/client/versioned/typed/operator/v1beta1/vmnodescrape.go index 628359b4..61bd9a91 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmnodescrape.go +++ b/api/client/versioned/typed/operator/v1beta1/vmnodescrape.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMNodeScrapesGetter has a method to return a VMNodeScrapeInterface. @@ -39,6 +38,7 @@ type VMNodeScrapesGetter interface { type VMNodeScrapeInterface interface { Create(ctx context.Context, vMNodeScrape *v1beta1.VMNodeScrape, opts v1.CreateOptions) (*v1beta1.VMNodeScrape, error) Update(ctx context.Context, vMNodeScrape *v1beta1.VMNodeScrape, opts v1.UpdateOptions) (*v1beta1.VMNodeScrape, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMNodeScrape *v1beta1.VMNodeScrape, opts v1.UpdateOptions) (*v1beta1.VMNodeScrape, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMNodeScrapeInterface interface { // vMNodeScrapes implements VMNodeScrapeInterface type vMNodeScrapes struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMNodeScrape, *v1beta1.VMNodeScrapeList] } // newVMNodeScrapes returns a VMNodeScrapes func newVMNodeScrapes(c *OperatorV1beta1Client, namespace string) *vMNodeScrapes { return &vMNodeScrapes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMNodeScrape, *v1beta1.VMNodeScrapeList]( + "vmnodescrapes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMNodeScrape { return &v1beta1.VMNodeScrape{} }, + func() *v1beta1.VMNodeScrapeList { return &v1beta1.VMNodeScrapeList{} }), } } - -// Get takes name of the vMNodeScrape, and returns the corresponding vMNodeScrape object, and an error if there is any. -func (c *vMNodeScrapes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMNodeScrape, err error) { - result = &v1beta1.VMNodeScrape{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmnodescrapes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMNodeScrapes that match those selectors. -func (c *vMNodeScrapes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMNodeScrapeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMNodeScrapeList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmnodescrapes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMNodeScrapes. -func (c *vMNodeScrapes) 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("vmnodescrapes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMNodeScrape and creates it. Returns the server's representation of the vMNodeScrape, and an error, if there is any. -func (c *vMNodeScrapes) Create(ctx context.Context, vMNodeScrape *v1beta1.VMNodeScrape, opts v1.CreateOptions) (result *v1beta1.VMNodeScrape, err error) { - result = &v1beta1.VMNodeScrape{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmnodescrapes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMNodeScrape). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMNodeScrape and updates it. Returns the server's representation of the vMNodeScrape, and an error, if there is any. -func (c *vMNodeScrapes) Update(ctx context.Context, vMNodeScrape *v1beta1.VMNodeScrape, opts v1.UpdateOptions) (result *v1beta1.VMNodeScrape, err error) { - result = &v1beta1.VMNodeScrape{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmnodescrapes"). - Name(vMNodeScrape.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMNodeScrape). - 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 *vMNodeScrapes) UpdateStatus(ctx context.Context, vMNodeScrape *v1beta1.VMNodeScrape, opts v1.UpdateOptions) (result *v1beta1.VMNodeScrape, err error) { - result = &v1beta1.VMNodeScrape{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmnodescrapes"). - Name(vMNodeScrape.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMNodeScrape). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMNodeScrape and deletes it. Returns an error if one occurs. -func (c *vMNodeScrapes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmnodescrapes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMNodeScrapes) 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("vmnodescrapes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMNodeScrape. -func (c *vMNodeScrapes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMNodeScrape, err error) { - result = &v1beta1.VMNodeScrape{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmnodescrapes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmpodscrape.go b/api/client/versioned/typed/operator/v1beta1/vmpodscrape.go index c81ad41b..fbf755cb 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmpodscrape.go +++ b/api/client/versioned/typed/operator/v1beta1/vmpodscrape.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMPodScrapesGetter has a method to return a VMPodScrapeInterface. @@ -39,6 +38,7 @@ type VMPodScrapesGetter interface { type VMPodScrapeInterface interface { Create(ctx context.Context, vMPodScrape *v1beta1.VMPodScrape, opts v1.CreateOptions) (*v1beta1.VMPodScrape, error) Update(ctx context.Context, vMPodScrape *v1beta1.VMPodScrape, opts v1.UpdateOptions) (*v1beta1.VMPodScrape, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMPodScrape *v1beta1.VMPodScrape, opts v1.UpdateOptions) (*v1beta1.VMPodScrape, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMPodScrapeInterface interface { // vMPodScrapes implements VMPodScrapeInterface type vMPodScrapes struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMPodScrape, *v1beta1.VMPodScrapeList] } // newVMPodScrapes returns a VMPodScrapes func newVMPodScrapes(c *OperatorV1beta1Client, namespace string) *vMPodScrapes { return &vMPodScrapes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMPodScrape, *v1beta1.VMPodScrapeList]( + "vmpodscrapes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMPodScrape { return &v1beta1.VMPodScrape{} }, + func() *v1beta1.VMPodScrapeList { return &v1beta1.VMPodScrapeList{} }), } } - -// Get takes name of the vMPodScrape, and returns the corresponding vMPodScrape object, and an error if there is any. -func (c *vMPodScrapes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMPodScrape, err error) { - result = &v1beta1.VMPodScrape{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmpodscrapes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMPodScrapes that match those selectors. -func (c *vMPodScrapes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMPodScrapeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMPodScrapeList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmpodscrapes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMPodScrapes. -func (c *vMPodScrapes) 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("vmpodscrapes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMPodScrape and creates it. Returns the server's representation of the vMPodScrape, and an error, if there is any. -func (c *vMPodScrapes) Create(ctx context.Context, vMPodScrape *v1beta1.VMPodScrape, opts v1.CreateOptions) (result *v1beta1.VMPodScrape, err error) { - result = &v1beta1.VMPodScrape{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmpodscrapes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMPodScrape). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMPodScrape and updates it. Returns the server's representation of the vMPodScrape, and an error, if there is any. -func (c *vMPodScrapes) Update(ctx context.Context, vMPodScrape *v1beta1.VMPodScrape, opts v1.UpdateOptions) (result *v1beta1.VMPodScrape, err error) { - result = &v1beta1.VMPodScrape{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmpodscrapes"). - Name(vMPodScrape.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMPodScrape). - 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 *vMPodScrapes) UpdateStatus(ctx context.Context, vMPodScrape *v1beta1.VMPodScrape, opts v1.UpdateOptions) (result *v1beta1.VMPodScrape, err error) { - result = &v1beta1.VMPodScrape{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmpodscrapes"). - Name(vMPodScrape.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMPodScrape). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMPodScrape and deletes it. Returns an error if one occurs. -func (c *vMPodScrapes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmpodscrapes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMPodScrapes) 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("vmpodscrapes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMPodScrape. -func (c *vMPodScrapes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMPodScrape, err error) { - result = &v1beta1.VMPodScrape{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmpodscrapes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmprobe.go b/api/client/versioned/typed/operator/v1beta1/vmprobe.go index fd1cd71a..d9519a25 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmprobe.go +++ b/api/client/versioned/typed/operator/v1beta1/vmprobe.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMProbesGetter has a method to return a VMProbeInterface. @@ -39,6 +38,7 @@ type VMProbesGetter interface { type VMProbeInterface interface { Create(ctx context.Context, vMProbe *v1beta1.VMProbe, opts v1.CreateOptions) (*v1beta1.VMProbe, error) Update(ctx context.Context, vMProbe *v1beta1.VMProbe, opts v1.UpdateOptions) (*v1beta1.VMProbe, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMProbe *v1beta1.VMProbe, opts v1.UpdateOptions) (*v1beta1.VMProbe, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMProbeInterface interface { // vMProbes implements VMProbeInterface type vMProbes struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMProbe, *v1beta1.VMProbeList] } // newVMProbes returns a VMProbes func newVMProbes(c *OperatorV1beta1Client, namespace string) *vMProbes { return &vMProbes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMProbe, *v1beta1.VMProbeList]( + "vmprobes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMProbe { return &v1beta1.VMProbe{} }, + func() *v1beta1.VMProbeList { return &v1beta1.VMProbeList{} }), } } - -// Get takes name of the vMProbe, and returns the corresponding vMProbe object, and an error if there is any. -func (c *vMProbes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMProbe, err error) { - result = &v1beta1.VMProbe{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmprobes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMProbes that match those selectors. -func (c *vMProbes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMProbeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMProbeList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmprobes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMProbes. -func (c *vMProbes) 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("vmprobes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMProbe and creates it. Returns the server's representation of the vMProbe, and an error, if there is any. -func (c *vMProbes) Create(ctx context.Context, vMProbe *v1beta1.VMProbe, opts v1.CreateOptions) (result *v1beta1.VMProbe, err error) { - result = &v1beta1.VMProbe{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmprobes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMProbe). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMProbe and updates it. Returns the server's representation of the vMProbe, and an error, if there is any. -func (c *vMProbes) Update(ctx context.Context, vMProbe *v1beta1.VMProbe, opts v1.UpdateOptions) (result *v1beta1.VMProbe, err error) { - result = &v1beta1.VMProbe{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmprobes"). - Name(vMProbe.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMProbe). - 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 *vMProbes) UpdateStatus(ctx context.Context, vMProbe *v1beta1.VMProbe, opts v1.UpdateOptions) (result *v1beta1.VMProbe, err error) { - result = &v1beta1.VMProbe{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmprobes"). - Name(vMProbe.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMProbe). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMProbe and deletes it. Returns an error if one occurs. -func (c *vMProbes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmprobes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMProbes) 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("vmprobes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMProbe. -func (c *vMProbes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMProbe, err error) { - result = &v1beta1.VMProbe{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmprobes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmrule.go b/api/client/versioned/typed/operator/v1beta1/vmrule.go index 2b929716..22770819 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmrule.go +++ b/api/client/versioned/typed/operator/v1beta1/vmrule.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMRulesGetter has a method to return a VMRuleInterface. @@ -39,6 +38,7 @@ type VMRulesGetter interface { type VMRuleInterface interface { Create(ctx context.Context, vMRule *v1beta1.VMRule, opts v1.CreateOptions) (*v1beta1.VMRule, error) Update(ctx context.Context, vMRule *v1beta1.VMRule, opts v1.UpdateOptions) (*v1beta1.VMRule, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMRule *v1beta1.VMRule, opts v1.UpdateOptions) (*v1beta1.VMRule, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMRuleInterface interface { // vMRules implements VMRuleInterface type vMRules struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMRule, *v1beta1.VMRuleList] } // newVMRules returns a VMRules func newVMRules(c *OperatorV1beta1Client, namespace string) *vMRules { return &vMRules{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMRule, *v1beta1.VMRuleList]( + "vmrules", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMRule { return &v1beta1.VMRule{} }, + func() *v1beta1.VMRuleList { return &v1beta1.VMRuleList{} }), } } - -// Get takes name of the vMRule, and returns the corresponding vMRule object, and an error if there is any. -func (c *vMRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMRule, err error) { - result = &v1beta1.VMRule{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmrules"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMRules that match those selectors. -func (c *vMRules) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMRuleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMRuleList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmrules"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMRules. -func (c *vMRules) 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("vmrules"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMRule and creates it. Returns the server's representation of the vMRule, and an error, if there is any. -func (c *vMRules) Create(ctx context.Context, vMRule *v1beta1.VMRule, opts v1.CreateOptions) (result *v1beta1.VMRule, err error) { - result = &v1beta1.VMRule{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmrules"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMRule). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMRule and updates it. Returns the server's representation of the vMRule, and an error, if there is any. -func (c *vMRules) Update(ctx context.Context, vMRule *v1beta1.VMRule, opts v1.UpdateOptions) (result *v1beta1.VMRule, err error) { - result = &v1beta1.VMRule{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmrules"). - Name(vMRule.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMRule). - 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 *vMRules) UpdateStatus(ctx context.Context, vMRule *v1beta1.VMRule, opts v1.UpdateOptions) (result *v1beta1.VMRule, err error) { - result = &v1beta1.VMRule{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmrules"). - Name(vMRule.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMRule). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMRule and deletes it. Returns an error if one occurs. -func (c *vMRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmrules"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMRules) 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("vmrules"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMRule. -func (c *vMRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMRule, err error) { - result = &v1beta1.VMRule{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmrules"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmscrapeconfig.go b/api/client/versioned/typed/operator/v1beta1/vmscrapeconfig.go index fd24b780..47ee9a22 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmscrapeconfig.go +++ b/api/client/versioned/typed/operator/v1beta1/vmscrapeconfig.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMScrapeConfigsGetter has a method to return a VMScrapeConfigInterface. @@ -39,6 +38,7 @@ type VMScrapeConfigsGetter interface { type VMScrapeConfigInterface interface { Create(ctx context.Context, vMScrapeConfig *v1beta1.VMScrapeConfig, opts v1.CreateOptions) (*v1beta1.VMScrapeConfig, error) Update(ctx context.Context, vMScrapeConfig *v1beta1.VMScrapeConfig, opts v1.UpdateOptions) (*v1beta1.VMScrapeConfig, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMScrapeConfig *v1beta1.VMScrapeConfig, opts v1.UpdateOptions) (*v1beta1.VMScrapeConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMScrapeConfigInterface interface { // vMScrapeConfigs implements VMScrapeConfigInterface type vMScrapeConfigs struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMScrapeConfig, *v1beta1.VMScrapeConfigList] } // newVMScrapeConfigs returns a VMScrapeConfigs func newVMScrapeConfigs(c *OperatorV1beta1Client, namespace string) *vMScrapeConfigs { return &vMScrapeConfigs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMScrapeConfig, *v1beta1.VMScrapeConfigList]( + "vmscrapeconfigs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMScrapeConfig { return &v1beta1.VMScrapeConfig{} }, + func() *v1beta1.VMScrapeConfigList { return &v1beta1.VMScrapeConfigList{} }), } } - -// Get takes name of the vMScrapeConfig, and returns the corresponding vMScrapeConfig object, and an error if there is any. -func (c *vMScrapeConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMScrapeConfig, err error) { - result = &v1beta1.VMScrapeConfig{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmscrapeconfigs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMScrapeConfigs that match those selectors. -func (c *vMScrapeConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMScrapeConfigList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMScrapeConfigList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmscrapeconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMScrapeConfigs. -func (c *vMScrapeConfigs) 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("vmscrapeconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMScrapeConfig and creates it. Returns the server's representation of the vMScrapeConfig, and an error, if there is any. -func (c *vMScrapeConfigs) Create(ctx context.Context, vMScrapeConfig *v1beta1.VMScrapeConfig, opts v1.CreateOptions) (result *v1beta1.VMScrapeConfig, err error) { - result = &v1beta1.VMScrapeConfig{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmscrapeconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMScrapeConfig). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMScrapeConfig and updates it. Returns the server's representation of the vMScrapeConfig, and an error, if there is any. -func (c *vMScrapeConfigs) Update(ctx context.Context, vMScrapeConfig *v1beta1.VMScrapeConfig, opts v1.UpdateOptions) (result *v1beta1.VMScrapeConfig, err error) { - result = &v1beta1.VMScrapeConfig{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmscrapeconfigs"). - Name(vMScrapeConfig.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMScrapeConfig). - 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 *vMScrapeConfigs) UpdateStatus(ctx context.Context, vMScrapeConfig *v1beta1.VMScrapeConfig, opts v1.UpdateOptions) (result *v1beta1.VMScrapeConfig, err error) { - result = &v1beta1.VMScrapeConfig{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmscrapeconfigs"). - Name(vMScrapeConfig.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMScrapeConfig). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMScrapeConfig and deletes it. Returns an error if one occurs. -func (c *vMScrapeConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmscrapeconfigs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMScrapeConfigs) 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("vmscrapeconfigs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMScrapeConfig. -func (c *vMScrapeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMScrapeConfig, err error) { - result = &v1beta1.VMScrapeConfig{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmscrapeconfigs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmservicescrape.go b/api/client/versioned/typed/operator/v1beta1/vmservicescrape.go index 8758e3b4..a5426f0c 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmservicescrape.go +++ b/api/client/versioned/typed/operator/v1beta1/vmservicescrape.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMServiceScrapesGetter has a method to return a VMServiceScrapeInterface. @@ -39,6 +38,7 @@ type VMServiceScrapesGetter interface { type VMServiceScrapeInterface interface { Create(ctx context.Context, vMServiceScrape *v1beta1.VMServiceScrape, opts v1.CreateOptions) (*v1beta1.VMServiceScrape, error) Update(ctx context.Context, vMServiceScrape *v1beta1.VMServiceScrape, opts v1.UpdateOptions) (*v1beta1.VMServiceScrape, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMServiceScrape *v1beta1.VMServiceScrape, opts v1.UpdateOptions) (*v1beta1.VMServiceScrape, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMServiceScrapeInterface interface { // vMServiceScrapes implements VMServiceScrapeInterface type vMServiceScrapes struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMServiceScrape, *v1beta1.VMServiceScrapeList] } // newVMServiceScrapes returns a VMServiceScrapes func newVMServiceScrapes(c *OperatorV1beta1Client, namespace string) *vMServiceScrapes { return &vMServiceScrapes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMServiceScrape, *v1beta1.VMServiceScrapeList]( + "vmservicescrapes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMServiceScrape { return &v1beta1.VMServiceScrape{} }, + func() *v1beta1.VMServiceScrapeList { return &v1beta1.VMServiceScrapeList{} }), } } - -// Get takes name of the vMServiceScrape, and returns the corresponding vMServiceScrape object, and an error if there is any. -func (c *vMServiceScrapes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMServiceScrape, err error) { - result = &v1beta1.VMServiceScrape{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmservicescrapes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMServiceScrapes that match those selectors. -func (c *vMServiceScrapes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMServiceScrapeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMServiceScrapeList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmservicescrapes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMServiceScrapes. -func (c *vMServiceScrapes) 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("vmservicescrapes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMServiceScrape and creates it. Returns the server's representation of the vMServiceScrape, and an error, if there is any. -func (c *vMServiceScrapes) Create(ctx context.Context, vMServiceScrape *v1beta1.VMServiceScrape, opts v1.CreateOptions) (result *v1beta1.VMServiceScrape, err error) { - result = &v1beta1.VMServiceScrape{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmservicescrapes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMServiceScrape). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMServiceScrape and updates it. Returns the server's representation of the vMServiceScrape, and an error, if there is any. -func (c *vMServiceScrapes) Update(ctx context.Context, vMServiceScrape *v1beta1.VMServiceScrape, opts v1.UpdateOptions) (result *v1beta1.VMServiceScrape, err error) { - result = &v1beta1.VMServiceScrape{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmservicescrapes"). - Name(vMServiceScrape.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMServiceScrape). - 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 *vMServiceScrapes) UpdateStatus(ctx context.Context, vMServiceScrape *v1beta1.VMServiceScrape, opts v1.UpdateOptions) (result *v1beta1.VMServiceScrape, err error) { - result = &v1beta1.VMServiceScrape{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmservicescrapes"). - Name(vMServiceScrape.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMServiceScrape). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMServiceScrape and deletes it. Returns an error if one occurs. -func (c *vMServiceScrapes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmservicescrapes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMServiceScrapes) 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("vmservicescrapes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMServiceScrape. -func (c *vMServiceScrapes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMServiceScrape, err error) { - result = &v1beta1.VMServiceScrape{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmservicescrapes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmsingle.go b/api/client/versioned/typed/operator/v1beta1/vmsingle.go index c4f15a7f..15eff9bb 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmsingle.go +++ b/api/client/versioned/typed/operator/v1beta1/vmsingle.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMSinglesGetter has a method to return a VMSingleInterface. @@ -39,6 +38,7 @@ type VMSinglesGetter interface { type VMSingleInterface interface { Create(ctx context.Context, vMSingle *v1beta1.VMSingle, opts v1.CreateOptions) (*v1beta1.VMSingle, error) Update(ctx context.Context, vMSingle *v1beta1.VMSingle, opts v1.UpdateOptions) (*v1beta1.VMSingle, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMSingle *v1beta1.VMSingle, opts v1.UpdateOptions) (*v1beta1.VMSingle, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMSingleInterface interface { // vMSingles implements VMSingleInterface type vMSingles struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMSingle, *v1beta1.VMSingleList] } // newVMSingles returns a VMSingles func newVMSingles(c *OperatorV1beta1Client, namespace string) *vMSingles { return &vMSingles{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMSingle, *v1beta1.VMSingleList]( + "vmsingles", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMSingle { return &v1beta1.VMSingle{} }, + func() *v1beta1.VMSingleList { return &v1beta1.VMSingleList{} }), } } - -// Get takes name of the vMSingle, and returns the corresponding vMSingle object, and an error if there is any. -func (c *vMSingles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMSingle, err error) { - result = &v1beta1.VMSingle{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmsingles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMSingles that match those selectors. -func (c *vMSingles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMSingleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMSingleList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmsingles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMSingles. -func (c *vMSingles) 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("vmsingles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMSingle and creates it. Returns the server's representation of the vMSingle, and an error, if there is any. -func (c *vMSingles) Create(ctx context.Context, vMSingle *v1beta1.VMSingle, opts v1.CreateOptions) (result *v1beta1.VMSingle, err error) { - result = &v1beta1.VMSingle{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmsingles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMSingle). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMSingle and updates it. Returns the server's representation of the vMSingle, and an error, if there is any. -func (c *vMSingles) Update(ctx context.Context, vMSingle *v1beta1.VMSingle, opts v1.UpdateOptions) (result *v1beta1.VMSingle, err error) { - result = &v1beta1.VMSingle{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmsingles"). - Name(vMSingle.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMSingle). - 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 *vMSingles) UpdateStatus(ctx context.Context, vMSingle *v1beta1.VMSingle, opts v1.UpdateOptions) (result *v1beta1.VMSingle, err error) { - result = &v1beta1.VMSingle{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmsingles"). - Name(vMSingle.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMSingle). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMSingle and deletes it. Returns an error if one occurs. -func (c *vMSingles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmsingles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMSingles) 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("vmsingles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMSingle. -func (c *vMSingles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMSingle, err error) { - result = &v1beta1.VMSingle{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmsingles"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmstaticscrape.go b/api/client/versioned/typed/operator/v1beta1/vmstaticscrape.go index ce1e6a63..8e3c77ea 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmstaticscrape.go +++ b/api/client/versioned/typed/operator/v1beta1/vmstaticscrape.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMStaticScrapesGetter has a method to return a VMStaticScrapeInterface. @@ -39,6 +38,7 @@ type VMStaticScrapesGetter interface { type VMStaticScrapeInterface interface { Create(ctx context.Context, vMStaticScrape *v1beta1.VMStaticScrape, opts v1.CreateOptions) (*v1beta1.VMStaticScrape, error) Update(ctx context.Context, vMStaticScrape *v1beta1.VMStaticScrape, opts v1.UpdateOptions) (*v1beta1.VMStaticScrape, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMStaticScrape *v1beta1.VMStaticScrape, opts v1.UpdateOptions) (*v1beta1.VMStaticScrape, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMStaticScrapeInterface interface { // vMStaticScrapes implements VMStaticScrapeInterface type vMStaticScrapes struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMStaticScrape, *v1beta1.VMStaticScrapeList] } // newVMStaticScrapes returns a VMStaticScrapes func newVMStaticScrapes(c *OperatorV1beta1Client, namespace string) *vMStaticScrapes { return &vMStaticScrapes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMStaticScrape, *v1beta1.VMStaticScrapeList]( + "vmstaticscrapes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMStaticScrape { return &v1beta1.VMStaticScrape{} }, + func() *v1beta1.VMStaticScrapeList { return &v1beta1.VMStaticScrapeList{} }), } } - -// Get takes name of the vMStaticScrape, and returns the corresponding vMStaticScrape object, and an error if there is any. -func (c *vMStaticScrapes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMStaticScrape, err error) { - result = &v1beta1.VMStaticScrape{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmstaticscrapes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMStaticScrapes that match those selectors. -func (c *vMStaticScrapes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMStaticScrapeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMStaticScrapeList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmstaticscrapes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMStaticScrapes. -func (c *vMStaticScrapes) 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("vmstaticscrapes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMStaticScrape and creates it. Returns the server's representation of the vMStaticScrape, and an error, if there is any. -func (c *vMStaticScrapes) Create(ctx context.Context, vMStaticScrape *v1beta1.VMStaticScrape, opts v1.CreateOptions) (result *v1beta1.VMStaticScrape, err error) { - result = &v1beta1.VMStaticScrape{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmstaticscrapes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMStaticScrape). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMStaticScrape and updates it. Returns the server's representation of the vMStaticScrape, and an error, if there is any. -func (c *vMStaticScrapes) Update(ctx context.Context, vMStaticScrape *v1beta1.VMStaticScrape, opts v1.UpdateOptions) (result *v1beta1.VMStaticScrape, err error) { - result = &v1beta1.VMStaticScrape{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmstaticscrapes"). - Name(vMStaticScrape.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMStaticScrape). - 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 *vMStaticScrapes) UpdateStatus(ctx context.Context, vMStaticScrape *v1beta1.VMStaticScrape, opts v1.UpdateOptions) (result *v1beta1.VMStaticScrape, err error) { - result = &v1beta1.VMStaticScrape{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmstaticscrapes"). - Name(vMStaticScrape.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMStaticScrape). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMStaticScrape and deletes it. Returns an error if one occurs. -func (c *vMStaticScrapes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmstaticscrapes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMStaticScrapes) 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("vmstaticscrapes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMStaticScrape. -func (c *vMStaticScrapes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMStaticScrape, err error) { - result = &v1beta1.VMStaticScrape{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmstaticscrapes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/api/client/versioned/typed/operator/v1beta1/vmuser.go b/api/client/versioned/typed/operator/v1beta1/vmuser.go index 61e9aeef..3b4cbc98 100644 --- a/api/client/versioned/typed/operator/v1beta1/vmuser.go +++ b/api/client/versioned/typed/operator/v1beta1/vmuser.go @@ -13,20 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen-v0.30. DO NOT EDIT. +// Code generated by client-gen-v0.31. DO NOT EDIT. package v1beta1 import ( "context" - "time" scheme "github.com/VictoriaMetrics/operator/api/client/versioned/scheme" v1beta1 "github.com/VictoriaMetrics/operator/api/operator/v1beta1" 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" ) // VMUsersGetter has a method to return a VMUserInterface. @@ -39,6 +38,7 @@ type VMUsersGetter interface { type VMUserInterface interface { Create(ctx context.Context, vMUser *v1beta1.VMUser, opts v1.CreateOptions) (*v1beta1.VMUser, error) Update(ctx context.Context, vMUser *v1beta1.VMUser, opts v1.UpdateOptions) (*v1beta1.VMUser, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, vMUser *v1beta1.VMUser, opts v1.UpdateOptions) (*v1beta1.VMUser, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,144 +51,18 @@ type VMUserInterface interface { // vMUsers implements VMUserInterface type vMUsers struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1beta1.VMUser, *v1beta1.VMUserList] } // newVMUsers returns a VMUsers func newVMUsers(c *OperatorV1beta1Client, namespace string) *vMUsers { return &vMUsers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1beta1.VMUser, *v1beta1.VMUserList]( + "vmusers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.VMUser { return &v1beta1.VMUser{} }, + func() *v1beta1.VMUserList { return &v1beta1.VMUserList{} }), } } - -// Get takes name of the vMUser, and returns the corresponding vMUser object, and an error if there is any. -func (c *vMUsers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VMUser, err error) { - result = &v1beta1.VMUser{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmusers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VMUsers that match those selectors. -func (c *vMUsers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VMUserList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VMUserList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("vmusers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested vMUsers. -func (c *vMUsers) 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("vmusers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a vMUser and creates it. Returns the server's representation of the vMUser, and an error, if there is any. -func (c *vMUsers) Create(ctx context.Context, vMUser *v1beta1.VMUser, opts v1.CreateOptions) (result *v1beta1.VMUser, err error) { - result = &v1beta1.VMUser{} - err = c.client.Post(). - Namespace(c.ns). - Resource("vmusers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMUser). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a vMUser and updates it. Returns the server's representation of the vMUser, and an error, if there is any. -func (c *vMUsers) Update(ctx context.Context, vMUser *v1beta1.VMUser, opts v1.UpdateOptions) (result *v1beta1.VMUser, err error) { - result = &v1beta1.VMUser{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmusers"). - Name(vMUser.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMUser). - 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 *vMUsers) UpdateStatus(ctx context.Context, vMUser *v1beta1.VMUser, opts v1.UpdateOptions) (result *v1beta1.VMUser, err error) { - result = &v1beta1.VMUser{} - err = c.client.Put(). - Namespace(c.ns). - Resource("vmusers"). - Name(vMUser.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(vMUser). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the vMUser and deletes it. Returns an error if one occurs. -func (c *vMUsers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("vmusers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *vMUsers) 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("vmusers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched vMUser. -func (c *vMUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VMUser, err error) { - result = &v1beta1.VMUser{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("vmusers"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -}