diff --git a/operator/Makefile b/operator/Makefile index 6439da828b..5b8cd3d928 100644 --- a/operator/Makefile +++ b/operator/Makefile @@ -149,6 +149,7 @@ kind-image-load-all: kind-image-load kind-image-load-cli .PHONY: go-generate go-generate: + go mod tidy go generate ./... ##@ Deployment diff --git a/operator/apis/mlops/v1alpha1/doc.go b/operator/apis/mlops/v1alpha1/doc.go new file mode 100644 index 0000000000..598db58bea --- /dev/null +++ b/operator/apis/mlops/v1alpha1/doc.go @@ -0,0 +1,13 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed BY +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ + +// +k8s:deepcopy-gen=package +// +groupName=mlops.seldon.io/v1alpha1 + +package v1alpha1 diff --git a/operator/apis/mlops/v1alpha1/experiment_types.go b/operator/apis/mlops/v1alpha1/experiment_types.go index ba8fd62a90..0c2bcc9e95 100644 --- a/operator/apis/mlops/v1alpha1/experiment_types.go +++ b/operator/apis/mlops/v1alpha1/experiment_types.go @@ -59,6 +59,8 @@ type ExperimentStatus struct { //+kubebuilder:printcolumn:name="Mirror ready",type=string,JSONPath=`.status.conditions[?(@.type=='MirrorReady')].status`,description="Mirror ready status",priority=1 //+kubebuilder:printcolumn:name="Message",type=string,JSONPath=`.status.conditions[?(@.type=='Ready')].message`,description="Status message" //+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +//+genclient +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Experiment is the Schema for the experiments API type Experiment struct { @@ -70,6 +72,7 @@ type Experiment struct { } //+kubebuilder:object:root=true +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ExperimentList contains a list of Experiment type ExperimentList struct { diff --git a/operator/apis/mlops/v1alpha1/groupversion_info.go b/operator/apis/mlops/v1alpha1/groupversion_info.go index 6e87b1284d..9eca1d1785 100644 --- a/operator/apis/mlops/v1alpha1/groupversion_info.go +++ b/operator/apis/mlops/v1alpha1/groupversion_info.go @@ -18,12 +18,16 @@ import ( ) var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "mlops.seldon.io", Version: "v1alpha1"} + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: "mlops.seldon.io", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme ) + +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} diff --git a/operator/apis/mlops/v1alpha1/model_types.go b/operator/apis/mlops/v1alpha1/model_types.go index 5f73076365..a29928b839 100644 --- a/operator/apis/mlops/v1alpha1/model_types.go +++ b/operator/apis/mlops/v1alpha1/model_types.go @@ -155,6 +155,8 @@ type ModelStatus struct { //+kubebuilder:printcolumn:name="Available Replicas",type=integer,JSONPath=`.status.availableReplicas`,description="Number of replicas available to receive inference requests" //+kubebuilder:printcolumn:name="ModelGw Ready",type=string,JSONPath=`.status.modelgwReady`,description="Model Gateway ready status" //+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +//+genclient +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Model is the Schema for the models API type Model struct { @@ -166,6 +168,7 @@ type Model struct { } //+kubebuilder:object:root=true +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ModelList contains a list of Model type ModelList struct { diff --git a/operator/apis/mlops/v1alpha1/pipeline_types.go b/operator/apis/mlops/v1alpha1/pipeline_types.go index 512bf048b0..13920ce760 100644 --- a/operator/apis/mlops/v1alpha1/pipeline_types.go +++ b/operator/apis/mlops/v1alpha1/pipeline_types.go @@ -27,6 +27,8 @@ import ( //+kubebuilder:printcolumn:name="Dataflow ready",type=string,JSONPath=`.status.conditions[?(@.type=='PipelineReady')].status`,description="Dataflow ready status",priority=1 //+kubebuilder:printcolumn:name="Message",type=string,JSONPath=`.status.conditions[?(@.type=='Ready')].message`,description="Status message" //+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +//+genclient +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Pipeline is the Schema for the pipelines API type Pipeline struct { @@ -38,6 +40,7 @@ type Pipeline struct { } //+kubebuilder:object:root=true +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PipelineList contains a list of Pipeline type PipelineList struct { diff --git a/operator/apis/mlops/v1alpha1/seldonconfig_types.go b/operator/apis/mlops/v1alpha1/seldonconfig_types.go index e46050f0a5..1d4e84f902 100644 --- a/operator/apis/mlops/v1alpha1/seldonconfig_types.go +++ b/operator/apis/mlops/v1alpha1/seldonconfig_types.go @@ -131,6 +131,8 @@ type SeldonConfigStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status +//+genclient +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SeldonConfig is the Schema for the seldonconfigs API type SeldonConfig struct { @@ -142,6 +144,7 @@ type SeldonConfig struct { } //+kubebuilder:object:root=true +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SeldonConfigList contains a list of SeldonConfig type SeldonConfigList struct { diff --git a/operator/apis/mlops/v1alpha1/seldonruntime_types.go b/operator/apis/mlops/v1alpha1/seldonruntime_types.go index bd61dfb255..d69e8c02e9 100644 --- a/operator/apis/mlops/v1alpha1/seldonruntime_types.go +++ b/operator/apis/mlops/v1alpha1/seldonruntime_types.go @@ -44,6 +44,8 @@ type SeldonRuntimeStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status +//+genclient +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SeldonRuntime is the Schema for the seldonruntimes API type SeldonRuntime struct { @@ -55,6 +57,7 @@ type SeldonRuntime struct { } //+kubebuilder:object:root=true +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SeldonRuntimeList contains a list of SeldonRuntime type SeldonRuntimeList struct { diff --git a/operator/apis/mlops/v1alpha1/server_types.go b/operator/apis/mlops/v1alpha1/server_types.go index 2a52d8d4c0..4072d43ebe 100644 --- a/operator/apis/mlops/v1alpha1/server_types.go +++ b/operator/apis/mlops/v1alpha1/server_types.go @@ -82,6 +82,8 @@ type ServerStatus struct { //+kubebuilder:printcolumn:name="Replicas",type=integer,JSONPath=`.status.replicas`,description="Number of replicas" //+kubebuilder:printcolumn:name="Loaded Models",type=integer,JSONPath=`.status.loadedModels`,description="Number of loaded models" //+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +//+genclient +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Server is the Schema for the servers API type Server struct { @@ -93,6 +95,7 @@ type Server struct { } //+kubebuilder:object:root=true +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ServerList contains a list of Server type ServerList struct { diff --git a/operator/apis/mlops/v1alpha1/serverconfig_types.go b/operator/apis/mlops/v1alpha1/serverconfig_types.go index f8a009d2b7..97b05b6757 100644 --- a/operator/apis/mlops/v1alpha1/serverconfig_types.go +++ b/operator/apis/mlops/v1alpha1/serverconfig_types.go @@ -46,6 +46,8 @@ type ServerConfigStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status //+kubebuilder:resource:shortName=mlc +//+genclient +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ServerConfig is the Schema for the serverconfigs API type ServerConfig struct { @@ -57,6 +59,7 @@ type ServerConfig struct { } //+kubebuilder:object:root=true +//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ServerConfigList contains a list of ServerConfig type ServerConfigList struct { diff --git a/operator/gen-k8s-client.sh b/operator/gen-k8s-client.sh new file mode 100755 index 0000000000..206e0c7e2d --- /dev/null +++ b/operator/gen-k8s-client.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Generates custom k8s client in ./pkg/generated/clientset/versioned for our CRs including watchers + +set -o errexit +set -o nounset +set -o pipefail + +ROOT_DIR="$(pwd)" +MODULE="github.com/seldonio/seldon-core/operator/v2" + +CODEGEN_PKG="${CODEGEN_PKG:-$(cd "${ROOT_DIR}" && go list -f '{{.Dir}}' -m k8s.io/code-generator)}" + +source "${CODEGEN_PKG}/kube_codegen.sh" + +kube::codegen::gen_client \ + --with-watch \ + --output-dir "${ROOT_DIR}/pkg/generated" \ + --output-pkg "${MODULE}/pkg/generated" \ + --boilerplate "${ROOT_DIR}/hack/boilerplate.go.txt" \ + "${ROOT_DIR}/apis" diff --git a/operator/go.mod b/operator/go.mod index 57e27f9977..c5a6630f5a 100644 --- a/operator/go.mod +++ b/operator/go.mod @@ -21,8 +21,8 @@ require ( github.com/seldonio/seldon-core/components/tls/v2 v2.9.1 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.6 - github.com/stretchr/testify v1.10.0 github.com/tidwall/gjson v1.18.0 + go.uber.org/mock v0.4.0 golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c google.golang.org/grpc v1.73.0 google.golang.org/protobuf v1.36.6 @@ -40,17 +40,17 @@ require ( github.com/fxamacker/cbor/v2 v2.8.0 // indirect github.com/google/btree v1.1.3 // indirect github.com/google/gnostic-models v0.7.0 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect github.com/x448/float16 v0.8.4 // indirect - go.uber.org/mock v0.4.0 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/mod v0.25.0 // indirect golang.org/x/sync v0.15.0 // indirect golang.org/x/tools v0.33.0 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect + k8s.io/code-generator v0.33.2 // indirect + k8s.io/gengo/v2 v2.0.0-20250207200755-1244d31929d7 // indirect sigs.k8s.io/randfill v1.0.0 // indirect ) @@ -107,7 +107,10 @@ require ( sigs.k8s.io/yaml v1.5.0 // indirect ) -tool go.uber.org/mock/mockgen +tool ( + go.uber.org/mock/mockgen + k8s.io/code-generator/cmd/client-gen +) replace github.com/seldonio/seldon-core/components/tls/v2 => ../components/tls diff --git a/operator/go.sum b/operator/go.sum index f02617d0cb..821c34f319 100644 --- a/operator/go.sum +++ b/operator/go.sum @@ -653,7 +653,11 @@ k8s.io/apimachinery v0.33.2 h1:IHFVhqg59mb8PJWTLi8m1mAoepkUNYmptHsV+Z1m5jY= k8s.io/apimachinery v0.33.2/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= k8s.io/client-go v0.33.2 h1:z8CIcc0P581x/J1ZYf4CNzRKxRvQAwoAolYPbtQes+E= k8s.io/client-go v0.33.2/go.mod h1:9mCgT4wROvL948w6f6ArJNb7yQd7QsvqavDeZHvNmHo= +k8s.io/code-generator v0.33.2 h1:PCJ0Y6viTCxxJHMOyGqYwWEteM4q6y1Hqo2rNpl6jF4= +k8s.io/code-generator v0.33.2/go.mod h1:hBjCA9kPMpjLWwxcr75ReaQfFXY8u+9bEJJ7kRw3J8c= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo/v2 v2.0.0-20250207200755-1244d31929d7 h1:2OX19X59HxDprNCVrWi6jb7LW1PoqTlYqEq5H2oetog= +k8s.io/gengo/v2 v2.0.0-20250207200755-1244d31929d7/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= diff --git a/operator/main.go b/operator/main.go index 2586ef781e..e454589f4e 100644 --- a/operator/main.go +++ b/operator/main.go @@ -6,7 +6,7 @@ Use of this software is governed by (2) if the license included in the LICENSE file is the Business Source License 1.1, the Change License after the Change Date as each is defined in accordance with the LICENSE file. */ - +//go:generate ./gen-k8s-client.sh package main import ( diff --git a/operator/pkg/generated/clientset/versioned/clientset.go b/operator/pkg/generated/clientset/versioned/clientset.go new file mode 100644 index 0000000000..a1cd68cbd2 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/clientset.go @@ -0,0 +1,112 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + fmt "fmt" + http "net/http" + + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/typed/mlops/v1alpha1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + MlopsV1alpha1() mlopsv1alpha1.MlopsV1alpha1Interface +} + +// Clientset contains the clients for groups. +type Clientset struct { + *discovery.DiscoveryClient + mlopsV1alpha1 *mlopsv1alpha1.MlopsV1alpha1Client +} + +// MlopsV1alpha1 retrieves the MlopsV1alpha1Client +func (c *Clientset) MlopsV1alpha1() mlopsv1alpha1.MlopsV1alpha1Interface { + return c.mlopsV1alpha1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.mlopsV1alpha1, err = mlopsv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.mlopsV1alpha1 = mlopsv1alpha1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/operator/pkg/generated/clientset/versioned/fake/clientset_generated.go b/operator/pkg/generated/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000000..9f23b2e4c6 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,86 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/typed/mlops/v1alpha1" + fakemlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// 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 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 { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + var opts metav1.ListOptions + if watchActcion, ok := action.(testing.WatchActionImpl); ok { + opts = watchActcion.ListOptions + } + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns, opts) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// MlopsV1alpha1 retrieves the MlopsV1alpha1Client +func (c *Clientset) MlopsV1alpha1() mlopsv1alpha1.MlopsV1alpha1Interface { + return &fakemlopsv1alpha1.FakeMlopsV1alpha1{Fake: &c.Fake} +} diff --git a/operator/pkg/generated/clientset/versioned/fake/doc.go b/operator/pkg/generated/clientset/versioned/fake/doc.go new file mode 100644 index 0000000000..8f27327bc9 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/fake/doc.go @@ -0,0 +1,12 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/operator/pkg/generated/clientset/versioned/fake/register.go b/operator/pkg/generated/clientset/versioned/fake/register.go new file mode 100644 index 0000000000..6c1371bdb9 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/fake/register.go @@ -0,0 +1,48 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + mlopsv1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/operator/pkg/generated/clientset/versioned/scheme/doc.go b/operator/pkg/generated/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000000..fb45f424a7 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/scheme/doc.go @@ -0,0 +1,12 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/operator/pkg/generated/clientset/versioned/scheme/register.go b/operator/pkg/generated/clientset/versioned/scheme/register.go new file mode 100644 index 0000000000..e64eb40b9b --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/scheme/register.go @@ -0,0 +1,48 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + mlopsv1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/doc.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/doc.go new file mode 100644 index 0000000000..47e0095b81 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/doc.go @@ -0,0 +1,12 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/experiment.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/experiment.go new file mode 100644 index 0000000000..63fc3205f1 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/experiment.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + scheme "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ExperimentsGetter has a method to return a ExperimentInterface. +// A group's client should implement this interface. +type ExperimentsGetter interface { + Experiments(namespace string) ExperimentInterface +} + +// ExperimentInterface has methods to work with Experiment resources. +type ExperimentInterface interface { + Create(ctx context.Context, experiment *mlopsv1alpha1.Experiment, opts v1.CreateOptions) (*mlopsv1alpha1.Experiment, error) + Update(ctx context.Context, experiment *mlopsv1alpha1.Experiment, opts v1.UpdateOptions) (*mlopsv1alpha1.Experiment, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, experiment *mlopsv1alpha1.Experiment, opts v1.UpdateOptions) (*mlopsv1alpha1.Experiment, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*mlopsv1alpha1.Experiment, error) + List(ctx context.Context, opts v1.ListOptions) (*mlopsv1alpha1.ExperimentList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *mlopsv1alpha1.Experiment, err error) + ExperimentExpansion +} + +// experiments implements ExperimentInterface +type experiments struct { + *gentype.ClientWithList[*mlopsv1alpha1.Experiment, *mlopsv1alpha1.ExperimentList] +} + +// newExperiments returns a Experiments +func newExperiments(c *MlopsV1alpha1Client, namespace string) *experiments { + return &experiments{ + gentype.NewClientWithList[*mlopsv1alpha1.Experiment, *mlopsv1alpha1.ExperimentList]( + "experiments", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *mlopsv1alpha1.Experiment { return &mlopsv1alpha1.Experiment{} }, + func() *mlopsv1alpha1.ExperimentList { return &mlopsv1alpha1.ExperimentList{} }, + ), + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/doc.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/doc.go new file mode 100644 index 0000000000..493a5c5473 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/doc.go @@ -0,0 +1,12 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_experiment.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_experiment.go new file mode 100644 index 0000000000..4d231bea66 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_experiment.go @@ -0,0 +1,42 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/typed/mlops/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeExperiments implements ExperimentInterface +type fakeExperiments struct { + *gentype.FakeClientWithList[*v1alpha1.Experiment, *v1alpha1.ExperimentList] + Fake *FakeMlopsV1alpha1 +} + +func newFakeExperiments(fake *FakeMlopsV1alpha1, namespace string) mlopsv1alpha1.ExperimentInterface { + return &fakeExperiments{ + gentype.NewFakeClientWithList[*v1alpha1.Experiment, *v1alpha1.ExperimentList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("experiments"), + v1alpha1.SchemeGroupVersion.WithKind("Experiment"), + func() *v1alpha1.Experiment { return &v1alpha1.Experiment{} }, + func() *v1alpha1.ExperimentList { return &v1alpha1.ExperimentList{} }, + func(dst, src *v1alpha1.ExperimentList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ExperimentList) []*v1alpha1.Experiment { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha1.ExperimentList, items []*v1alpha1.Experiment) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_mlops_client.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_mlops_client.go new file mode 100644 index 0000000000..257b98726f --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_mlops_client.go @@ -0,0 +1,56 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/typed/mlops/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeMlopsV1alpha1 struct { + *testing.Fake +} + +func (c *FakeMlopsV1alpha1) Experiments(namespace string) v1alpha1.ExperimentInterface { + return newFakeExperiments(c, namespace) +} + +func (c *FakeMlopsV1alpha1) Models(namespace string) v1alpha1.ModelInterface { + return newFakeModels(c, namespace) +} + +func (c *FakeMlopsV1alpha1) Pipelines(namespace string) v1alpha1.PipelineInterface { + return newFakePipelines(c, namespace) +} + +func (c *FakeMlopsV1alpha1) SeldonConfigs(namespace string) v1alpha1.SeldonConfigInterface { + return newFakeSeldonConfigs(c, namespace) +} + +func (c *FakeMlopsV1alpha1) SeldonRuntimes(namespace string) v1alpha1.SeldonRuntimeInterface { + return newFakeSeldonRuntimes(c, namespace) +} + +func (c *FakeMlopsV1alpha1) Servers(namespace string) v1alpha1.ServerInterface { + return newFakeServers(c, namespace) +} + +func (c *FakeMlopsV1alpha1) ServerConfigs(namespace string) v1alpha1.ServerConfigInterface { + return newFakeServerConfigs(c, namespace) +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeMlopsV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_model.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_model.go new file mode 100644 index 0000000000..409c46be21 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_model.go @@ -0,0 +1,40 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/typed/mlops/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeModels implements ModelInterface +type fakeModels struct { + *gentype.FakeClientWithList[*v1alpha1.Model, *v1alpha1.ModelList] + Fake *FakeMlopsV1alpha1 +} + +func newFakeModels(fake *FakeMlopsV1alpha1, namespace string) mlopsv1alpha1.ModelInterface { + return &fakeModels{ + gentype.NewFakeClientWithList[*v1alpha1.Model, *v1alpha1.ModelList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("models"), + v1alpha1.SchemeGroupVersion.WithKind("Model"), + func() *v1alpha1.Model { return &v1alpha1.Model{} }, + func() *v1alpha1.ModelList { return &v1alpha1.ModelList{} }, + func(dst, src *v1alpha1.ModelList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ModelList) []*v1alpha1.Model { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha1.ModelList, items []*v1alpha1.Model) { list.Items = gentype.FromPointerSlice(items) }, + ), + fake, + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_pipeline.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_pipeline.go new file mode 100644 index 0000000000..6db29a6749 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_pipeline.go @@ -0,0 +1,42 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/typed/mlops/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakePipelines implements PipelineInterface +type fakePipelines struct { + *gentype.FakeClientWithList[*v1alpha1.Pipeline, *v1alpha1.PipelineList] + Fake *FakeMlopsV1alpha1 +} + +func newFakePipelines(fake *FakeMlopsV1alpha1, namespace string) mlopsv1alpha1.PipelineInterface { + return &fakePipelines{ + gentype.NewFakeClientWithList[*v1alpha1.Pipeline, *v1alpha1.PipelineList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("pipelines"), + v1alpha1.SchemeGroupVersion.WithKind("Pipeline"), + func() *v1alpha1.Pipeline { return &v1alpha1.Pipeline{} }, + func() *v1alpha1.PipelineList { return &v1alpha1.PipelineList{} }, + func(dst, src *v1alpha1.PipelineList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.PipelineList) []*v1alpha1.Pipeline { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha1.PipelineList, items []*v1alpha1.Pipeline) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_seldonconfig.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_seldonconfig.go new file mode 100644 index 0000000000..783cd217be --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_seldonconfig.go @@ -0,0 +1,44 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/typed/mlops/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeSeldonConfigs implements SeldonConfigInterface +type fakeSeldonConfigs struct { + *gentype.FakeClientWithList[*v1alpha1.SeldonConfig, *v1alpha1.SeldonConfigList] + Fake *FakeMlopsV1alpha1 +} + +func newFakeSeldonConfigs(fake *FakeMlopsV1alpha1, namespace string) mlopsv1alpha1.SeldonConfigInterface { + return &fakeSeldonConfigs{ + gentype.NewFakeClientWithList[*v1alpha1.SeldonConfig, *v1alpha1.SeldonConfigList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("seldonconfigs"), + v1alpha1.SchemeGroupVersion.WithKind("SeldonConfig"), + func() *v1alpha1.SeldonConfig { return &v1alpha1.SeldonConfig{} }, + func() *v1alpha1.SeldonConfigList { return &v1alpha1.SeldonConfigList{} }, + func(dst, src *v1alpha1.SeldonConfigList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.SeldonConfigList) []*v1alpha1.SeldonConfig { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.SeldonConfigList, items []*v1alpha1.SeldonConfig) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_seldonruntime.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_seldonruntime.go new file mode 100644 index 0000000000..a730d6b666 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_seldonruntime.go @@ -0,0 +1,44 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/typed/mlops/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeSeldonRuntimes implements SeldonRuntimeInterface +type fakeSeldonRuntimes struct { + *gentype.FakeClientWithList[*v1alpha1.SeldonRuntime, *v1alpha1.SeldonRuntimeList] + Fake *FakeMlopsV1alpha1 +} + +func newFakeSeldonRuntimes(fake *FakeMlopsV1alpha1, namespace string) mlopsv1alpha1.SeldonRuntimeInterface { + return &fakeSeldonRuntimes{ + gentype.NewFakeClientWithList[*v1alpha1.SeldonRuntime, *v1alpha1.SeldonRuntimeList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("seldonruntimes"), + v1alpha1.SchemeGroupVersion.WithKind("SeldonRuntime"), + func() *v1alpha1.SeldonRuntime { return &v1alpha1.SeldonRuntime{} }, + func() *v1alpha1.SeldonRuntimeList { return &v1alpha1.SeldonRuntimeList{} }, + func(dst, src *v1alpha1.SeldonRuntimeList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.SeldonRuntimeList) []*v1alpha1.SeldonRuntime { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.SeldonRuntimeList, items []*v1alpha1.SeldonRuntime) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_server.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_server.go new file mode 100644 index 0000000000..d5b72c4015 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_server.go @@ -0,0 +1,42 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/typed/mlops/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeServers implements ServerInterface +type fakeServers struct { + *gentype.FakeClientWithList[*v1alpha1.Server, *v1alpha1.ServerList] + Fake *FakeMlopsV1alpha1 +} + +func newFakeServers(fake *FakeMlopsV1alpha1, namespace string) mlopsv1alpha1.ServerInterface { + return &fakeServers{ + gentype.NewFakeClientWithList[*v1alpha1.Server, *v1alpha1.ServerList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("servers"), + v1alpha1.SchemeGroupVersion.WithKind("Server"), + func() *v1alpha1.Server { return &v1alpha1.Server{} }, + func() *v1alpha1.ServerList { return &v1alpha1.ServerList{} }, + func(dst, src *v1alpha1.ServerList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ServerList) []*v1alpha1.Server { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha1.ServerList, items []*v1alpha1.Server) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_serverconfig.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_serverconfig.go new file mode 100644 index 0000000000..9476854d13 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/fake/fake_serverconfig.go @@ -0,0 +1,44 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/typed/mlops/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeServerConfigs implements ServerConfigInterface +type fakeServerConfigs struct { + *gentype.FakeClientWithList[*v1alpha1.ServerConfig, *v1alpha1.ServerConfigList] + Fake *FakeMlopsV1alpha1 +} + +func newFakeServerConfigs(fake *FakeMlopsV1alpha1, namespace string) mlopsv1alpha1.ServerConfigInterface { + return &fakeServerConfigs{ + gentype.NewFakeClientWithList[*v1alpha1.ServerConfig, *v1alpha1.ServerConfigList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("serverconfigs"), + v1alpha1.SchemeGroupVersion.WithKind("ServerConfig"), + func() *v1alpha1.ServerConfig { return &v1alpha1.ServerConfig{} }, + func() *v1alpha1.ServerConfigList { return &v1alpha1.ServerConfigList{} }, + func(dst, src *v1alpha1.ServerConfigList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ServerConfigList) []*v1alpha1.ServerConfig { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ServerConfigList, items []*v1alpha1.ServerConfig) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/generated_expansion.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/generated_expansion.go new file mode 100644 index 0000000000..a41ca1ba29 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/generated_expansion.go @@ -0,0 +1,25 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type ExperimentExpansion interface{} + +type ModelExpansion interface{} + +type PipelineExpansion interface{} + +type SeldonConfigExpansion interface{} + +type SeldonRuntimeExpansion interface{} + +type ServerExpansion interface{} + +type ServerConfigExpansion interface{} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/mlops_client.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/mlops_client.go new file mode 100644 index 0000000000..9e8c04a076 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/mlops_client.go @@ -0,0 +1,123 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + http "net/http" + + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + scheme "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type MlopsV1alpha1Interface interface { + RESTClient() rest.Interface + ExperimentsGetter + ModelsGetter + PipelinesGetter + SeldonConfigsGetter + SeldonRuntimesGetter + ServersGetter + ServerConfigsGetter +} + +// MlopsV1alpha1Client is used to interact with features provided by the mlops.seldon.io/v1alpha1 group. +type MlopsV1alpha1Client struct { + restClient rest.Interface +} + +func (c *MlopsV1alpha1Client) Experiments(namespace string) ExperimentInterface { + return newExperiments(c, namespace) +} + +func (c *MlopsV1alpha1Client) Models(namespace string) ModelInterface { + return newModels(c, namespace) +} + +func (c *MlopsV1alpha1Client) Pipelines(namespace string) PipelineInterface { + return newPipelines(c, namespace) +} + +func (c *MlopsV1alpha1Client) SeldonConfigs(namespace string) SeldonConfigInterface { + return newSeldonConfigs(c, namespace) +} + +func (c *MlopsV1alpha1Client) SeldonRuntimes(namespace string) SeldonRuntimeInterface { + return newSeldonRuntimes(c, namespace) +} + +func (c *MlopsV1alpha1Client) Servers(namespace string) ServerInterface { + return newServers(c, namespace) +} + +func (c *MlopsV1alpha1Client) ServerConfigs(namespace string) ServerConfigInterface { + return newServerConfigs(c, namespace) +} + +// NewForConfig creates a new MlopsV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*MlopsV1alpha1Client, error) { + config := *c + setConfigDefaults(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new MlopsV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*MlopsV1alpha1Client, error) { + config := *c + setConfigDefaults(&config) + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &MlopsV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new MlopsV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *MlopsV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new MlopsV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *MlopsV1alpha1Client { + return &MlopsV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) { + gv := mlopsv1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *MlopsV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/model.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/model.go new file mode 100644 index 0000000000..32ade9ee85 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/model.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + scheme "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ModelsGetter has a method to return a ModelInterface. +// A group's client should implement this interface. +type ModelsGetter interface { + Models(namespace string) ModelInterface +} + +// ModelInterface has methods to work with Model resources. +type ModelInterface interface { + Create(ctx context.Context, model *mlopsv1alpha1.Model, opts v1.CreateOptions) (*mlopsv1alpha1.Model, error) + Update(ctx context.Context, model *mlopsv1alpha1.Model, opts v1.UpdateOptions) (*mlopsv1alpha1.Model, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, model *mlopsv1alpha1.Model, opts v1.UpdateOptions) (*mlopsv1alpha1.Model, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*mlopsv1alpha1.Model, error) + List(ctx context.Context, opts v1.ListOptions) (*mlopsv1alpha1.ModelList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *mlopsv1alpha1.Model, err error) + ModelExpansion +} + +// models implements ModelInterface +type models struct { + *gentype.ClientWithList[*mlopsv1alpha1.Model, *mlopsv1alpha1.ModelList] +} + +// newModels returns a Models +func newModels(c *MlopsV1alpha1Client, namespace string) *models { + return &models{ + gentype.NewClientWithList[*mlopsv1alpha1.Model, *mlopsv1alpha1.ModelList]( + "models", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *mlopsv1alpha1.Model { return &mlopsv1alpha1.Model{} }, + func() *mlopsv1alpha1.ModelList { return &mlopsv1alpha1.ModelList{} }, + ), + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/pipeline.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/pipeline.go new file mode 100644 index 0000000000..494d247649 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/pipeline.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + scheme "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// PipelinesGetter has a method to return a PipelineInterface. +// A group's client should implement this interface. +type PipelinesGetter interface { + Pipelines(namespace string) PipelineInterface +} + +// PipelineInterface has methods to work with Pipeline resources. +type PipelineInterface interface { + Create(ctx context.Context, pipeline *mlopsv1alpha1.Pipeline, opts v1.CreateOptions) (*mlopsv1alpha1.Pipeline, error) + Update(ctx context.Context, pipeline *mlopsv1alpha1.Pipeline, opts v1.UpdateOptions) (*mlopsv1alpha1.Pipeline, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, pipeline *mlopsv1alpha1.Pipeline, opts v1.UpdateOptions) (*mlopsv1alpha1.Pipeline, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*mlopsv1alpha1.Pipeline, error) + List(ctx context.Context, opts v1.ListOptions) (*mlopsv1alpha1.PipelineList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *mlopsv1alpha1.Pipeline, err error) + PipelineExpansion +} + +// pipelines implements PipelineInterface +type pipelines struct { + *gentype.ClientWithList[*mlopsv1alpha1.Pipeline, *mlopsv1alpha1.PipelineList] +} + +// newPipelines returns a Pipelines +func newPipelines(c *MlopsV1alpha1Client, namespace string) *pipelines { + return &pipelines{ + gentype.NewClientWithList[*mlopsv1alpha1.Pipeline, *mlopsv1alpha1.PipelineList]( + "pipelines", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *mlopsv1alpha1.Pipeline { return &mlopsv1alpha1.Pipeline{} }, + func() *mlopsv1alpha1.PipelineList { return &mlopsv1alpha1.PipelineList{} }, + ), + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/seldonconfig.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/seldonconfig.go new file mode 100644 index 0000000000..d16a92153e --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/seldonconfig.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + scheme "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// SeldonConfigsGetter has a method to return a SeldonConfigInterface. +// A group's client should implement this interface. +type SeldonConfigsGetter interface { + SeldonConfigs(namespace string) SeldonConfigInterface +} + +// SeldonConfigInterface has methods to work with SeldonConfig resources. +type SeldonConfigInterface interface { + Create(ctx context.Context, seldonConfig *mlopsv1alpha1.SeldonConfig, opts v1.CreateOptions) (*mlopsv1alpha1.SeldonConfig, error) + Update(ctx context.Context, seldonConfig *mlopsv1alpha1.SeldonConfig, opts v1.UpdateOptions) (*mlopsv1alpha1.SeldonConfig, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, seldonConfig *mlopsv1alpha1.SeldonConfig, opts v1.UpdateOptions) (*mlopsv1alpha1.SeldonConfig, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*mlopsv1alpha1.SeldonConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*mlopsv1alpha1.SeldonConfigList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *mlopsv1alpha1.SeldonConfig, err error) + SeldonConfigExpansion +} + +// seldonConfigs implements SeldonConfigInterface +type seldonConfigs struct { + *gentype.ClientWithList[*mlopsv1alpha1.SeldonConfig, *mlopsv1alpha1.SeldonConfigList] +} + +// newSeldonConfigs returns a SeldonConfigs +func newSeldonConfigs(c *MlopsV1alpha1Client, namespace string) *seldonConfigs { + return &seldonConfigs{ + gentype.NewClientWithList[*mlopsv1alpha1.SeldonConfig, *mlopsv1alpha1.SeldonConfigList]( + "seldonconfigs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *mlopsv1alpha1.SeldonConfig { return &mlopsv1alpha1.SeldonConfig{} }, + func() *mlopsv1alpha1.SeldonConfigList { return &mlopsv1alpha1.SeldonConfigList{} }, + ), + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/seldonruntime.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/seldonruntime.go new file mode 100644 index 0000000000..0114d56c1b --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/seldonruntime.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + scheme "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// SeldonRuntimesGetter has a method to return a SeldonRuntimeInterface. +// A group's client should implement this interface. +type SeldonRuntimesGetter interface { + SeldonRuntimes(namespace string) SeldonRuntimeInterface +} + +// SeldonRuntimeInterface has methods to work with SeldonRuntime resources. +type SeldonRuntimeInterface interface { + Create(ctx context.Context, seldonRuntime *mlopsv1alpha1.SeldonRuntime, opts v1.CreateOptions) (*mlopsv1alpha1.SeldonRuntime, error) + Update(ctx context.Context, seldonRuntime *mlopsv1alpha1.SeldonRuntime, opts v1.UpdateOptions) (*mlopsv1alpha1.SeldonRuntime, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, seldonRuntime *mlopsv1alpha1.SeldonRuntime, opts v1.UpdateOptions) (*mlopsv1alpha1.SeldonRuntime, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*mlopsv1alpha1.SeldonRuntime, error) + List(ctx context.Context, opts v1.ListOptions) (*mlopsv1alpha1.SeldonRuntimeList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *mlopsv1alpha1.SeldonRuntime, err error) + SeldonRuntimeExpansion +} + +// seldonRuntimes implements SeldonRuntimeInterface +type seldonRuntimes struct { + *gentype.ClientWithList[*mlopsv1alpha1.SeldonRuntime, *mlopsv1alpha1.SeldonRuntimeList] +} + +// newSeldonRuntimes returns a SeldonRuntimes +func newSeldonRuntimes(c *MlopsV1alpha1Client, namespace string) *seldonRuntimes { + return &seldonRuntimes{ + gentype.NewClientWithList[*mlopsv1alpha1.SeldonRuntime, *mlopsv1alpha1.SeldonRuntimeList]( + "seldonruntimes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *mlopsv1alpha1.SeldonRuntime { return &mlopsv1alpha1.SeldonRuntime{} }, + func() *mlopsv1alpha1.SeldonRuntimeList { return &mlopsv1alpha1.SeldonRuntimeList{} }, + ), + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/server.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/server.go new file mode 100644 index 0000000000..e42e45a557 --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/server.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + scheme "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ServersGetter has a method to return a ServerInterface. +// A group's client should implement this interface. +type ServersGetter interface { + Servers(namespace string) ServerInterface +} + +// ServerInterface has methods to work with Server resources. +type ServerInterface interface { + Create(ctx context.Context, server *mlopsv1alpha1.Server, opts v1.CreateOptions) (*mlopsv1alpha1.Server, error) + Update(ctx context.Context, server *mlopsv1alpha1.Server, opts v1.UpdateOptions) (*mlopsv1alpha1.Server, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, server *mlopsv1alpha1.Server, opts v1.UpdateOptions) (*mlopsv1alpha1.Server, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*mlopsv1alpha1.Server, error) + List(ctx context.Context, opts v1.ListOptions) (*mlopsv1alpha1.ServerList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *mlopsv1alpha1.Server, err error) + ServerExpansion +} + +// servers implements ServerInterface +type servers struct { + *gentype.ClientWithList[*mlopsv1alpha1.Server, *mlopsv1alpha1.ServerList] +} + +// newServers returns a Servers +func newServers(c *MlopsV1alpha1Client, namespace string) *servers { + return &servers{ + gentype.NewClientWithList[*mlopsv1alpha1.Server, *mlopsv1alpha1.ServerList]( + "servers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *mlopsv1alpha1.Server { return &mlopsv1alpha1.Server{} }, + func() *mlopsv1alpha1.ServerList { return &mlopsv1alpha1.ServerList{} }, + ), + } +} diff --git a/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/serverconfig.go b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/serverconfig.go new file mode 100644 index 0000000000..be7251f62c --- /dev/null +++ b/operator/pkg/generated/clientset/versioned/typed/mlops/v1alpha1/serverconfig.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + scheme "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ServerConfigsGetter has a method to return a ServerConfigInterface. +// A group's client should implement this interface. +type ServerConfigsGetter interface { + ServerConfigs(namespace string) ServerConfigInterface +} + +// ServerConfigInterface has methods to work with ServerConfig resources. +type ServerConfigInterface interface { + Create(ctx context.Context, serverConfig *mlopsv1alpha1.ServerConfig, opts v1.CreateOptions) (*mlopsv1alpha1.ServerConfig, error) + Update(ctx context.Context, serverConfig *mlopsv1alpha1.ServerConfig, opts v1.UpdateOptions) (*mlopsv1alpha1.ServerConfig, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, serverConfig *mlopsv1alpha1.ServerConfig, opts v1.UpdateOptions) (*mlopsv1alpha1.ServerConfig, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*mlopsv1alpha1.ServerConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*mlopsv1alpha1.ServerConfigList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *mlopsv1alpha1.ServerConfig, err error) + ServerConfigExpansion +} + +// serverConfigs implements ServerConfigInterface +type serverConfigs struct { + *gentype.ClientWithList[*mlopsv1alpha1.ServerConfig, *mlopsv1alpha1.ServerConfigList] +} + +// newServerConfigs returns a ServerConfigs +func newServerConfigs(c *MlopsV1alpha1Client, namespace string) *serverConfigs { + return &serverConfigs{ + gentype.NewClientWithList[*mlopsv1alpha1.ServerConfig, *mlopsv1alpha1.ServerConfigList]( + "serverconfigs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *mlopsv1alpha1.ServerConfig { return &mlopsv1alpha1.ServerConfig{} }, + func() *mlopsv1alpha1.ServerConfigList { return &mlopsv1alpha1.ServerConfigList{} }, + ), + } +} diff --git a/operator/pkg/generated/informers/externalversions/factory.go b/operator/pkg/generated/informers/externalversions/factory.go new file mode 100644 index 0000000000..fee13b7edb --- /dev/null +++ b/operator/pkg/generated/informers/externalversions/factory.go @@ -0,0 +1,254 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + versioned "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/seldonio/seldon-core/operator/v2/pkg/generated/informers/externalversions/internalinterfaces" + mlops "github.com/seldonio/seldon-core/operator/v2/pkg/generated/informers/externalversions/mlops" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + transform cache.TransformFunc + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.transform = transform + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + if f.shuttingDown { + return + } + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() + f.startedInformers[informerType] = true + } + } +} + +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + informer.SetTransform(f.transform) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + + // 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 + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + + Mlops() mlops.Interface +} + +func (f *sharedInformerFactory) Mlops() mlops.Interface { + return mlops.New(f, f.namespace, f.tweakListOptions) +} diff --git a/operator/pkg/generated/informers/externalversions/generic.go b/operator/pkg/generated/informers/externalversions/generic.go new file mode 100644 index 0000000000..fb26a764f2 --- /dev/null +++ b/operator/pkg/generated/informers/externalversions/generic.go @@ -0,0 +1,66 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + fmt "fmt" + + v1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=mlops.seldon.io/v1alpha1, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("experiments"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Mlops().V1alpha1().Experiments().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("models"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Mlops().V1alpha1().Models().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("pipelines"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Mlops().V1alpha1().Pipelines().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("seldonconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Mlops().V1alpha1().SeldonConfigs().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("seldonruntimes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Mlops().V1alpha1().SeldonRuntimes().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("servers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Mlops().V1alpha1().Servers().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("serverconfigs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Mlops().V1alpha1().ServerConfigs().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/operator/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/operator/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000000..7378047b99 --- /dev/null +++ b/operator/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,32 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + versioned "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/operator/pkg/generated/informers/externalversions/mlops/interface.go b/operator/pkg/generated/informers/externalversions/mlops/interface.go new file mode 100644 index 0000000000..78d7e977b5 --- /dev/null +++ b/operator/pkg/generated/informers/externalversions/mlops/interface.go @@ -0,0 +1,38 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package mlops + +import ( + internalinterfaces "github.com/seldonio/seldon-core/operator/v2/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/informers/externalversions/mlops/v1alpha1" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/experiment.go b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/experiment.go new file mode 100644 index 0000000000..aa9e47f097 --- /dev/null +++ b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/experiment.go @@ -0,0 +1,94 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + apismlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + versioned "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/seldonio/seldon-core/operator/v2/pkg/generated/informers/externalversions/internalinterfaces" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/listers/mlops/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ExperimentInformer provides access to a shared informer and lister for +// Experiments. +type ExperimentInformer interface { + Informer() cache.SharedIndexInformer + Lister() mlopsv1alpha1.ExperimentLister +} + +type experimentInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewExperimentInformer constructs a new informer for Experiment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewExperimentInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExperimentInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredExperimentInformer constructs a new informer for Experiment type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredExperimentInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Experiments(namespace).List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Experiments(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Experiments(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Experiments(namespace).Watch(ctx, options) + }, + }, + &apismlopsv1alpha1.Experiment{}, + resyncPeriod, + indexers, + ) +} + +func (f *experimentInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExperimentInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *experimentInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apismlopsv1alpha1.Experiment{}, f.defaultInformer) +} + +func (f *experimentInformer) Lister() mlopsv1alpha1.ExperimentLister { + return mlopsv1alpha1.NewExperimentLister(f.Informer().GetIndexer()) +} diff --git a/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/interface.go b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/interface.go new file mode 100644 index 0000000000..66ae289438 --- /dev/null +++ b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/interface.go @@ -0,0 +1,79 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "github.com/seldonio/seldon-core/operator/v2/pkg/generated/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // Experiments returns a ExperimentInformer. + Experiments() ExperimentInformer + // Models returns a ModelInformer. + Models() ModelInformer + // Pipelines returns a PipelineInformer. + Pipelines() PipelineInformer + // SeldonConfigs returns a SeldonConfigInformer. + SeldonConfigs() SeldonConfigInformer + // SeldonRuntimes returns a SeldonRuntimeInformer. + SeldonRuntimes() SeldonRuntimeInformer + // Servers returns a ServerInformer. + Servers() ServerInformer + // ServerConfigs returns a ServerConfigInformer. + ServerConfigs() ServerConfigInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// Experiments returns a ExperimentInformer. +func (v *version) Experiments() ExperimentInformer { + return &experimentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Models returns a ModelInformer. +func (v *version) Models() ModelInformer { + return &modelInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Pipelines returns a PipelineInformer. +func (v *version) Pipelines() PipelineInformer { + return &pipelineInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// SeldonConfigs returns a SeldonConfigInformer. +func (v *version) SeldonConfigs() SeldonConfigInformer { + return &seldonConfigInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// SeldonRuntimes returns a SeldonRuntimeInformer. +func (v *version) SeldonRuntimes() SeldonRuntimeInformer { + return &seldonRuntimeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Servers returns a ServerInformer. +func (v *version) Servers() ServerInformer { + return &serverInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ServerConfigs returns a ServerConfigInformer. +func (v *version) ServerConfigs() ServerConfigInformer { + return &serverConfigInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/model.go b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/model.go new file mode 100644 index 0000000000..169df0edc2 --- /dev/null +++ b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/model.go @@ -0,0 +1,94 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + apismlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + versioned "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/seldonio/seldon-core/operator/v2/pkg/generated/informers/externalversions/internalinterfaces" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/listers/mlops/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ModelInformer provides access to a shared informer and lister for +// Models. +type ModelInformer interface { + Informer() cache.SharedIndexInformer + Lister() mlopsv1alpha1.ModelLister +} + +type modelInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewModelInformer constructs a new informer for Model type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewModelInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredModelInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredModelInformer constructs a new informer for Model type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredModelInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Models(namespace).List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Models(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Models(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Models(namespace).Watch(ctx, options) + }, + }, + &apismlopsv1alpha1.Model{}, + resyncPeriod, + indexers, + ) +} + +func (f *modelInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredModelInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *modelInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apismlopsv1alpha1.Model{}, f.defaultInformer) +} + +func (f *modelInformer) Lister() mlopsv1alpha1.ModelLister { + return mlopsv1alpha1.NewModelLister(f.Informer().GetIndexer()) +} diff --git a/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/pipeline.go b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/pipeline.go new file mode 100644 index 0000000000..815c3d4aae --- /dev/null +++ b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/pipeline.go @@ -0,0 +1,94 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + apismlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + versioned "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/seldonio/seldon-core/operator/v2/pkg/generated/informers/externalversions/internalinterfaces" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/listers/mlops/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// PipelineInformer provides access to a shared informer and lister for +// Pipelines. +type PipelineInformer interface { + Informer() cache.SharedIndexInformer + Lister() mlopsv1alpha1.PipelineLister +} + +type pipelineInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewPipelineInformer constructs a new informer for Pipeline type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewPipelineInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPipelineInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredPipelineInformer constructs a new informer for Pipeline type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredPipelineInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Pipelines(namespace).List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Pipelines(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Pipelines(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Pipelines(namespace).Watch(ctx, options) + }, + }, + &apismlopsv1alpha1.Pipeline{}, + resyncPeriod, + indexers, + ) +} + +func (f *pipelineInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPipelineInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *pipelineInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apismlopsv1alpha1.Pipeline{}, f.defaultInformer) +} + +func (f *pipelineInformer) Lister() mlopsv1alpha1.PipelineLister { + return mlopsv1alpha1.NewPipelineLister(f.Informer().GetIndexer()) +} diff --git a/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/seldonconfig.go b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/seldonconfig.go new file mode 100644 index 0000000000..b5470e94f5 --- /dev/null +++ b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/seldonconfig.go @@ -0,0 +1,94 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + apismlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + versioned "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/seldonio/seldon-core/operator/v2/pkg/generated/informers/externalversions/internalinterfaces" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/listers/mlops/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SeldonConfigInformer provides access to a shared informer and lister for +// SeldonConfigs. +type SeldonConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() mlopsv1alpha1.SeldonConfigLister +} + +type seldonConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewSeldonConfigInformer constructs a new informer for SeldonConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSeldonConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSeldonConfigInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredSeldonConfigInformer constructs a new informer for SeldonConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSeldonConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().SeldonConfigs(namespace).List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().SeldonConfigs(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().SeldonConfigs(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().SeldonConfigs(namespace).Watch(ctx, options) + }, + }, + &apismlopsv1alpha1.SeldonConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *seldonConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSeldonConfigInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *seldonConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apismlopsv1alpha1.SeldonConfig{}, f.defaultInformer) +} + +func (f *seldonConfigInformer) Lister() mlopsv1alpha1.SeldonConfigLister { + return mlopsv1alpha1.NewSeldonConfigLister(f.Informer().GetIndexer()) +} diff --git a/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/seldonruntime.go b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/seldonruntime.go new file mode 100644 index 0000000000..3d98152fe3 --- /dev/null +++ b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/seldonruntime.go @@ -0,0 +1,94 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + apismlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + versioned "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/seldonio/seldon-core/operator/v2/pkg/generated/informers/externalversions/internalinterfaces" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/listers/mlops/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SeldonRuntimeInformer provides access to a shared informer and lister for +// SeldonRuntimes. +type SeldonRuntimeInformer interface { + Informer() cache.SharedIndexInformer + Lister() mlopsv1alpha1.SeldonRuntimeLister +} + +type seldonRuntimeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewSeldonRuntimeInformer constructs a new informer for SeldonRuntime type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSeldonRuntimeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSeldonRuntimeInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredSeldonRuntimeInformer constructs a new informer for SeldonRuntime type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSeldonRuntimeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().SeldonRuntimes(namespace).List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().SeldonRuntimes(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().SeldonRuntimes(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().SeldonRuntimes(namespace).Watch(ctx, options) + }, + }, + &apismlopsv1alpha1.SeldonRuntime{}, + resyncPeriod, + indexers, + ) +} + +func (f *seldonRuntimeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSeldonRuntimeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *seldonRuntimeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apismlopsv1alpha1.SeldonRuntime{}, f.defaultInformer) +} + +func (f *seldonRuntimeInformer) Lister() mlopsv1alpha1.SeldonRuntimeLister { + return mlopsv1alpha1.NewSeldonRuntimeLister(f.Informer().GetIndexer()) +} diff --git a/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/server.go b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/server.go new file mode 100644 index 0000000000..0b8689c260 --- /dev/null +++ b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/server.go @@ -0,0 +1,94 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + apismlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + versioned "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/seldonio/seldon-core/operator/v2/pkg/generated/informers/externalversions/internalinterfaces" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/listers/mlops/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServerInformer provides access to a shared informer and lister for +// Servers. +type ServerInformer interface { + Informer() cache.SharedIndexInformer + Lister() mlopsv1alpha1.ServerLister +} + +type serverInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewServerInformer constructs a new informer for Server type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServerInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredServerInformer constructs a new informer for Server type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Servers(namespace).List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Servers(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Servers(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().Servers(namespace).Watch(ctx, options) + }, + }, + &apismlopsv1alpha1.Server{}, + resyncPeriod, + indexers, + ) +} + +func (f *serverInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serverInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apismlopsv1alpha1.Server{}, f.defaultInformer) +} + +func (f *serverInformer) Lister() mlopsv1alpha1.ServerLister { + return mlopsv1alpha1.NewServerLister(f.Informer().GetIndexer()) +} diff --git a/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/serverconfig.go b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/serverconfig.go new file mode 100644 index 0000000000..ce479d84d3 --- /dev/null +++ b/operator/pkg/generated/informers/externalversions/mlops/v1alpha1/serverconfig.go @@ -0,0 +1,94 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + apismlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + versioned "github.com/seldonio/seldon-core/operator/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/seldonio/seldon-core/operator/v2/pkg/generated/informers/externalversions/internalinterfaces" + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/pkg/generated/listers/mlops/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServerConfigInformer provides access to a shared informer and lister for +// ServerConfigs. +type ServerConfigInformer interface { + Informer() cache.SharedIndexInformer + Lister() mlopsv1alpha1.ServerConfigLister +} + +type serverConfigInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewServerConfigInformer constructs a new informer for ServerConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServerConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServerConfigInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredServerConfigInformer constructs a new informer for ServerConfig type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServerConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().ServerConfigs(namespace).List(context.Background(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().ServerConfigs(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().ServerConfigs(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MlopsV1alpha1().ServerConfigs(namespace).Watch(ctx, options) + }, + }, + &apismlopsv1alpha1.ServerConfig{}, + resyncPeriod, + indexers, + ) +} + +func (f *serverConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServerConfigInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serverConfigInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apismlopsv1alpha1.ServerConfig{}, f.defaultInformer) +} + +func (f *serverConfigInformer) Lister() mlopsv1alpha1.ServerConfigLister { + return mlopsv1alpha1.NewServerConfigLister(f.Informer().GetIndexer()) +} diff --git a/operator/pkg/generated/listers/mlops/v1alpha1/expansion_generated.go b/operator/pkg/generated/listers/mlops/v1alpha1/expansion_generated.go new file mode 100644 index 0000000000..801ad1ef08 --- /dev/null +++ b/operator/pkg/generated/listers/mlops/v1alpha1/expansion_generated.go @@ -0,0 +1,67 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// ExperimentListerExpansion allows custom methods to be added to +// ExperimentLister. +type ExperimentListerExpansion interface{} + +// ExperimentNamespaceListerExpansion allows custom methods to be added to +// ExperimentNamespaceLister. +type ExperimentNamespaceListerExpansion interface{} + +// ModelListerExpansion allows custom methods to be added to +// ModelLister. +type ModelListerExpansion interface{} + +// ModelNamespaceListerExpansion allows custom methods to be added to +// ModelNamespaceLister. +type ModelNamespaceListerExpansion interface{} + +// PipelineListerExpansion allows custom methods to be added to +// PipelineLister. +type PipelineListerExpansion interface{} + +// PipelineNamespaceListerExpansion allows custom methods to be added to +// PipelineNamespaceLister. +type PipelineNamespaceListerExpansion interface{} + +// SeldonConfigListerExpansion allows custom methods to be added to +// SeldonConfigLister. +type SeldonConfigListerExpansion interface{} + +// SeldonConfigNamespaceListerExpansion allows custom methods to be added to +// SeldonConfigNamespaceLister. +type SeldonConfigNamespaceListerExpansion interface{} + +// SeldonRuntimeListerExpansion allows custom methods to be added to +// SeldonRuntimeLister. +type SeldonRuntimeListerExpansion interface{} + +// SeldonRuntimeNamespaceListerExpansion allows custom methods to be added to +// SeldonRuntimeNamespaceLister. +type SeldonRuntimeNamespaceListerExpansion interface{} + +// ServerListerExpansion allows custom methods to be added to +// ServerLister. +type ServerListerExpansion interface{} + +// ServerNamespaceListerExpansion allows custom methods to be added to +// ServerNamespaceLister. +type ServerNamespaceListerExpansion interface{} + +// ServerConfigListerExpansion allows custom methods to be added to +// ServerConfigLister. +type ServerConfigListerExpansion interface{} + +// ServerConfigNamespaceListerExpansion allows custom methods to be added to +// ServerConfigNamespaceLister. +type ServerConfigNamespaceListerExpansion interface{} diff --git a/operator/pkg/generated/listers/mlops/v1alpha1/experiment.go b/operator/pkg/generated/listers/mlops/v1alpha1/experiment.go new file mode 100644 index 0000000000..1f0353cac6 --- /dev/null +++ b/operator/pkg/generated/listers/mlops/v1alpha1/experiment.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// ExperimentLister helps list Experiments. +// All objects returned here must be treated as read-only. +type ExperimentLister interface { + // List lists all Experiments in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.Experiment, err error) + // Experiments returns an object that can list and get Experiments. + Experiments(namespace string) ExperimentNamespaceLister + ExperimentListerExpansion +} + +// experimentLister implements the ExperimentLister interface. +type experimentLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.Experiment] +} + +// NewExperimentLister returns a new ExperimentLister. +func NewExperimentLister(indexer cache.Indexer) ExperimentLister { + return &experimentLister{listers.New[*mlopsv1alpha1.Experiment](indexer, mlopsv1alpha1.Resource("experiment"))} +} + +// Experiments returns an object that can list and get Experiments. +func (s *experimentLister) Experiments(namespace string) ExperimentNamespaceLister { + return experimentNamespaceLister{listers.NewNamespaced[*mlopsv1alpha1.Experiment](s.ResourceIndexer, namespace)} +} + +// ExperimentNamespaceLister helps list and get Experiments. +// All objects returned here must be treated as read-only. +type ExperimentNamespaceLister interface { + // List lists all Experiments in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.Experiment, err error) + // Get retrieves the Experiment from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*mlopsv1alpha1.Experiment, error) + ExperimentNamespaceListerExpansion +} + +// experimentNamespaceLister implements the ExperimentNamespaceLister +// interface. +type experimentNamespaceLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.Experiment] +} diff --git a/operator/pkg/generated/listers/mlops/v1alpha1/model.go b/operator/pkg/generated/listers/mlops/v1alpha1/model.go new file mode 100644 index 0000000000..bc6a4994b7 --- /dev/null +++ b/operator/pkg/generated/listers/mlops/v1alpha1/model.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// ModelLister helps list Models. +// All objects returned here must be treated as read-only. +type ModelLister interface { + // List lists all Models in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.Model, err error) + // Models returns an object that can list and get Models. + Models(namespace string) ModelNamespaceLister + ModelListerExpansion +} + +// modelLister implements the ModelLister interface. +type modelLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.Model] +} + +// NewModelLister returns a new ModelLister. +func NewModelLister(indexer cache.Indexer) ModelLister { + return &modelLister{listers.New[*mlopsv1alpha1.Model](indexer, mlopsv1alpha1.Resource("model"))} +} + +// Models returns an object that can list and get Models. +func (s *modelLister) Models(namespace string) ModelNamespaceLister { + return modelNamespaceLister{listers.NewNamespaced[*mlopsv1alpha1.Model](s.ResourceIndexer, namespace)} +} + +// ModelNamespaceLister helps list and get Models. +// All objects returned here must be treated as read-only. +type ModelNamespaceLister interface { + // List lists all Models in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.Model, err error) + // Get retrieves the Model from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*mlopsv1alpha1.Model, error) + ModelNamespaceListerExpansion +} + +// modelNamespaceLister implements the ModelNamespaceLister +// interface. +type modelNamespaceLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.Model] +} diff --git a/operator/pkg/generated/listers/mlops/v1alpha1/pipeline.go b/operator/pkg/generated/listers/mlops/v1alpha1/pipeline.go new file mode 100644 index 0000000000..ea5fea4dfd --- /dev/null +++ b/operator/pkg/generated/listers/mlops/v1alpha1/pipeline.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// PipelineLister helps list Pipelines. +// All objects returned here must be treated as read-only. +type PipelineLister interface { + // List lists all Pipelines in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.Pipeline, err error) + // Pipelines returns an object that can list and get Pipelines. + Pipelines(namespace string) PipelineNamespaceLister + PipelineListerExpansion +} + +// pipelineLister implements the PipelineLister interface. +type pipelineLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.Pipeline] +} + +// NewPipelineLister returns a new PipelineLister. +func NewPipelineLister(indexer cache.Indexer) PipelineLister { + return &pipelineLister{listers.New[*mlopsv1alpha1.Pipeline](indexer, mlopsv1alpha1.Resource("pipeline"))} +} + +// Pipelines returns an object that can list and get Pipelines. +func (s *pipelineLister) Pipelines(namespace string) PipelineNamespaceLister { + return pipelineNamespaceLister{listers.NewNamespaced[*mlopsv1alpha1.Pipeline](s.ResourceIndexer, namespace)} +} + +// PipelineNamespaceLister helps list and get Pipelines. +// All objects returned here must be treated as read-only. +type PipelineNamespaceLister interface { + // List lists all Pipelines in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.Pipeline, err error) + // Get retrieves the Pipeline from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*mlopsv1alpha1.Pipeline, error) + PipelineNamespaceListerExpansion +} + +// pipelineNamespaceLister implements the PipelineNamespaceLister +// interface. +type pipelineNamespaceLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.Pipeline] +} diff --git a/operator/pkg/generated/listers/mlops/v1alpha1/seldonconfig.go b/operator/pkg/generated/listers/mlops/v1alpha1/seldonconfig.go new file mode 100644 index 0000000000..ae5a9fede3 --- /dev/null +++ b/operator/pkg/generated/listers/mlops/v1alpha1/seldonconfig.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// SeldonConfigLister helps list SeldonConfigs. +// All objects returned here must be treated as read-only. +type SeldonConfigLister interface { + // List lists all SeldonConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.SeldonConfig, err error) + // SeldonConfigs returns an object that can list and get SeldonConfigs. + SeldonConfigs(namespace string) SeldonConfigNamespaceLister + SeldonConfigListerExpansion +} + +// seldonConfigLister implements the SeldonConfigLister interface. +type seldonConfigLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.SeldonConfig] +} + +// NewSeldonConfigLister returns a new SeldonConfigLister. +func NewSeldonConfigLister(indexer cache.Indexer) SeldonConfigLister { + return &seldonConfigLister{listers.New[*mlopsv1alpha1.SeldonConfig](indexer, mlopsv1alpha1.Resource("seldonconfig"))} +} + +// SeldonConfigs returns an object that can list and get SeldonConfigs. +func (s *seldonConfigLister) SeldonConfigs(namespace string) SeldonConfigNamespaceLister { + return seldonConfigNamespaceLister{listers.NewNamespaced[*mlopsv1alpha1.SeldonConfig](s.ResourceIndexer, namespace)} +} + +// SeldonConfigNamespaceLister helps list and get SeldonConfigs. +// All objects returned here must be treated as read-only. +type SeldonConfigNamespaceLister interface { + // List lists all SeldonConfigs in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.SeldonConfig, err error) + // Get retrieves the SeldonConfig from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*mlopsv1alpha1.SeldonConfig, error) + SeldonConfigNamespaceListerExpansion +} + +// seldonConfigNamespaceLister implements the SeldonConfigNamespaceLister +// interface. +type seldonConfigNamespaceLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.SeldonConfig] +} diff --git a/operator/pkg/generated/listers/mlops/v1alpha1/seldonruntime.go b/operator/pkg/generated/listers/mlops/v1alpha1/seldonruntime.go new file mode 100644 index 0000000000..635fbf3b53 --- /dev/null +++ b/operator/pkg/generated/listers/mlops/v1alpha1/seldonruntime.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// SeldonRuntimeLister helps list SeldonRuntimes. +// All objects returned here must be treated as read-only. +type SeldonRuntimeLister interface { + // List lists all SeldonRuntimes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.SeldonRuntime, err error) + // SeldonRuntimes returns an object that can list and get SeldonRuntimes. + SeldonRuntimes(namespace string) SeldonRuntimeNamespaceLister + SeldonRuntimeListerExpansion +} + +// seldonRuntimeLister implements the SeldonRuntimeLister interface. +type seldonRuntimeLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.SeldonRuntime] +} + +// NewSeldonRuntimeLister returns a new SeldonRuntimeLister. +func NewSeldonRuntimeLister(indexer cache.Indexer) SeldonRuntimeLister { + return &seldonRuntimeLister{listers.New[*mlopsv1alpha1.SeldonRuntime](indexer, mlopsv1alpha1.Resource("seldonruntime"))} +} + +// SeldonRuntimes returns an object that can list and get SeldonRuntimes. +func (s *seldonRuntimeLister) SeldonRuntimes(namespace string) SeldonRuntimeNamespaceLister { + return seldonRuntimeNamespaceLister{listers.NewNamespaced[*mlopsv1alpha1.SeldonRuntime](s.ResourceIndexer, namespace)} +} + +// SeldonRuntimeNamespaceLister helps list and get SeldonRuntimes. +// All objects returned here must be treated as read-only. +type SeldonRuntimeNamespaceLister interface { + // List lists all SeldonRuntimes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.SeldonRuntime, err error) + // Get retrieves the SeldonRuntime from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*mlopsv1alpha1.SeldonRuntime, error) + SeldonRuntimeNamespaceListerExpansion +} + +// seldonRuntimeNamespaceLister implements the SeldonRuntimeNamespaceLister +// interface. +type seldonRuntimeNamespaceLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.SeldonRuntime] +} diff --git a/operator/pkg/generated/listers/mlops/v1alpha1/server.go b/operator/pkg/generated/listers/mlops/v1alpha1/server.go new file mode 100644 index 0000000000..9ec2bf8f0d --- /dev/null +++ b/operator/pkg/generated/listers/mlops/v1alpha1/server.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// ServerLister helps list Servers. +// All objects returned here must be treated as read-only. +type ServerLister interface { + // List lists all Servers in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.Server, err error) + // Servers returns an object that can list and get Servers. + Servers(namespace string) ServerNamespaceLister + ServerListerExpansion +} + +// serverLister implements the ServerLister interface. +type serverLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.Server] +} + +// NewServerLister returns a new ServerLister. +func NewServerLister(indexer cache.Indexer) ServerLister { + return &serverLister{listers.New[*mlopsv1alpha1.Server](indexer, mlopsv1alpha1.Resource("server"))} +} + +// Servers returns an object that can list and get Servers. +func (s *serverLister) Servers(namespace string) ServerNamespaceLister { + return serverNamespaceLister{listers.NewNamespaced[*mlopsv1alpha1.Server](s.ResourceIndexer, namespace)} +} + +// ServerNamespaceLister helps list and get Servers. +// All objects returned here must be treated as read-only. +type ServerNamespaceLister interface { + // List lists all Servers in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.Server, err error) + // Get retrieves the Server from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*mlopsv1alpha1.Server, error) + ServerNamespaceListerExpansion +} + +// serverNamespaceLister implements the ServerNamespaceLister +// interface. +type serverNamespaceLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.Server] +} diff --git a/operator/pkg/generated/listers/mlops/v1alpha1/serverconfig.go b/operator/pkg/generated/listers/mlops/v1alpha1/serverconfig.go new file mode 100644 index 0000000000..516568c8a4 --- /dev/null +++ b/operator/pkg/generated/listers/mlops/v1alpha1/serverconfig.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed by +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + mlopsv1alpha1 "github.com/seldonio/seldon-core/operator/v2/apis/mlops/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// ServerConfigLister helps list ServerConfigs. +// All objects returned here must be treated as read-only. +type ServerConfigLister interface { + // List lists all ServerConfigs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.ServerConfig, err error) + // ServerConfigs returns an object that can list and get ServerConfigs. + ServerConfigs(namespace string) ServerConfigNamespaceLister + ServerConfigListerExpansion +} + +// serverConfigLister implements the ServerConfigLister interface. +type serverConfigLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.ServerConfig] +} + +// NewServerConfigLister returns a new ServerConfigLister. +func NewServerConfigLister(indexer cache.Indexer) ServerConfigLister { + return &serverConfigLister{listers.New[*mlopsv1alpha1.ServerConfig](indexer, mlopsv1alpha1.Resource("serverconfig"))} +} + +// ServerConfigs returns an object that can list and get ServerConfigs. +func (s *serverConfigLister) ServerConfigs(namespace string) ServerConfigNamespaceLister { + return serverConfigNamespaceLister{listers.NewNamespaced[*mlopsv1alpha1.ServerConfig](s.ResourceIndexer, namespace)} +} + +// ServerConfigNamespaceLister helps list and get ServerConfigs. +// All objects returned here must be treated as read-only. +type ServerConfigNamespaceLister interface { + // List lists all ServerConfigs in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*mlopsv1alpha1.ServerConfig, err error) + // Get retrieves the ServerConfig from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*mlopsv1alpha1.ServerConfig, error) + ServerConfigNamespaceListerExpansion +} + +// serverConfigNamespaceLister implements the ServerConfigNamespaceLister +// interface. +type serverConfigNamespaceLister struct { + listers.ResourceIndexer[*mlopsv1alpha1.ServerConfig] +} diff --git a/tests/integration/godog/k8sclient/client.go b/tests/integration/godog/k8sclient/client.go index 1e4b41757d..9139b51e97 100644 --- a/tests/integration/godog/k8sclient/client.go +++ b/tests/integration/godog/k8sclient/client.go @@ -1,3 +1,12 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed BY +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ + package k8sclient import ( diff --git a/tests/integration/godog/k8sclient/watcher.go b/tests/integration/godog/k8sclient/watcher.go index 29267ca8a7..21e5c4f5f1 100644 --- a/tests/integration/godog/k8sclient/watcher.go +++ b/tests/integration/godog/k8sclient/watcher.go @@ -1,3 +1,12 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed BY +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ + package k8sclient import ( diff --git a/tests/integration/godog/main_test.go b/tests/integration/godog/main_test.go index f973621791..6bdb502ad3 100644 --- a/tests/integration/godog/main_test.go +++ b/tests/integration/godog/main_test.go @@ -1,3 +1,12 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed BY +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ + package main import ( diff --git a/tests/integration/godog/scenario/assertions/model.go b/tests/integration/godog/scenario/assertions/model.go index 9885f71caa..eafc5b2a02 100644 --- a/tests/integration/godog/scenario/assertions/model.go +++ b/tests/integration/godog/scenario/assertions/model.go @@ -1,3 +1,12 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed BY +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ + package assertions import ( diff --git a/tests/integration/godog/scenario/scenario.go b/tests/integration/godog/scenario/scenario.go index 3a2af99265..7ba5ee4e2b 100644 --- a/tests/integration/godog/scenario/scenario.go +++ b/tests/integration/godog/scenario/scenario.go @@ -1,3 +1,12 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed BY +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ + package scenario import ( diff --git a/tests/integration/godog/steps/model_steps.go b/tests/integration/godog/steps/model_steps.go index 52595a005c..9c803a2424 100644 --- a/tests/integration/godog/steps/model_steps.go +++ b/tests/integration/godog/steps/model_steps.go @@ -1,3 +1,12 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed BY +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ + package steps import ( diff --git a/tests/integration/godog/steps/util.go b/tests/integration/godog/steps/util.go index 2f1cba672e..53a4a6448b 100644 --- a/tests/integration/godog/steps/util.go +++ b/tests/integration/godog/steps/util.go @@ -1,3 +1,12 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed BY +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ + package steps import ( diff --git a/tests/integration/godog/steps/world.go b/tests/integration/godog/steps/world.go index 063190125c..6b4dbacb9e 100644 --- a/tests/integration/godog/steps/world.go +++ b/tests/integration/godog/steps/world.go @@ -1,3 +1,12 @@ +/* +Copyright (c) 2024 Seldon Technologies Ltd. + +Use of this software is governed BY +(1) the license included in the LICENSE file or +(2) if the license included in the LICENSE file is the Business Source License 1.1, +the Change License after the Change Date as each is defined in accordance with the LICENSE file. +*/ + package steps import (