You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uniffle.apache.org by ro...@apache.org on 2022/09/06 06:33:57 UTC
[incubator-uniffle] branch master updated: [ISSUE-48][FEATURE][FOLLOW UP] Generate informer and lister for crd (#202)
This is an automated email from the ASF dual-hosted git repository.
roryqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/master by this push:
new 07f70ed8 [ISSUE-48][FEATURE][FOLLOW UP] Generate informer and lister for crd (#202)
07f70ed8 is described below
commit 07f70ed872b87107fc7028577bd9e66d8349fd6c
Author: jasonawang <ja...@tencent.com>
AuthorDate: Tue Sep 6 14:33:52 2022 +0800
[ISSUE-48][FEATURE][FOLLOW UP] Generate informer and lister for crd (#202)
### What changes were proposed in this pull request?
for issue #48
I add some codes of crd's informer and lister generated by client-gen, and I will add controller module in the next pr.
### Why are the changes needed?
Support K8S
### Does this PR introduce _any_ user-facing change?
We will add the doc later
### How was this patch tested?
No need
---
.gitignore | 1 -
.../pkg/generated/clientset/versioned/clientset.go | 99 +++++++++++
.../pkg/generated/clientset/versioned/doc.go | 21 +++
.../versioned/fake/clientset_generated.go | 87 +++++++++
.../pkg/generated/clientset/versioned/fake/doc.go | 21 +++
.../generated/clientset/versioned/fake/register.go | 58 ++++++
.../generated/clientset/versioned/scheme/doc.go | 21 +++
.../clientset/versioned/scheme/register.go | 58 ++++++
.../versioned/typed/uniffle/v1alpha1/doc.go | 21 +++
.../versioned/typed/uniffle/v1alpha1/fake/doc.go | 21 +++
.../v1alpha1/fake/fake_remoteshuffleservice.go | 144 +++++++++++++++
.../uniffle/v1alpha1/fake/fake_uniffle_client.go | 42 +++++
.../typed/uniffle/v1alpha1/generated_expansion.go | 22 +++
.../typed/uniffle/v1alpha1/remoteshuffleservice.go | 197 +++++++++++++++++++++
.../typed/uniffle/v1alpha1/uniffle_client.go | 91 ++++++++++
.../informers/externalversions/factory.go | 182 +++++++++++++++++++
.../informers/externalversions/generic.go | 64 +++++++
.../internalinterfaces/factory_interfaces.go | 42 +++++
.../externalversions/uniffle/interface.go | 47 +++++
.../externalversions/uniffle/v1alpha1/interface.go | 46 +++++
.../uniffle/v1alpha1/remoteshuffleservice.go | 92 ++++++++++
.../uniffle/v1alpha1/expansion_generated.go | 28 +++
.../uniffle/v1alpha1/remoteshuffleservice.go | 101 +++++++++++
.../operator/pkg/webhook/manager_test.go | 10 +-
24 files changed, 1512 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index a7a59492..2496b9ec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,7 +38,6 @@ testbin/*
*.swp
*.swo
*~
-deploy/kubernetes/operator/pkg/generated/
deploy/kubernetes/operator/bin
common/build/
integration-test/common/build/
diff --git a/deploy/kubernetes/operator/pkg/generated/clientset/versioned/clientset.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/clientset.go
new file mode 100644
index 00000000..d9405fd6
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/clientset.go
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package versioned
+
+import (
+ "fmt"
+
+ discovery "k8s.io/client-go/discovery"
+ rest "k8s.io/client-go/rest"
+ flowcontrol "k8s.io/client-go/util/flowcontrol"
+
+ unifflev1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1"
+)
+
+type Interface interface {
+ Discovery() discovery.DiscoveryInterface
+ UniffleV1alpha1() unifflev1alpha1.UniffleV1alpha1Interface
+}
+
+// Clientset contains the clients for groups. Each group has exactly one
+// version included in a Clientset.
+type Clientset struct {
+ *discovery.DiscoveryClient
+ uniffleV1alpha1 *unifflev1alpha1.UniffleV1alpha1Client
+}
+
+// UniffleV1alpha1 retrieves the UniffleV1alpha1Client
+func (c *Clientset) UniffleV1alpha1() unifflev1alpha1.UniffleV1alpha1Interface {
+ return c.uniffleV1alpha1
+}
+
+// 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.
+func NewForConfig(c *rest.Config) (*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.uniffleV1alpha1, err = unifflev1alpha1.NewForConfig(&configShallowCopy)
+ if err != nil {
+ return nil, err
+ }
+
+ cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
+ 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 {
+ var cs Clientset
+ cs.uniffleV1alpha1 = unifflev1alpha1.NewForConfigOrDie(c)
+
+ cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
+ return &cs
+}
+
+// New creates a new Clientset for the given RESTClient.
+func New(c rest.Interface) *Clientset {
+ var cs Clientset
+ cs.uniffleV1alpha1 = unifflev1alpha1.New(c)
+
+ cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
+ return &cs
+}
diff --git a/deploy/kubernetes/operator/pkg/generated/clientset/versioned/doc.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/doc.go
new file mode 100644
index 00000000..ddc69818
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/doc.go
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+// This package has the automatically generated clientset.
+package versioned
diff --git a/deploy/kubernetes/operator/pkg/generated/clientset/versioned/fake/clientset_generated.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/fake/clientset_generated.go
new file mode 100644
index 00000000..83022fb4
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/fake/clientset_generated.go
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ "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"
+
+ clientset "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/clientset/versioned"
+ unifflev1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1"
+ fakeunifflev1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/fake"
+)
+
+// NewSimpleClientset returns a clientset that will respond with the provided objects.
+// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
+// without applying any validations and/or defaults. It shouldn't be considered a replacement
+// for a real clientset and is mostly useful in simple unit tests.
+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) {
+ gvr := action.GetResource()
+ ns := action.GetNamespace()
+ watch, err := o.Watch(gvr, ns)
+ if err != nil {
+ return false, nil, err
+ }
+ return true, watch, nil
+ })
+
+ return cs
+}
+
+// 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{}
+)
+
+// UniffleV1alpha1 retrieves the UniffleV1alpha1Client
+func (c *Clientset) UniffleV1alpha1() unifflev1alpha1.UniffleV1alpha1Interface {
+ return &fakeunifflev1alpha1.FakeUniffleV1alpha1{Fake: &c.Fake}
+}
diff --git a/deploy/kubernetes/operator/pkg/generated/clientset/versioned/fake/doc.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/fake/doc.go
new file mode 100644
index 00000000..35b3ec82
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/fake/doc.go
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+// This package has the automatically generated fake clientset.
+package fake
diff --git a/deploy/kubernetes/operator/pkg/generated/clientset/versioned/fake/register.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/fake/register.go
new file mode 100644
index 00000000..31682c7e
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/fake/register.go
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ 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"
+
+ unifflev1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/api/uniffle/v1alpha1"
+)
+
+var scheme = runtime.NewScheme()
+var codecs = serializer.NewCodecFactory(scheme)
+
+var localSchemeBuilder = runtime.SchemeBuilder{
+ unifflev1alpha1.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/deploy/kubernetes/operator/pkg/generated/clientset/versioned/scheme/doc.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/scheme/doc.go
new file mode 100644
index 00000000..44ba7aa4
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/scheme/doc.go
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+// This package contains the scheme of the automatically generated clientset.
+package scheme
diff --git a/deploy/kubernetes/operator/pkg/generated/clientset/versioned/scheme/register.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/scheme/register.go
new file mode 100644
index 00000000..3bb57c00
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/scheme/register.go
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package scheme
+
+import (
+ 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"
+
+ unifflev1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/api/uniffle/v1alpha1"
+)
+
+var Scheme = runtime.NewScheme()
+var Codecs = serializer.NewCodecFactory(Scheme)
+var ParameterCodec = runtime.NewParameterCodec(Scheme)
+var localSchemeBuilder = runtime.SchemeBuilder{
+ unifflev1alpha1.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/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/doc.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/doc.go
new file mode 100644
index 00000000..ad7566f1
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/doc.go
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+// This package has the automatically generated typed clients.
+package v1alpha1
diff --git a/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/fake/doc.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/fake/doc.go
new file mode 100644
index 00000000..007f7b91
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/fake/doc.go
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+// Package fake has the automatically generated clients.
+package fake
diff --git a/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/fake/fake_remoteshuffleservice.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/fake/fake_remoteshuffleservice.go
new file mode 100644
index 00000000..46f13b81
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/fake/fake_remoteshuffleservice.go
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ testing "k8s.io/client-go/testing"
+
+ v1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/api/uniffle/v1alpha1"
+)
+
+// FakeRemoteShuffleServices implements RemoteShuffleServiceInterface
+type FakeRemoteShuffleServices struct {
+ Fake *FakeUniffleV1alpha1
+ ns string
+}
+
+var remoteshuffleservicesResource = schema.GroupVersionResource{Group: "uniffle.apache.org", Version: "v1alpha1", Resource: "remoteshuffleservices"}
+
+var remoteshuffleservicesKind = schema.GroupVersionKind{Group: "uniffle.apache.org", Version: "v1alpha1", Kind: "RemoteShuffleService"}
+
+// Get takes name of the remoteShuffleService, and returns the corresponding remoteShuffleService object, and an error if there is any.
+func (c *FakeRemoteShuffleServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RemoteShuffleService, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewGetAction(remoteshuffleservicesResource, c.ns, name), &v1alpha1.RemoteShuffleService{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.RemoteShuffleService), err
+}
+
+// List takes label and field selectors, and returns the list of RemoteShuffleServices that match those selectors.
+func (c *FakeRemoteShuffleServices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RemoteShuffleServiceList, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewListAction(remoteshuffleservicesResource, remoteshuffleservicesKind, c.ns, opts), &v1alpha1.RemoteShuffleServiceList{})
+
+ if obj == nil {
+ return nil, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &v1alpha1.RemoteShuffleServiceList{ListMeta: obj.(*v1alpha1.RemoteShuffleServiceList).ListMeta}
+ for _, item := range obj.(*v1alpha1.RemoteShuffleServiceList).Items {
+ if label.Matches(labels.Set(item.Labels)) {
+ list.Items = append(list.Items, item)
+ }
+ }
+ return list, err
+}
+
+// Watch returns a watch.Interface that watches the requested remoteShuffleServices.
+func (c *FakeRemoteShuffleServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewWatchAction(remoteshuffleservicesResource, c.ns, opts))
+
+}
+
+// Create takes the representation of a remoteShuffleService and creates it. Returns the server's representation of the remoteShuffleService, and an error, if there is any.
+func (c *FakeRemoteShuffleServices) Create(ctx context.Context, remoteShuffleService *v1alpha1.RemoteShuffleService, opts v1.CreateOptions) (result *v1alpha1.RemoteShuffleService, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewCreateAction(remoteshuffleservicesResource, c.ns, remoteShuffleService), &v1alpha1.RemoteShuffleService{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.RemoteShuffleService), err
+}
+
+// Update takes the representation of a remoteShuffleService and updates it. Returns the server's representation of the remoteShuffleService, and an error, if there is any.
+func (c *FakeRemoteShuffleServices) Update(ctx context.Context, remoteShuffleService *v1alpha1.RemoteShuffleService, opts v1.UpdateOptions) (result *v1alpha1.RemoteShuffleService, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateAction(remoteshuffleservicesResource, c.ns, remoteShuffleService), &v1alpha1.RemoteShuffleService{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.RemoteShuffleService), err
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+func (c *FakeRemoteShuffleServices) UpdateStatus(ctx context.Context, remoteShuffleService *v1alpha1.RemoteShuffleService, opts v1.UpdateOptions) (*v1alpha1.RemoteShuffleService, error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateSubresourceAction(remoteshuffleservicesResource, "status", c.ns, remoteShuffleService), &v1alpha1.RemoteShuffleService{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.RemoteShuffleService), err
+}
+
+// Delete takes name of the remoteShuffleService and deletes it. Returns an error if one occurs.
+func (c *FakeRemoteShuffleServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewDeleteAction(remoteshuffleservicesResource, c.ns, name), &v1alpha1.RemoteShuffleService{})
+
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakeRemoteShuffleServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
+ action := testing.NewDeleteCollectionAction(remoteshuffleservicesResource, c.ns, listOpts)
+
+ _, err := c.Fake.Invokes(action, &v1alpha1.RemoteShuffleServiceList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched remoteShuffleService.
+func (c *FakeRemoteShuffleServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RemoteShuffleService, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewPatchSubresourceAction(remoteshuffleservicesResource, c.ns, name, pt, data, subresources...), &v1alpha1.RemoteShuffleService{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*v1alpha1.RemoteShuffleService), err
+}
diff --git a/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/fake/fake_uniffle_client.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/fake/fake_uniffle_client.go
new file mode 100644
index 00000000..fb802574
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/fake/fake_uniffle_client.go
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ rest "k8s.io/client-go/rest"
+ testing "k8s.io/client-go/testing"
+
+ v1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1"
+)
+
+type FakeUniffleV1alpha1 struct {
+ *testing.Fake
+}
+
+func (c *FakeUniffleV1alpha1) RemoteShuffleServices(namespace string) v1alpha1.RemoteShuffleServiceInterface {
+ return &FakeRemoteShuffleServices{c, namespace}
+}
+
+// RESTClient returns a RESTClient that is used to communicate
+// with API server by this client implementation.
+func (c *FakeUniffleV1alpha1) RESTClient() rest.Interface {
+ var ret *rest.RESTClient
+ return ret
+}
diff --git a/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/generated_expansion.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/generated_expansion.go
new file mode 100644
index 00000000..c25cc5f5
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/generated_expansion.go
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1alpha1
+
+type RemoteShuffleServiceExpansion interface{}
diff --git a/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/remoteshuffleservice.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/remoteshuffleservice.go
new file mode 100644
index 00000000..9e94a7c0
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/remoteshuffleservice.go
@@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ "context"
+ "time"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ rest "k8s.io/client-go/rest"
+
+ v1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/api/uniffle/v1alpha1"
+ scheme "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/clientset/versioned/scheme"
+)
+
+// RemoteShuffleServicesGetter has a method to return a RemoteShuffleServiceInterface.
+// A group's client should implement this interface.
+type RemoteShuffleServicesGetter interface {
+ RemoteShuffleServices(namespace string) RemoteShuffleServiceInterface
+}
+
+// RemoteShuffleServiceInterface has methods to work with RemoteShuffleService resources.
+type RemoteShuffleServiceInterface interface {
+ Create(ctx context.Context, remoteShuffleService *v1alpha1.RemoteShuffleService, opts v1.CreateOptions) (*v1alpha1.RemoteShuffleService, error)
+ Update(ctx context.Context, remoteShuffleService *v1alpha1.RemoteShuffleService, opts v1.UpdateOptions) (*v1alpha1.RemoteShuffleService, error)
+ UpdateStatus(ctx context.Context, remoteShuffleService *v1alpha1.RemoteShuffleService, opts v1.UpdateOptions) (*v1alpha1.RemoteShuffleService, error)
+ Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
+ DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
+ Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.RemoteShuffleService, error)
+ List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RemoteShuffleServiceList, error)
+ Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
+ Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RemoteShuffleService, err error)
+ RemoteShuffleServiceExpansion
+}
+
+// remoteShuffleServices implements RemoteShuffleServiceInterface
+type remoteShuffleServices struct {
+ client rest.Interface
+ ns string
+}
+
+// newRemoteShuffleServices returns a RemoteShuffleServices
+func newRemoteShuffleServices(c *UniffleV1alpha1Client, namespace string) *remoteShuffleServices {
+ return &remoteShuffleServices{
+ client: c.RESTClient(),
+ ns: namespace,
+ }
+}
+
+// Get takes name of the remoteShuffleService, and returns the corresponding remoteShuffleService object, and an error if there is any.
+func (c *remoteShuffleServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RemoteShuffleService, err error) {
+ result = &v1alpha1.RemoteShuffleService{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("remoteshuffleservices").
+ Name(name).
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// List takes label and field selectors, and returns the list of RemoteShuffleServices that match those selectors.
+func (c *remoteShuffleServices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RemoteShuffleServiceList, err error) {
+ var timeout time.Duration
+ if opts.TimeoutSeconds != nil {
+ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
+ }
+ result = &v1alpha1.RemoteShuffleServiceList{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("remoteshuffleservices").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Timeout(timeout).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// Watch returns a watch.Interface that watches the requested remoteShuffleServices.
+func (c *remoteShuffleServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
+ var timeout time.Duration
+ if opts.TimeoutSeconds != nil {
+ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
+ }
+ opts.Watch = true
+ return c.client.Get().
+ Namespace(c.ns).
+ Resource("remoteshuffleservices").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Timeout(timeout).
+ Watch(ctx)
+}
+
+// Create takes the representation of a remoteShuffleService and creates it. Returns the server's representation of the remoteShuffleService, and an error, if there is any.
+func (c *remoteShuffleServices) Create(ctx context.Context, remoteShuffleService *v1alpha1.RemoteShuffleService, opts v1.CreateOptions) (result *v1alpha1.RemoteShuffleService, err error) {
+ result = &v1alpha1.RemoteShuffleService{}
+ err = c.client.Post().
+ Namespace(c.ns).
+ Resource("remoteshuffleservices").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Body(remoteShuffleService).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// Update takes the representation of a remoteShuffleService and updates it. Returns the server's representation of the remoteShuffleService, and an error, if there is any.
+func (c *remoteShuffleServices) Update(ctx context.Context, remoteShuffleService *v1alpha1.RemoteShuffleService, opts v1.UpdateOptions) (result *v1alpha1.RemoteShuffleService, err error) {
+ result = &v1alpha1.RemoteShuffleService{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("remoteshuffleservices").
+ Name(remoteShuffleService.Name).
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Body(remoteShuffleService).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+func (c *remoteShuffleServices) UpdateStatus(ctx context.Context, remoteShuffleService *v1alpha1.RemoteShuffleService, opts v1.UpdateOptions) (result *v1alpha1.RemoteShuffleService, err error) {
+ result = &v1alpha1.RemoteShuffleService{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("remoteshuffleservices").
+ Name(remoteShuffleService.Name).
+ SubResource("status").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Body(remoteShuffleService).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// Delete takes name of the remoteShuffleService and deletes it. Returns an error if one occurs.
+func (c *remoteShuffleServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("remoteshuffleservices").
+ Name(name).
+ Body(&opts).
+ Do(ctx).
+ Error()
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *remoteShuffleServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
+ var timeout time.Duration
+ if listOpts.TimeoutSeconds != nil {
+ timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
+ }
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("remoteshuffleservices").
+ VersionedParams(&listOpts, scheme.ParameterCodec).
+ Timeout(timeout).
+ Body(&opts).
+ Do(ctx).
+ Error()
+}
+
+// Patch applies the patch and returns the patched remoteShuffleService.
+func (c *remoteShuffleServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RemoteShuffleService, err error) {
+ result = &v1alpha1.RemoteShuffleService{}
+ err = c.client.Patch(pt).
+ Namespace(c.ns).
+ Resource("remoteshuffleservices").
+ Name(name).
+ SubResource(subresources...).
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Body(data).
+ Do(ctx).
+ Into(result)
+ return
+}
diff --git a/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/uniffle_client.go b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/uniffle_client.go
new file mode 100644
index 00000000..cf6b89a2
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/clientset/versioned/typed/uniffle/v1alpha1/uniffle_client.go
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ rest "k8s.io/client-go/rest"
+
+ v1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/api/uniffle/v1alpha1"
+ "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/clientset/versioned/scheme"
+)
+
+type UniffleV1alpha1Interface interface {
+ RESTClient() rest.Interface
+ RemoteShuffleServicesGetter
+}
+
+// UniffleV1alpha1Client is used to interact with features provided by the uniffle.apache.org group.
+type UniffleV1alpha1Client struct {
+ restClient rest.Interface
+}
+
+func (c *UniffleV1alpha1Client) RemoteShuffleServices(namespace string) RemoteShuffleServiceInterface {
+ return newRemoteShuffleServices(c, namespace)
+}
+
+// NewForConfig creates a new UniffleV1alpha1Client for the given config.
+func NewForConfig(c *rest.Config) (*UniffleV1alpha1Client, error) {
+ config := *c
+ if err := setConfigDefaults(&config); err != nil {
+ return nil, err
+ }
+ client, err := rest.RESTClientFor(&config)
+ if err != nil {
+ return nil, err
+ }
+ return &UniffleV1alpha1Client{client}, nil
+}
+
+// NewForConfigOrDie creates a new UniffleV1alpha1Client for the given config and
+// panics if there is an error in the config.
+func NewForConfigOrDie(c *rest.Config) *UniffleV1alpha1Client {
+ client, err := NewForConfig(c)
+ if err != nil {
+ panic(err)
+ }
+ return client
+}
+
+// New creates a new UniffleV1alpha1Client for the given RESTClient.
+func New(c rest.Interface) *UniffleV1alpha1Client {
+ return &UniffleV1alpha1Client{c}
+}
+
+func setConfigDefaults(config *rest.Config) error {
+ gv := v1alpha1.SchemeGroupVersion
+ config.GroupVersion = &gv
+ config.APIPath = "/apis"
+ config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
+
+ if config.UserAgent == "" {
+ config.UserAgent = rest.DefaultKubernetesUserAgent()
+ }
+
+ return nil
+}
+
+// RESTClient returns a RESTClient that is used to communicate
+// with API server by this client implementation.
+func (c *UniffleV1alpha1Client) RESTClient() rest.Interface {
+ if c == nil {
+ return nil
+ }
+ return c.restClient
+}
diff --git a/deploy/kubernetes/operator/pkg/generated/informers/externalversions/factory.go b/deploy/kubernetes/operator/pkg/generated/informers/externalversions/factory.go
new file mode 100644
index 00000000..6e657ee6
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/informers/externalversions/factory.go
@@ -0,0 +1,182 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package externalversions
+
+import (
+ reflect "reflect"
+ sync "sync"
+ time "time"
+
+ 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"
+
+ versioned "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/clientset/versioned"
+ internalinterfaces "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/informers/externalversions/internalinterfaces"
+ uniffle "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/informers/externalversions/uniffle"
+)
+
+// 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
+
+ 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
+}
+
+// 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
+ }
+}
+
+// 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
+}
+
+// Start initializes all requested informers.
+func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) {
+ f.lock.Lock()
+ defer f.lock.Unlock()
+
+ for informerType, informer := range f.informers {
+ if !f.startedInformers[informerType] {
+ go informer.Run(stopCh)
+ f.startedInformers[informerType] = true
+ }
+ }
+}
+
+// WaitForCacheSync waits for all started informers' cache were synced.
+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
+}
+
+// InternalInformerFor 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)
+ f.informers[informerType] = informer
+
+ return informer
+}
+
+// SharedInformerFactory provides shared informers for resources in all known
+// API group versions.
+type SharedInformerFactory interface {
+ internalinterfaces.SharedInformerFactory
+ ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
+ WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
+
+ Uniffle() uniffle.Interface
+}
+
+func (f *sharedInformerFactory) Uniffle() uniffle.Interface {
+ return uniffle.New(f, f.namespace, f.tweakListOptions)
+}
diff --git a/deploy/kubernetes/operator/pkg/generated/informers/externalversions/generic.go b/deploy/kubernetes/operator/pkg/generated/informers/externalversions/generic.go
new file mode 100644
index 00000000..b524227d
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/informers/externalversions/generic.go
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package externalversions
+
+import (
+ "fmt"
+
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ cache "k8s.io/client-go/tools/cache"
+
+ v1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/api/uniffle/v1alpha1"
+)
+
+// 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=uniffle.apache.org, Version=v1alpha1
+ case v1alpha1.SchemeGroupVersion.WithResource("remoteshuffleservices"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Uniffle().V1alpha1().RemoteShuffleServices().Informer()}, nil
+
+ }
+
+ return nil, fmt.Errorf("no informer found for %v", resource)
+}
diff --git a/deploy/kubernetes/operator/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/deploy/kubernetes/operator/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go
new file mode 100644
index 00000000..8a7e909b
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package internalinterfaces
+
+import (
+ time "time"
+
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ cache "k8s.io/client-go/tools/cache"
+
+ versioned "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/clientset/versioned"
+)
+
+// 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/deploy/kubernetes/operator/pkg/generated/informers/externalversions/uniffle/interface.go b/deploy/kubernetes/operator/pkg/generated/informers/externalversions/uniffle/interface.go
new file mode 100644
index 00000000..3079a1e7
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/informers/externalversions/uniffle/interface.go
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package uniffle
+
+import (
+ internalinterfaces "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/informers/externalversions/internalinterfaces"
+ v1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/informers/externalversions/uniffle/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/deploy/kubernetes/operator/pkg/generated/informers/externalversions/uniffle/v1alpha1/interface.go b/deploy/kubernetes/operator/pkg/generated/informers/externalversions/uniffle/v1alpha1/interface.go
new file mode 100644
index 00000000..4b967f13
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/informers/externalversions/uniffle/v1alpha1/interface.go
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ internalinterfaces "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/informers/externalversions/internalinterfaces"
+)
+
+// Interface provides access to all the informers in this group version.
+type Interface interface {
+ // RemoteShuffleServices returns a RemoteShuffleServiceInformer.
+ RemoteShuffleServices() RemoteShuffleServiceInformer
+}
+
+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}
+}
+
+// RemoteShuffleServices returns a RemoteShuffleServiceInformer.
+func (v *version) RemoteShuffleServices() RemoteShuffleServiceInformer {
+ return &remoteShuffleServiceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
+}
diff --git a/deploy/kubernetes/operator/pkg/generated/informers/externalversions/uniffle/v1alpha1/remoteshuffleservice.go b/deploy/kubernetes/operator/pkg/generated/informers/externalversions/uniffle/v1alpha1/remoteshuffleservice.go
new file mode 100644
index 00000000..4bdd6c36
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/informers/externalversions/uniffle/v1alpha1/remoteshuffleservice.go
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ "context"
+ time "time"
+
+ 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"
+
+ unifflev1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/api/uniffle/v1alpha1"
+ versioned "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/clientset/versioned"
+ internalinterfaces "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/informers/externalversions/internalinterfaces"
+ v1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/generated/listers/uniffle/v1alpha1"
+)
+
+// RemoteShuffleServiceInformer provides access to a shared informer and lister for
+// RemoteShuffleServices.
+type RemoteShuffleServiceInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() v1alpha1.RemoteShuffleServiceLister
+}
+
+type remoteShuffleServiceInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ namespace string
+}
+
+// NewRemoteShuffleServiceInformer constructs a new informer for RemoteShuffleService 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 NewRemoteShuffleServiceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredRemoteShuffleServiceInformer(client, namespace, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredRemoteShuffleServiceInformer constructs a new informer for RemoteShuffleService 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 NewFilteredRemoteShuffleServiceInformer(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.UniffleV1alpha1().RemoteShuffleServices(namespace).List(context.TODO(), options)
+ },
+ WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.UniffleV1alpha1().RemoteShuffleServices(namespace).Watch(context.TODO(), options)
+ },
+ },
+ &unifflev1alpha1.RemoteShuffleService{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *remoteShuffleServiceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredRemoteShuffleServiceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *remoteShuffleServiceInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&unifflev1alpha1.RemoteShuffleService{}, f.defaultInformer)
+}
+
+func (f *remoteShuffleServiceInformer) Lister() v1alpha1.RemoteShuffleServiceLister {
+ return v1alpha1.NewRemoteShuffleServiceLister(f.Informer().GetIndexer())
+}
diff --git a/deploy/kubernetes/operator/pkg/generated/listers/uniffle/v1alpha1/expansion_generated.go b/deploy/kubernetes/operator/pkg/generated/listers/uniffle/v1alpha1/expansion_generated.go
new file mode 100644
index 00000000..bb1950fd
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/listers/uniffle/v1alpha1/expansion_generated.go
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by lister-gen. DO NOT EDIT.
+
+package v1alpha1
+
+// RemoteShuffleServiceListerExpansion allows custom methods to be added to
+// RemoteShuffleServiceLister.
+type RemoteShuffleServiceListerExpansion interface{}
+
+// RemoteShuffleServiceNamespaceListerExpansion allows custom methods to be added to
+// RemoteShuffleServiceNamespaceLister.
+type RemoteShuffleServiceNamespaceListerExpansion interface{}
diff --git a/deploy/kubernetes/operator/pkg/generated/listers/uniffle/v1alpha1/remoteshuffleservice.go b/deploy/kubernetes/operator/pkg/generated/listers/uniffle/v1alpha1/remoteshuffleservice.go
new file mode 100644
index 00000000..5c1ab4de
--- /dev/null
+++ b/deploy/kubernetes/operator/pkg/generated/listers/uniffle/v1alpha1/remoteshuffleservice.go
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Code generated by lister-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+
+ v1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/api/uniffle/v1alpha1"
+)
+
+// RemoteShuffleServiceLister helps list RemoteShuffleServices.
+// All objects returned here must be treated as read-only.
+type RemoteShuffleServiceLister interface {
+ // List lists all RemoteShuffleServices in the indexer.
+ // Objects returned here must be treated as read-only.
+ List(selector labels.Selector) (ret []*v1alpha1.RemoteShuffleService, err error)
+ // RemoteShuffleServices returns an object that can list and get RemoteShuffleServices.
+ RemoteShuffleServices(namespace string) RemoteShuffleServiceNamespaceLister
+ RemoteShuffleServiceListerExpansion
+}
+
+// remoteShuffleServiceLister implements the RemoteShuffleServiceLister interface.
+type remoteShuffleServiceLister struct {
+ indexer cache.Indexer
+}
+
+// NewRemoteShuffleServiceLister returns a new RemoteShuffleServiceLister.
+func NewRemoteShuffleServiceLister(indexer cache.Indexer) RemoteShuffleServiceLister {
+ return &remoteShuffleServiceLister{indexer: indexer}
+}
+
+// List lists all RemoteShuffleServices in the indexer.
+func (s *remoteShuffleServiceLister) List(selector labels.Selector) (ret []*v1alpha1.RemoteShuffleService, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1alpha1.RemoteShuffleService))
+ })
+ return ret, err
+}
+
+// RemoteShuffleServices returns an object that can list and get RemoteShuffleServices.
+func (s *remoteShuffleServiceLister) RemoteShuffleServices(namespace string) RemoteShuffleServiceNamespaceLister {
+ return remoteShuffleServiceNamespaceLister{indexer: s.indexer, namespace: namespace}
+}
+
+// RemoteShuffleServiceNamespaceLister helps list and get RemoteShuffleServices.
+// All objects returned here must be treated as read-only.
+type RemoteShuffleServiceNamespaceLister interface {
+ // List lists all RemoteShuffleServices in the indexer for a given namespace.
+ // Objects returned here must be treated as read-only.
+ List(selector labels.Selector) (ret []*v1alpha1.RemoteShuffleService, err error)
+ // Get retrieves the RemoteShuffleService from the indexer for a given namespace and name.
+ // Objects returned here must be treated as read-only.
+ Get(name string) (*v1alpha1.RemoteShuffleService, error)
+ RemoteShuffleServiceNamespaceListerExpansion
+}
+
+// remoteShuffleServiceNamespaceLister implements the RemoteShuffleServiceNamespaceLister
+// interface.
+type remoteShuffleServiceNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all RemoteShuffleServices in the indexer for a given namespace.
+func (s remoteShuffleServiceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.RemoteShuffleService, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1alpha1.RemoteShuffleService))
+ })
+ return ret, err
+}
+
+// Get retrieves the RemoteShuffleService from the indexer for a given namespace and name.
+func (s remoteShuffleServiceNamespaceLister) Get(name string) (*v1alpha1.RemoteShuffleService, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(v1alpha1.Resource("remoteshuffleservice"), name)
+ }
+ return obj.(*v1alpha1.RemoteShuffleService), nil
+}
diff --git a/deploy/kubernetes/operator/pkg/webhook/manager_test.go b/deploy/kubernetes/operator/pkg/webhook/manager_test.go
index 55d75230..038e3566 100644
--- a/deploy/kubernetes/operator/pkg/webhook/manager_test.go
+++ b/deploy/kubernetes/operator/pkg/webhook/manager_test.go
@@ -34,7 +34,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
- "sigs.k8s.io/controller-runtime/pkg/manager/signals"
unifflev1alpha1 "github.com/apache/incubator-uniffle/deploy/kubernetes/operator/api/uniffle/v1alpha1"
"github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/constants"
@@ -48,6 +47,8 @@ var (
testEnv *envtest.Environment
kubeClient kubernetes.Interface
rssClient versioned.Interface
+ stopCtx context.Context
+ ctxCancel context.CancelFunc
)
func TestAdmissionManager(t *testing.T) {
@@ -95,7 +96,7 @@ var _ = BeforeSuite(
},
}
am := newAdmissionManager(cfg)
- stopCtx := signals.SetupSignalHandler()
+ stopCtx, ctxCancel = context.WithCancel(context.TODO())
go func() {
err = am.Start(stopCtx)
Expect(err).ToNot(HaveOccurred())
@@ -104,7 +105,10 @@ var _ = BeforeSuite(
)
var _ = AfterSuite(func() {
- Expect(testEnv.Stop()).To(Succeed())
+ By("stopping admission manager")
+ ctxCancel()
+ By("tearing down the test environment")
+ _ = testEnv.Stop()
})
var _ = Describe("AdmissionManager", func() {