mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Update generated code
This commit is contained in:
parent
ba240d0611
commit
609c5e5f51
@ -122,63 +122,3 @@ func (in *AddonStatus) DeepCopy() *AddonStatus {
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ListenerConfig) DeepCopyInto(out *ListenerConfig) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenerConfig.
|
||||
func (in *ListenerConfig) DeepCopy() *ListenerConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ListenerConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ListenerConfig) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ListenerConfigList) DeepCopyInto(out *ListenerConfigList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ListenerConfig, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenerConfigList.
|
||||
func (in *ListenerConfigList) DeepCopy() *ListenerConfigList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ListenerConfigList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ListenerConfigList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -26,23 +26,6 @@ import (
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// ListenerConfigList is a list of ListenerConfig resources
|
||||
type ListenerConfigList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
|
||||
Items []ListenerConfig `json:"items"`
|
||||
}
|
||||
|
||||
func NewListenerConfig(namespace, name string, obj ListenerConfig) *ListenerConfig {
|
||||
obj.APIVersion, obj.Kind = SchemeGroupVersion.WithKind("ListenerConfig").ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
obj.Namespace = namespace
|
||||
return &obj
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// AddonList is a list of Addon resources
|
||||
type AddonList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
|
@ -28,8 +28,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
AddonResourceName = "addons"
|
||||
ListenerConfigResourceName = "listenerconfigs"
|
||||
AddonResourceName = "addons"
|
||||
)
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
@ -55,8 +54,6 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&Addon{},
|
||||
&AddonList{},
|
||||
&ListenerConfig{},
|
||||
&ListenerConfigList{},
|
||||
)
|
||||
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||
return nil
|
||||
|
@ -141,7 +141,7 @@ func localStorageYaml() (*asset, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _rolebindingsYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\xcf\xbd\x0a\xc2\x40\x10\x04\xe0\xfe\x9e\xe2\x5e\xe0\x22\x76\x72\xa5\x16\xf6\x01\xed\x37\xb9\x55\xd7\xdc\x1f\xbb\x7b\x01\x7d\x7a\x09\x48\x1a\x51\xb0\x1c\x18\xe6\x63\xa0\xd2\x19\x59\xa8\x64\x6f\x79\x80\xb1\x83\xa6\xb7\xc2\xf4\x04\xa5\x92\xbb\x69\x27\x1d\x95\xcd\xbc\x35\x13\xe5\xe0\xed\x21\x36\x51\xe4\xbe\x44\xdc\x53\x0e\x94\xaf\x26\xa1\x42\x00\x05\x6f\xac\xcd\x90\xd0\xdb\xa9\x0d\xe8\xa0\x92\x20\xcf\xc8\x6e\x89\x11\xd5\x41\x48\x94\x0d\x97\x88\x3d\x5e\x96\x36\x54\x3a\x72\x69\xf5\x87\x6c\xac\xfd\x80\x57\x47\x1e\xa2\x98\xfc\xba\x5f\xe9\x6d\x48\x1b\xee\x38\xaa\x78\xe3\xfe\x42\x4e\x82\xfc\xe5\x85\x79\x05\x00\x00\xff\xff\x54\xf2\x55\xe2\x29\x01\x00\x00")
|
||||
var _rolebindingsYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x92\x31\x6f\xe3\x30\x0c\x85\x77\xfd\x0a\x21\xbb\x72\x38\xdc\x72\xf0\xd8\x0e\xdd\x03\xb4\x3b\x6d\xb3\x09\x6b\x59\x14\x48\x2a\x41\xfb\xeb\x0b\xa7\x6e\x82\xa4\x76\x90\xb4\xdd\x24\x41\x7c\x1f\x1f\xf9\x20\xd3\x13\x8a\x12\xa7\xca\x4b\x0d\xcd\x12\x8a\x6d\x58\xe8\x0d\x8c\x38\x2d\xbb\xff\xba\x24\xfe\xb3\xfd\xeb\x3a\x4a\x6d\xe5\xef\x63\x51\x43\x59\x71\xc4\x3b\x4a\x2d\xa5\xb5\xeb\xd1\xa0\x05\x83\xca\x79\x9f\xa0\xc7\xca\x77\xa5\xc6\x00\x99\x14\x65\x8b\x12\x86\x6b\x44\x0b\xd0\xf6\x94\x9c\x70\xc4\x15\x3e\x0f\xbf\x21\xd3\x83\x70\xc9\x17\xc8\xce\xfb\x2f\xe0\x03\x47\x5f\xd5\xb0\xaf\x0e\xfa\x99\x46\x86\x96\xfa\x05\x1b\xd3\xca\x85\x9b\x20\x8f\x8a\x32\xe3\xc2\xb9\x10\x82\xfb\xfe\xb4\x26\xc6\xf4\xd9\xfe\x3f\x0d\x0d\x27\x13\x8e\x11\xc5\x49\x89\x78\xd2\xb8\x0e\x15\xc1\x2f\x16\xce\x7b\x41\xe5\x22\x0d\x8e\x6f\x89\x5b\x54\xe7\xfd\x16\xa5\x1e\x9f\xd6\x68\x57\xd6\x42\x8f\x9a\xa1\x39\x17\x88\xa4\xb6\x3f\xec\xc0\x9a\xcd\x84\x56\x42\xdb\xb1\x74\x94\xd6\xa3\xdf\x29\xf1\x8f\x3f\x99\x23\x35\x74\x33\x61\x42\x10\x53\x9b\x99\x92\xe9\xfe\x96\xb9\x9d\xd3\x1c\xfc\x1f\xb5\x7f\xb8\xb4\xf9\x88\xcf\xec\xee\xf7\xb3\x7d\x0a\x38\x06\x7b\xf0\x78\x1d\xe3\x2c\xdc\x97\x01\xef\x01\x00\x00\xff\xff\x46\xd3\x6d\x9d\x0f\x04\x00\x00")
|
||||
|
||||
func rolebindingsYamlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -32,10 +32,6 @@ func (c *FakeK3sV1) Addons(namespace string) v1.AddonInterface {
|
||||
return &FakeAddons{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeK3sV1) ListenerConfigs(namespace string) v1.ListenerConfigInterface {
|
||||
return &FakeListenerConfigs{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeK3sV1) RESTClient() rest.Interface {
|
||||
|
@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed 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 main. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
k3scattleiov1 "github.com/rancher/k3s/pkg/apis/k3s.cattle.io/v1"
|
||||
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"
|
||||
)
|
||||
|
||||
// FakeListenerConfigs implements ListenerConfigInterface
|
||||
type FakeListenerConfigs struct {
|
||||
Fake *FakeK3sV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var listenerconfigsResource = schema.GroupVersionResource{Group: "k3s.cattle.io", Version: "v1", Resource: "listenerconfigs"}
|
||||
|
||||
var listenerconfigsKind = schema.GroupVersionKind{Group: "k3s.cattle.io", Version: "v1", Kind: "ListenerConfig"}
|
||||
|
||||
// Get takes name of the listenerConfig, and returns the corresponding listenerConfig object, and an error if there is any.
|
||||
func (c *FakeListenerConfigs) Get(name string, options v1.GetOptions) (result *k3scattleiov1.ListenerConfig, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(listenerconfigsResource, c.ns, name), &k3scattleiov1.ListenerConfig{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*k3scattleiov1.ListenerConfig), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ListenerConfigs that match those selectors.
|
||||
func (c *FakeListenerConfigs) List(opts v1.ListOptions) (result *k3scattleiov1.ListenerConfigList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(listenerconfigsResource, listenerconfigsKind, c.ns, opts), &k3scattleiov1.ListenerConfigList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &k3scattleiov1.ListenerConfigList{ListMeta: obj.(*k3scattleiov1.ListenerConfigList).ListMeta}
|
||||
for _, item := range obj.(*k3scattleiov1.ListenerConfigList).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 listenerConfigs.
|
||||
func (c *FakeListenerConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(listenerconfigsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a listenerConfig and creates it. Returns the server's representation of the listenerConfig, and an error, if there is any.
|
||||
func (c *FakeListenerConfigs) Create(listenerConfig *k3scattleiov1.ListenerConfig) (result *k3scattleiov1.ListenerConfig, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(listenerconfigsResource, c.ns, listenerConfig), &k3scattleiov1.ListenerConfig{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*k3scattleiov1.ListenerConfig), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a listenerConfig and updates it. Returns the server's representation of the listenerConfig, and an error, if there is any.
|
||||
func (c *FakeListenerConfigs) Update(listenerConfig *k3scattleiov1.ListenerConfig) (result *k3scattleiov1.ListenerConfig, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(listenerconfigsResource, c.ns, listenerConfig), &k3scattleiov1.ListenerConfig{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*k3scattleiov1.ListenerConfig), 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 *FakeListenerConfigs) UpdateStatus(listenerConfig *k3scattleiov1.ListenerConfig) (*k3scattleiov1.ListenerConfig, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(listenerconfigsResource, "status", c.ns, listenerConfig), &k3scattleiov1.ListenerConfig{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*k3scattleiov1.ListenerConfig), err
|
||||
}
|
||||
|
||||
// Delete takes name of the listenerConfig and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeListenerConfigs) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(listenerconfigsResource, c.ns, name), &k3scattleiov1.ListenerConfig{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeListenerConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(listenerconfigsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &k3scattleiov1.ListenerConfigList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched listenerConfig.
|
||||
func (c *FakeListenerConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *k3scattleiov1.ListenerConfig, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(listenerconfigsResource, c.ns, name, pt, data, subresources...), &k3scattleiov1.ListenerConfig{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*k3scattleiov1.ListenerConfig), err
|
||||
}
|
@ -19,5 +19,3 @@ limitations under the License.
|
||||
package v1
|
||||
|
||||
type AddonExpansion interface{}
|
||||
|
||||
type ListenerConfigExpansion interface{}
|
||||
|
@ -27,7 +27,6 @@ import (
|
||||
type K3sV1Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
AddonsGetter
|
||||
ListenerConfigsGetter
|
||||
}
|
||||
|
||||
// K3sV1Client is used to interact with features provided by the k3s.cattle.io group.
|
||||
@ -39,10 +38,6 @@ func (c *K3sV1Client) Addons(namespace string) AddonInterface {
|
||||
return newAddons(c, namespace)
|
||||
}
|
||||
|
||||
func (c *K3sV1Client) ListenerConfigs(namespace string) ListenerConfigInterface {
|
||||
return newListenerConfigs(c, namespace)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new K3sV1Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*K3sV1Client, error) {
|
||||
config := *c
|
||||
|
@ -1,191 +0,0 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed 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 main. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
v1 "github.com/rancher/k3s/pkg/apis/k3s.cattle.io/v1"
|
||||
scheme "github.com/rancher/k3s/pkg/generated/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// ListenerConfigsGetter has a method to return a ListenerConfigInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ListenerConfigsGetter interface {
|
||||
ListenerConfigs(namespace string) ListenerConfigInterface
|
||||
}
|
||||
|
||||
// ListenerConfigInterface has methods to work with ListenerConfig resources.
|
||||
type ListenerConfigInterface interface {
|
||||
Create(*v1.ListenerConfig) (*v1.ListenerConfig, error)
|
||||
Update(*v1.ListenerConfig) (*v1.ListenerConfig, error)
|
||||
UpdateStatus(*v1.ListenerConfig) (*v1.ListenerConfig, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.ListenerConfig, error)
|
||||
List(opts metav1.ListOptions) (*v1.ListenerConfigList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ListenerConfig, err error)
|
||||
ListenerConfigExpansion
|
||||
}
|
||||
|
||||
// listenerConfigs implements ListenerConfigInterface
|
||||
type listenerConfigs struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newListenerConfigs returns a ListenerConfigs
|
||||
func newListenerConfigs(c *K3sV1Client, namespace string) *listenerConfigs {
|
||||
return &listenerConfigs{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the listenerConfig, and returns the corresponding listenerConfig object, and an error if there is any.
|
||||
func (c *listenerConfigs) Get(name string, options metav1.GetOptions) (result *v1.ListenerConfig, err error) {
|
||||
result = &v1.ListenerConfig{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("listenerconfigs").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ListenerConfigs that match those selectors.
|
||||
func (c *listenerConfigs) List(opts metav1.ListOptions) (result *v1.ListenerConfigList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1.ListenerConfigList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("listenerconfigs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested listenerConfigs.
|
||||
func (c *listenerConfigs) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("listenerconfigs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a listenerConfig and creates it. Returns the server's representation of the listenerConfig, and an error, if there is any.
|
||||
func (c *listenerConfigs) Create(listenerConfig *v1.ListenerConfig) (result *v1.ListenerConfig, err error) {
|
||||
result = &v1.ListenerConfig{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("listenerconfigs").
|
||||
Body(listenerConfig).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a listenerConfig and updates it. Returns the server's representation of the listenerConfig, and an error, if there is any.
|
||||
func (c *listenerConfigs) Update(listenerConfig *v1.ListenerConfig) (result *v1.ListenerConfig, err error) {
|
||||
result = &v1.ListenerConfig{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("listenerconfigs").
|
||||
Name(listenerConfig.Name).
|
||||
Body(listenerConfig).
|
||||
Do().
|
||||
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 *listenerConfigs) UpdateStatus(listenerConfig *v1.ListenerConfig) (result *v1.ListenerConfig, err error) {
|
||||
result = &v1.ListenerConfig{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("listenerconfigs").
|
||||
Name(listenerConfig.Name).
|
||||
SubResource("status").
|
||||
Body(listenerConfig).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the listenerConfig and deletes it. Returns an error if one occurs.
|
||||
func (c *listenerConfigs) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("listenerconfigs").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *listenerConfigs) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOptions.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("listenerconfigs").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched listenerConfig.
|
||||
func (c *listenerConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ListenerConfig, err error) {
|
||||
result = &v1.ListenerConfig{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("listenerconfigs").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
@ -27,7 +27,6 @@ import (
|
||||
|
||||
type Interface interface {
|
||||
Addon() AddonController
|
||||
ListenerConfig() ListenerConfigController
|
||||
}
|
||||
|
||||
func New(controllerManager *generic.ControllerManager, client clientset.K3sV1Interface,
|
||||
@ -48,6 +47,3 @@ type version struct {
|
||||
func (c *version) Addon() AddonController {
|
||||
return NewAddonController(v1.SchemeGroupVersion.WithKind("Addon"), c.controllerManager, c.client, c.informers.Addons())
|
||||
}
|
||||
func (c *version) ListenerConfig() ListenerConfigController {
|
||||
return NewListenerConfigController(v1.SchemeGroupVersion.WithKind("ListenerConfig"), c.controllerManager, c.client, c.informers.ListenerConfigs())
|
||||
}
|
||||
|
@ -1,242 +0,0 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed 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 main. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "github.com/rancher/k3s/pkg/apis/k3s.cattle.io/v1"
|
||||
clientset "github.com/rancher/k3s/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1"
|
||||
informers "github.com/rancher/k3s/pkg/generated/informers/externalversions/k3s.cattle.io/v1"
|
||||
listers "github.com/rancher/k3s/pkg/generated/listers/k3s.cattle.io/v1"
|
||||
"github.com/rancher/wrangler/pkg/generic"
|
||||
"k8s.io/apimachinery/pkg/api/equality"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
type ListenerConfigHandler func(string, *v1.ListenerConfig) (*v1.ListenerConfig, error)
|
||||
|
||||
type ListenerConfigController interface {
|
||||
ListenerConfigClient
|
||||
|
||||
OnChange(ctx context.Context, name string, sync ListenerConfigHandler)
|
||||
OnRemove(ctx context.Context, name string, sync ListenerConfigHandler)
|
||||
Enqueue(namespace, name string)
|
||||
|
||||
Cache() ListenerConfigCache
|
||||
|
||||
Informer() cache.SharedIndexInformer
|
||||
GroupVersionKind() schema.GroupVersionKind
|
||||
|
||||
AddGenericHandler(ctx context.Context, name string, handler generic.Handler)
|
||||
AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler)
|
||||
Updater() generic.Updater
|
||||
}
|
||||
|
||||
type ListenerConfigClient interface {
|
||||
Create(*v1.ListenerConfig) (*v1.ListenerConfig, error)
|
||||
Update(*v1.ListenerConfig) (*v1.ListenerConfig, error)
|
||||
UpdateStatus(*v1.ListenerConfig) (*v1.ListenerConfig, error)
|
||||
Delete(namespace, name string, options *metav1.DeleteOptions) error
|
||||
Get(namespace, name string, options metav1.GetOptions) (*v1.ListenerConfig, error)
|
||||
List(namespace string, opts metav1.ListOptions) (*v1.ListenerConfigList, error)
|
||||
Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ListenerConfig, err error)
|
||||
}
|
||||
|
||||
type ListenerConfigCache interface {
|
||||
Get(namespace, name string) (*v1.ListenerConfig, error)
|
||||
List(namespace string, selector labels.Selector) ([]*v1.ListenerConfig, error)
|
||||
|
||||
AddIndexer(indexName string, indexer ListenerConfigIndexer)
|
||||
GetByIndex(indexName, key string) ([]*v1.ListenerConfig, error)
|
||||
}
|
||||
|
||||
type ListenerConfigIndexer func(obj *v1.ListenerConfig) ([]string, error)
|
||||
|
||||
type listenerConfigController struct {
|
||||
controllerManager *generic.ControllerManager
|
||||
clientGetter clientset.ListenerConfigsGetter
|
||||
informer informers.ListenerConfigInformer
|
||||
gvk schema.GroupVersionKind
|
||||
}
|
||||
|
||||
func NewListenerConfigController(gvk schema.GroupVersionKind, controllerManager *generic.ControllerManager, clientGetter clientset.ListenerConfigsGetter, informer informers.ListenerConfigInformer) ListenerConfigController {
|
||||
return &listenerConfigController{
|
||||
controllerManager: controllerManager,
|
||||
clientGetter: clientGetter,
|
||||
informer: informer,
|
||||
gvk: gvk,
|
||||
}
|
||||
}
|
||||
|
||||
func FromListenerConfigHandlerToHandler(sync ListenerConfigHandler) generic.Handler {
|
||||
return func(key string, obj runtime.Object) (ret runtime.Object, err error) {
|
||||
var v *v1.ListenerConfig
|
||||
if obj == nil {
|
||||
v, err = sync(key, nil)
|
||||
} else {
|
||||
v, err = sync(key, obj.(*v1.ListenerConfig))
|
||||
}
|
||||
if v == nil {
|
||||
return nil, err
|
||||
}
|
||||
return v, err
|
||||
}
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) Updater() generic.Updater {
|
||||
return func(obj runtime.Object) (runtime.Object, error) {
|
||||
newObj, err := c.Update(obj.(*v1.ListenerConfig))
|
||||
if newObj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return newObj, err
|
||||
}
|
||||
}
|
||||
|
||||
func UpdateListenerConfigOnChange(updater generic.Updater, handler ListenerConfigHandler) ListenerConfigHandler {
|
||||
return func(key string, obj *v1.ListenerConfig) (*v1.ListenerConfig, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
}
|
||||
|
||||
copyObj := obj.DeepCopy()
|
||||
newObj, err := handler(key, copyObj)
|
||||
if newObj != nil {
|
||||
copyObj = newObj
|
||||
}
|
||||
if obj.ResourceVersion == copyObj.ResourceVersion && !equality.Semantic.DeepEqual(obj, copyObj) {
|
||||
newObj, err := updater(copyObj)
|
||||
if newObj != nil && err == nil {
|
||||
copyObj = newObj.(*v1.ListenerConfig)
|
||||
}
|
||||
}
|
||||
|
||||
return copyObj, err
|
||||
}
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) AddGenericHandler(ctx context.Context, name string, handler generic.Handler) {
|
||||
c.controllerManager.AddHandler(ctx, c.gvk, c.informer.Informer(), name, handler)
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler) {
|
||||
removeHandler := generic.NewRemoveHandler(name, c.Updater(), handler)
|
||||
c.controllerManager.AddHandler(ctx, c.gvk, c.informer.Informer(), name, removeHandler)
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) OnChange(ctx context.Context, name string, sync ListenerConfigHandler) {
|
||||
c.AddGenericHandler(ctx, name, FromListenerConfigHandlerToHandler(sync))
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) OnRemove(ctx context.Context, name string, sync ListenerConfigHandler) {
|
||||
removeHandler := generic.NewRemoveHandler(name, c.Updater(), FromListenerConfigHandlerToHandler(sync))
|
||||
c.AddGenericHandler(ctx, name, removeHandler)
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) Enqueue(namespace, name string) {
|
||||
c.controllerManager.Enqueue(c.gvk, c.informer.Informer(), namespace, name)
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) Informer() cache.SharedIndexInformer {
|
||||
return c.informer.Informer()
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) GroupVersionKind() schema.GroupVersionKind {
|
||||
return c.gvk
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) Cache() ListenerConfigCache {
|
||||
return &listenerConfigCache{
|
||||
lister: c.informer.Lister(),
|
||||
indexer: c.informer.Informer().GetIndexer(),
|
||||
}
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) Create(obj *v1.ListenerConfig) (*v1.ListenerConfig, error) {
|
||||
return c.clientGetter.ListenerConfigs(obj.Namespace).Create(obj)
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) Update(obj *v1.ListenerConfig) (*v1.ListenerConfig, error) {
|
||||
return c.clientGetter.ListenerConfigs(obj.Namespace).Update(obj)
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) UpdateStatus(obj *v1.ListenerConfig) (*v1.ListenerConfig, error) {
|
||||
return c.clientGetter.ListenerConfigs(obj.Namespace).UpdateStatus(obj)
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) Delete(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return c.clientGetter.ListenerConfigs(namespace).Delete(name, options)
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) Get(namespace, name string, options metav1.GetOptions) (*v1.ListenerConfig, error) {
|
||||
return c.clientGetter.ListenerConfigs(namespace).Get(name, options)
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) List(namespace string, opts metav1.ListOptions) (*v1.ListenerConfigList, error) {
|
||||
return c.clientGetter.ListenerConfigs(namespace).List(opts)
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.clientGetter.ListenerConfigs(namespace).Watch(opts)
|
||||
}
|
||||
|
||||
func (c *listenerConfigController) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ListenerConfig, err error) {
|
||||
return c.clientGetter.ListenerConfigs(namespace).Patch(name, pt, data, subresources...)
|
||||
}
|
||||
|
||||
type listenerConfigCache struct {
|
||||
lister listers.ListenerConfigLister
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
func (c *listenerConfigCache) Get(namespace, name string) (*v1.ListenerConfig, error) {
|
||||
return c.lister.ListenerConfigs(namespace).Get(name)
|
||||
}
|
||||
|
||||
func (c *listenerConfigCache) List(namespace string, selector labels.Selector) ([]*v1.ListenerConfig, error) {
|
||||
return c.lister.ListenerConfigs(namespace).List(selector)
|
||||
}
|
||||
|
||||
func (c *listenerConfigCache) AddIndexer(indexName string, indexer ListenerConfigIndexer) {
|
||||
utilruntime.Must(c.indexer.AddIndexers(map[string]cache.IndexFunc{
|
||||
indexName: func(obj interface{}) (strings []string, e error) {
|
||||
return indexer(obj.(*v1.ListenerConfig))
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
||||
func (c *listenerConfigCache) GetByIndex(indexName, key string) (result []*v1.ListenerConfig, err error) {
|
||||
objs, err := c.indexer.ByIndex(indexName, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range objs {
|
||||
result = append(result, obj.(*v1.ListenerConfig))
|
||||
}
|
||||
return result, nil
|
||||
}
|
@ -55,8 +55,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
// Group=k3s.cattle.io, Version=v1
|
||||
case v1.SchemeGroupVersion.WithResource("addons"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.K3s().V1().Addons().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("listenerconfigs"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.K3s().V1().ListenerConfigs().Informer()}, nil
|
||||
|
||||
}
|
||||
|
||||
|
@ -26,8 +26,6 @@ import (
|
||||
type Interface interface {
|
||||
// Addons returns a AddonInformer.
|
||||
Addons() AddonInformer
|
||||
// ListenerConfigs returns a ListenerConfigInformer.
|
||||
ListenerConfigs() ListenerConfigInformer
|
||||
}
|
||||
|
||||
type version struct {
|
||||
@ -45,8 +43,3 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
|
||||
func (v *version) Addons() AddonInformer {
|
||||
return &addonInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ListenerConfigs returns a ListenerConfigInformer.
|
||||
func (v *version) ListenerConfigs() ListenerConfigInformer {
|
||||
return &listenerConfigInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed 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 main. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
k3scattleiov1 "github.com/rancher/k3s/pkg/apis/k3s.cattle.io/v1"
|
||||
versioned "github.com/rancher/k3s/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/rancher/k3s/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/rancher/k3s/pkg/generated/listers/k3s.cattle.io/v1"
|
||||
metav1 "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"
|
||||
)
|
||||
|
||||
// ListenerConfigInformer provides access to a shared informer and lister for
|
||||
// ListenerConfigs.
|
||||
type ListenerConfigInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.ListenerConfigLister
|
||||
}
|
||||
|
||||
type listenerConfigInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewListenerConfigInformer constructs a new informer for ListenerConfig 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 NewListenerConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredListenerConfigInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredListenerConfigInformer constructs a new informer for ListenerConfig 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 NewFilteredListenerConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.K3sV1().ListenerConfigs(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.K3sV1().ListenerConfigs(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&k3scattleiov1.ListenerConfig{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *listenerConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredListenerConfigInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *listenerConfigInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&k3scattleiov1.ListenerConfig{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *listenerConfigInformer) Lister() v1.ListenerConfigLister {
|
||||
return v1.NewListenerConfigLister(f.Informer().GetIndexer())
|
||||
}
|
@ -25,11 +25,3 @@ type AddonListerExpansion interface{}
|
||||
// AddonNamespaceListerExpansion allows custom methods to be added to
|
||||
// AddonNamespaceLister.
|
||||
type AddonNamespaceListerExpansion interface{}
|
||||
|
||||
// ListenerConfigListerExpansion allows custom methods to be added to
|
||||
// ListenerConfigLister.
|
||||
type ListenerConfigListerExpansion interface{}
|
||||
|
||||
// ListenerConfigNamespaceListerExpansion allows custom methods to be added to
|
||||
// ListenerConfigNamespaceLister.
|
||||
type ListenerConfigNamespaceListerExpansion interface{}
|
||||
|
@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed 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 main. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/rancher/k3s/pkg/apis/k3s.cattle.io/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ListenerConfigLister helps list ListenerConfigs.
|
||||
type ListenerConfigLister interface {
|
||||
// List lists all ListenerConfigs in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1.ListenerConfig, err error)
|
||||
// ListenerConfigs returns an object that can list and get ListenerConfigs.
|
||||
ListenerConfigs(namespace string) ListenerConfigNamespaceLister
|
||||
ListenerConfigListerExpansion
|
||||
}
|
||||
|
||||
// listenerConfigLister implements the ListenerConfigLister interface.
|
||||
type listenerConfigLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewListenerConfigLister returns a new ListenerConfigLister.
|
||||
func NewListenerConfigLister(indexer cache.Indexer) ListenerConfigLister {
|
||||
return &listenerConfigLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all ListenerConfigs in the indexer.
|
||||
func (s *listenerConfigLister) List(selector labels.Selector) (ret []*v1.ListenerConfig, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.ListenerConfig))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// ListenerConfigs returns an object that can list and get ListenerConfigs.
|
||||
func (s *listenerConfigLister) ListenerConfigs(namespace string) ListenerConfigNamespaceLister {
|
||||
return listenerConfigNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// ListenerConfigNamespaceLister helps list and get ListenerConfigs.
|
||||
type ListenerConfigNamespaceLister interface {
|
||||
// List lists all ListenerConfigs in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1.ListenerConfig, err error)
|
||||
// Get retrieves the ListenerConfig from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1.ListenerConfig, error)
|
||||
ListenerConfigNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// listenerConfigNamespaceLister implements the ListenerConfigNamespaceLister
|
||||
// interface.
|
||||
type listenerConfigNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all ListenerConfigs in the indexer for a given namespace.
|
||||
func (s listenerConfigNamespaceLister) List(selector labels.Selector) (ret []*v1.ListenerConfig, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.ListenerConfig))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the ListenerConfig from the indexer for a given namespace and name.
|
||||
func (s listenerConfigNamespaceLister) Get(name string) (*v1.ListenerConfig, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("listenerconfig"), name)
|
||||
}
|
||||
return obj.(*v1.ListenerConfig), nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user