Pull placeholder-name-client-go back into this repo as a library.

Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
Matt Moyer 2020-08-05 09:54:51 -05:00
parent 0b4590b237
commit ad55f9e310
40 changed files with 1886 additions and 11 deletions

3
go.mod
View File

@ -12,8 +12,8 @@ require (
github.com/stretchr/testify v1.6.1
github.com/suzerain-io/controller-go v0.0.0-20200730212956-7f99b569ca9f
github.com/suzerain-io/placeholder-name-api v0.0.0-20200731224558-ff85679d3364
github.com/suzerain-io/placeholder-name-client-go v0.0.0-20200731225637-b994efe19486
github.com/suzerain-io/placeholder-name/pkg/client v0.0.0-00010101000000-000000000000
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
k8s.io/api v0.19.0-rc.0
k8s.io/apimachinery v0.19.0-rc.0
k8s.io/apiserver v0.19.0-rc.0
@ -21,7 +21,6 @@ require (
k8s.io/component-base v0.19.0-rc.0
k8s.io/klog/v2 v2.2.0
k8s.io/kube-aggregator v0.19.0-rc.0
k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19
sigs.k8s.io/yaml v1.2.0
)

2
go.sum
View File

@ -534,8 +534,6 @@ github.com/suzerain-io/controller-go v0.0.0-20200730212956-7f99b569ca9f h1:gZ6rA
github.com/suzerain-io/controller-go v0.0.0-20200730212956-7f99b569ca9f/go.mod h1:+v9upryFWBJac6KXKlheGHr7e3kqpk1ldH1iIMFopMs=
github.com/suzerain-io/placeholder-name-api v0.0.0-20200731224558-ff85679d3364 h1:5NaQExCSh8+6YP3QNhWsWyMrEd+7zsnrznRlisydlZo=
github.com/suzerain-io/placeholder-name-api v0.0.0-20200731224558-ff85679d3364/go.mod h1:OuYBJDpMMnvMUoBn+XeMWtHghuYk0cq9bNkNa3T8j/g=
github.com/suzerain-io/placeholder-name-client-go v0.0.0-20200731225637-b994efe19486 h1:JOPwCoRjsUu8E/E81BolafPfovnTmxGAgFnEV0R8T3U=
github.com/suzerain-io/placeholder-name-client-go v0.0.0-20200731225637-b994efe19486/go.mod h1:0lk6jYt88I1632/5TIwpBPhQAewKuesNK+rKhfoegRk=
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2 h1:Xr9gkxfOP0KQWXKNqmwe8vEeSUiUj4Rlee9CMVX2ZUQ=
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
github.com/tetafro/godot v0.4.2 h1:Dib7un+rYJFUi8vN0Bk6EHheKy6fv6ZzFURHw75g6m8=

View File

@ -18,8 +18,8 @@ import (
"github.com/suzerain-io/controller-go"
crdsplaceholderv1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/crdsplaceholder/v1alpha1"
placeholderclientset "github.com/suzerain-io/placeholder-name-client-go/pkg/generated/clientset/versioned"
crdsplaceholderv1alpha1informers "github.com/suzerain-io/placeholder-name-client-go/pkg/generated/informers/externalversions/crdsplaceholder/v1alpha1"
placeholderclientset "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
crdsplaceholderv1alpha1informers "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/crdsplaceholder/v1alpha1"
)
const (

View File

@ -25,8 +25,8 @@ import (
"github.com/suzerain-io/controller-go"
crdsplaceholderv1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/crdsplaceholder/v1alpha1"
placeholderfake "github.com/suzerain-io/placeholder-name-client-go/pkg/generated/clientset/versioned/fake"
placeholderinformers "github.com/suzerain-io/placeholder-name-client-go/pkg/generated/informers/externalversions"
placeholderfake "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/fake"
placeholderinformers "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions"
)
type ObservableWithInformerOption struct {

View File

@ -29,8 +29,8 @@ import (
"github.com/suzerain-io/controller-go"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/placeholder/v1alpha1"
placeholderclientset "github.com/suzerain-io/placeholder-name-client-go/pkg/generated/clientset/versioned"
placeholderinformers "github.com/suzerain-io/placeholder-name-client-go/pkg/generated/informers/externalversions"
placeholderclientset "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
placeholderinformers "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions"
"github.com/suzerain-io/placeholder-name/internal/apiserver"
"github.com/suzerain-io/placeholder-name/internal/autoregistration"
"github.com/suzerain-io/placeholder-name/internal/certauthority"

View File

@ -0,0 +1,100 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package versioned
import (
"fmt"
crdsv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/crdsplaceholder/v1alpha1"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/placeholder/v1alpha1"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"
)
type Interface interface {
Discovery() discovery.DiscoveryInterface
CrdsV1alpha1() crdsv1alpha1.CrdsV1alpha1Interface
PlaceholderV1alpha1() placeholderv1alpha1.PlaceholderV1alpha1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
type Clientset struct {
*discovery.DiscoveryClient
crdsV1alpha1 *crdsv1alpha1.CrdsV1alpha1Client
placeholderV1alpha1 *placeholderv1alpha1.PlaceholderV1alpha1Client
}
// CrdsV1alpha1 retrieves the CrdsV1alpha1Client
func (c *Clientset) CrdsV1alpha1() crdsv1alpha1.CrdsV1alpha1Interface {
return c.crdsV1alpha1
}
// PlaceholderV1alpha1 retrieves the PlaceholderV1alpha1Client
func (c *Clientset) PlaceholderV1alpha1() placeholderv1alpha1.PlaceholderV1alpha1Interface {
return c.placeholderV1alpha1
}
// 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.crdsV1alpha1, err = crdsv1alpha1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.placeholderV1alpha1, err = placeholderv1alpha1.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.crdsV1alpha1 = crdsv1alpha1.NewForConfigOrDie(c)
cs.placeholderV1alpha1 = placeholderv1alpha1.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.crdsV1alpha1 = crdsv1alpha1.New(c)
cs.placeholderV1alpha1 = placeholderv1alpha1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs
}

View File

@ -0,0 +1,9 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated clientset.
package versioned

View File

@ -0,0 +1,78 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
clientset "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
crdsv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/crdsplaceholder/v1alpha1"
fakecrdsv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/crdsplaceholder/v1alpha1/fake"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/placeholder/v1alpha1"
fakeplaceholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/placeholder/v1alpha1/fake"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
// without applying any 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{}
// CrdsV1alpha1 retrieves the CrdsV1alpha1Client
func (c *Clientset) CrdsV1alpha1() crdsv1alpha1.CrdsV1alpha1Interface {
return &fakecrdsv1alpha1.FakeCrdsV1alpha1{Fake: &c.Fake}
}
// PlaceholderV1alpha1 retrieves the PlaceholderV1alpha1Client
func (c *Clientset) PlaceholderV1alpha1() placeholderv1alpha1.PlaceholderV1alpha1Interface {
return &fakeplaceholderv1alpha1.FakePlaceholderV1alpha1{Fake: &c.Fake}
}

View File

@ -0,0 +1,9 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated fake clientset.
package fake

View File

@ -0,0 +1,47 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
crdsv1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/crdsplaceholder/v1alpha1"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/placeholder/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
var scheme = runtime.NewScheme()
var codecs = serializer.NewCodecFactory(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
crdsv1alpha1.AddToScheme,
placeholderv1alpha1.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))
}

View File

@ -0,0 +1,9 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
// This package contains the scheme of the automatically generated clientset.
package scheme

View File

@ -0,0 +1,47 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package scheme
import (
crdsv1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/crdsplaceholder/v1alpha1"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/placeholder/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
var Scheme = runtime.NewScheme()
var Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
crdsv1alpha1.AddToScheme,
placeholderv1alpha1.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))
}

View File

@ -0,0 +1,78 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/crdsplaceholder/v1alpha1"
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)
type CrdsV1alpha1Interface interface {
RESTClient() rest.Interface
LoginDiscoveryConfigsGetter
}
// CrdsV1alpha1Client is used to interact with features provided by the crds.placeholder.suzerain-io.github.io group.
type CrdsV1alpha1Client struct {
restClient rest.Interface
}
func (c *CrdsV1alpha1Client) LoginDiscoveryConfigs(namespace string) LoginDiscoveryConfigInterface {
return newLoginDiscoveryConfigs(c, namespace)
}
// NewForConfig creates a new CrdsV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*CrdsV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &CrdsV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new CrdsV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *CrdsV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new CrdsV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *CrdsV1alpha1Client {
return &CrdsV1alpha1Client{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 *CrdsV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View File

@ -0,0 +1,9 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1

View File

@ -0,0 +1,9 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake

View File

@ -0,0 +1,29 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/crdsplaceholder/v1alpha1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeCrdsV1alpha1 struct {
*testing.Fake
}
func (c *FakeCrdsV1alpha1) LoginDiscoveryConfigs(namespace string) v1alpha1.LoginDiscoveryConfigInterface {
return &FakeLoginDiscoveryConfigs{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeCrdsV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View File

@ -0,0 +1,119 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/crdsplaceholder/v1alpha1"
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"
)
// FakeLoginDiscoveryConfigs implements LoginDiscoveryConfigInterface
type FakeLoginDiscoveryConfigs struct {
Fake *FakeCrdsV1alpha1
ns string
}
var logindiscoveryconfigsResource = schema.GroupVersionResource{Group: "crds.placeholder.suzerain-io.github.io", Version: "v1alpha1", Resource: "logindiscoveryconfigs"}
var logindiscoveryconfigsKind = schema.GroupVersionKind{Group: "crds.placeholder.suzerain-io.github.io", Version: "v1alpha1", Kind: "LoginDiscoveryConfig"}
// Get takes name of the loginDiscoveryConfig, and returns the corresponding loginDiscoveryConfig object, and an error if there is any.
func (c *FakeLoginDiscoveryConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LoginDiscoveryConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(logindiscoveryconfigsResource, c.ns, name), &v1alpha1.LoginDiscoveryConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginDiscoveryConfig), err
}
// List takes label and field selectors, and returns the list of LoginDiscoveryConfigs that match those selectors.
func (c *FakeLoginDiscoveryConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LoginDiscoveryConfigList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(logindiscoveryconfigsResource, logindiscoveryconfigsKind, c.ns, opts), &v1alpha1.LoginDiscoveryConfigList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.LoginDiscoveryConfigList{ListMeta: obj.(*v1alpha1.LoginDiscoveryConfigList).ListMeta}
for _, item := range obj.(*v1alpha1.LoginDiscoveryConfigList).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 loginDiscoveryConfigs.
func (c *FakeLoginDiscoveryConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(logindiscoveryconfigsResource, c.ns, opts))
}
// Create takes the representation of a loginDiscoveryConfig and creates it. Returns the server's representation of the loginDiscoveryConfig, and an error, if there is any.
func (c *FakeLoginDiscoveryConfigs) Create(ctx context.Context, loginDiscoveryConfig *v1alpha1.LoginDiscoveryConfig, opts v1.CreateOptions) (result *v1alpha1.LoginDiscoveryConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(logindiscoveryconfigsResource, c.ns, loginDiscoveryConfig), &v1alpha1.LoginDiscoveryConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginDiscoveryConfig), err
}
// Update takes the representation of a loginDiscoveryConfig and updates it. Returns the server's representation of the loginDiscoveryConfig, and an error, if there is any.
func (c *FakeLoginDiscoveryConfigs) Update(ctx context.Context, loginDiscoveryConfig *v1alpha1.LoginDiscoveryConfig, opts v1.UpdateOptions) (result *v1alpha1.LoginDiscoveryConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(logindiscoveryconfigsResource, c.ns, loginDiscoveryConfig), &v1alpha1.LoginDiscoveryConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginDiscoveryConfig), err
}
// Delete takes name of the loginDiscoveryConfig and deletes it. Returns an error if one occurs.
func (c *FakeLoginDiscoveryConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(logindiscoveryconfigsResource, c.ns, name), &v1alpha1.LoginDiscoveryConfig{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeLoginDiscoveryConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(logindiscoveryconfigsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.LoginDiscoveryConfigList{})
return err
}
// Patch applies the patch and returns the patched loginDiscoveryConfig.
func (c *FakeLoginDiscoveryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LoginDiscoveryConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(logindiscoveryconfigsResource, c.ns, name, pt, data, subresources...), &v1alpha1.LoginDiscoveryConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginDiscoveryConfig), err
}

View File

@ -0,0 +1,10 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
type LoginDiscoveryConfigExpansion interface{}

View File

@ -0,0 +1,167 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
v1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/crdsplaceholder/v1alpha1"
scheme "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/scheme"
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"
)
// LoginDiscoveryConfigsGetter has a method to return a LoginDiscoveryConfigInterface.
// A group's client should implement this interface.
type LoginDiscoveryConfigsGetter interface {
LoginDiscoveryConfigs(namespace string) LoginDiscoveryConfigInterface
}
// LoginDiscoveryConfigInterface has methods to work with LoginDiscoveryConfig resources.
type LoginDiscoveryConfigInterface interface {
Create(ctx context.Context, loginDiscoveryConfig *v1alpha1.LoginDiscoveryConfig, opts v1.CreateOptions) (*v1alpha1.LoginDiscoveryConfig, error)
Update(ctx context.Context, loginDiscoveryConfig *v1alpha1.LoginDiscoveryConfig, opts v1.UpdateOptions) (*v1alpha1.LoginDiscoveryConfig, 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.LoginDiscoveryConfig, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.LoginDiscoveryConfigList, 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.LoginDiscoveryConfig, err error)
LoginDiscoveryConfigExpansion
}
// loginDiscoveryConfigs implements LoginDiscoveryConfigInterface
type loginDiscoveryConfigs struct {
client rest.Interface
ns string
}
// newLoginDiscoveryConfigs returns a LoginDiscoveryConfigs
func newLoginDiscoveryConfigs(c *CrdsV1alpha1Client, namespace string) *loginDiscoveryConfigs {
return &loginDiscoveryConfigs{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the loginDiscoveryConfig, and returns the corresponding loginDiscoveryConfig object, and an error if there is any.
func (c *loginDiscoveryConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LoginDiscoveryConfig, err error) {
result = &v1alpha1.LoginDiscoveryConfig{}
err = c.client.Get().
Namespace(c.ns).
Resource("logindiscoveryconfigs").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of LoginDiscoveryConfigs that match those selectors.
func (c *loginDiscoveryConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LoginDiscoveryConfigList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.LoginDiscoveryConfigList{}
err = c.client.Get().
Namespace(c.ns).
Resource("logindiscoveryconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested loginDiscoveryConfigs.
func (c *loginDiscoveryConfigs) 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("logindiscoveryconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a loginDiscoveryConfig and creates it. Returns the server's representation of the loginDiscoveryConfig, and an error, if there is any.
func (c *loginDiscoveryConfigs) Create(ctx context.Context, loginDiscoveryConfig *v1alpha1.LoginDiscoveryConfig, opts v1.CreateOptions) (result *v1alpha1.LoginDiscoveryConfig, err error) {
result = &v1alpha1.LoginDiscoveryConfig{}
err = c.client.Post().
Namespace(c.ns).
Resource("logindiscoveryconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Body(loginDiscoveryConfig).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a loginDiscoveryConfig and updates it. Returns the server's representation of the loginDiscoveryConfig, and an error, if there is any.
func (c *loginDiscoveryConfigs) Update(ctx context.Context, loginDiscoveryConfig *v1alpha1.LoginDiscoveryConfig, opts v1.UpdateOptions) (result *v1alpha1.LoginDiscoveryConfig, err error) {
result = &v1alpha1.LoginDiscoveryConfig{}
err = c.client.Put().
Namespace(c.ns).
Resource("logindiscoveryconfigs").
Name(loginDiscoveryConfig.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(loginDiscoveryConfig).
Do(ctx).
Into(result)
return
}
// Delete takes name of the loginDiscoveryConfig and deletes it. Returns an error if one occurs.
func (c *loginDiscoveryConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("logindiscoveryconfigs").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *loginDiscoveryConfigs) 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("logindiscoveryconfigs").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched loginDiscoveryConfig.
func (c *loginDiscoveryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LoginDiscoveryConfig, err error) {
result = &v1alpha1.LoginDiscoveryConfig{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("logindiscoveryconfigs").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -0,0 +1,9 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1

View File

@ -0,0 +1,9 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake

View File

@ -0,0 +1,122 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/placeholder/v1alpha1"
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"
)
// FakeLoginRequests implements LoginRequestInterface
type FakeLoginRequests struct {
Fake *FakePlaceholderV1alpha1
}
var loginrequestsResource = schema.GroupVersionResource{Group: "placeholder.suzerain-io.github.io", Version: "v1alpha1", Resource: "loginrequests"}
var loginrequestsKind = schema.GroupVersionKind{Group: "placeholder.suzerain-io.github.io", Version: "v1alpha1", Kind: "LoginRequest"}
// Get takes name of the loginRequest, and returns the corresponding loginRequest object, and an error if there is any.
func (c *FakeLoginRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LoginRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(loginrequestsResource, name), &v1alpha1.LoginRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginRequest), err
}
// List takes label and field selectors, and returns the list of LoginRequests that match those selectors.
func (c *FakeLoginRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LoginRequestList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(loginrequestsResource, loginrequestsKind, opts), &v1alpha1.LoginRequestList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.LoginRequestList{ListMeta: obj.(*v1alpha1.LoginRequestList).ListMeta}
for _, item := range obj.(*v1alpha1.LoginRequestList).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 loginRequests.
func (c *FakeLoginRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(loginrequestsResource, opts))
}
// Create takes the representation of a loginRequest and creates it. Returns the server's representation of the loginRequest, and an error, if there is any.
func (c *FakeLoginRequests) Create(ctx context.Context, loginRequest *v1alpha1.LoginRequest, opts v1.CreateOptions) (result *v1alpha1.LoginRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(loginrequestsResource, loginRequest), &v1alpha1.LoginRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginRequest), err
}
// Update takes the representation of a loginRequest and updates it. Returns the server's representation of the loginRequest, and an error, if there is any.
func (c *FakeLoginRequests) Update(ctx context.Context, loginRequest *v1alpha1.LoginRequest, opts v1.UpdateOptions) (result *v1alpha1.LoginRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(loginrequestsResource, loginRequest), &v1alpha1.LoginRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginRequest), 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 *FakeLoginRequests) UpdateStatus(ctx context.Context, loginRequest *v1alpha1.LoginRequest, opts v1.UpdateOptions) (*v1alpha1.LoginRequest, error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(loginrequestsResource, "status", loginRequest), &v1alpha1.LoginRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginRequest), err
}
// Delete takes name of the loginRequest and deletes it. Returns an error if one occurs.
func (c *FakeLoginRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(loginrequestsResource, name), &v1alpha1.LoginRequest{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeLoginRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(loginrequestsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.LoginRequestList{})
return err
}
// Patch applies the patch and returns the patched loginRequest.
func (c *FakeLoginRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LoginRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(loginrequestsResource, name, pt, data, subresources...), &v1alpha1.LoginRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginRequest), err
}

View File

@ -0,0 +1,29 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/placeholder/v1alpha1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakePlaceholderV1alpha1 struct {
*testing.Fake
}
func (c *FakePlaceholderV1alpha1) LoginRequests() v1alpha1.LoginRequestInterface {
return &FakeLoginRequests{c}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakePlaceholderV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View File

@ -0,0 +1,10 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
type LoginRequestExpansion interface{}

View File

@ -0,0 +1,173 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
v1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/placeholder/v1alpha1"
scheme "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/scheme"
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"
)
// LoginRequestsGetter has a method to return a LoginRequestInterface.
// A group's client should implement this interface.
type LoginRequestsGetter interface {
LoginRequests() LoginRequestInterface
}
// LoginRequestInterface has methods to work with LoginRequest resources.
type LoginRequestInterface interface {
Create(ctx context.Context, loginRequest *v1alpha1.LoginRequest, opts v1.CreateOptions) (*v1alpha1.LoginRequest, error)
Update(ctx context.Context, loginRequest *v1alpha1.LoginRequest, opts v1.UpdateOptions) (*v1alpha1.LoginRequest, error)
UpdateStatus(ctx context.Context, loginRequest *v1alpha1.LoginRequest, opts v1.UpdateOptions) (*v1alpha1.LoginRequest, 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.LoginRequest, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.LoginRequestList, 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.LoginRequest, err error)
LoginRequestExpansion
}
// loginRequests implements LoginRequestInterface
type loginRequests struct {
client rest.Interface
}
// newLoginRequests returns a LoginRequests
func newLoginRequests(c *PlaceholderV1alpha1Client) *loginRequests {
return &loginRequests{
client: c.RESTClient(),
}
}
// Get takes name of the loginRequest, and returns the corresponding loginRequest object, and an error if there is any.
func (c *loginRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LoginRequest, err error) {
result = &v1alpha1.LoginRequest{}
err = c.client.Get().
Resource("loginrequests").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of LoginRequests that match those selectors.
func (c *loginRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LoginRequestList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.LoginRequestList{}
err = c.client.Get().
Resource("loginrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested loginRequests.
func (c *loginRequests) 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().
Resource("loginrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a loginRequest and creates it. Returns the server's representation of the loginRequest, and an error, if there is any.
func (c *loginRequests) Create(ctx context.Context, loginRequest *v1alpha1.LoginRequest, opts v1.CreateOptions) (result *v1alpha1.LoginRequest, err error) {
result = &v1alpha1.LoginRequest{}
err = c.client.Post().
Resource("loginrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Body(loginRequest).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a loginRequest and updates it. Returns the server's representation of the loginRequest, and an error, if there is any.
func (c *loginRequests) Update(ctx context.Context, loginRequest *v1alpha1.LoginRequest, opts v1.UpdateOptions) (result *v1alpha1.LoginRequest, err error) {
result = &v1alpha1.LoginRequest{}
err = c.client.Put().
Resource("loginrequests").
Name(loginRequest.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(loginRequest).
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 *loginRequests) UpdateStatus(ctx context.Context, loginRequest *v1alpha1.LoginRequest, opts v1.UpdateOptions) (result *v1alpha1.LoginRequest, err error) {
result = &v1alpha1.LoginRequest{}
err = c.client.Put().
Resource("loginrequests").
Name(loginRequest.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(loginRequest).
Do(ctx).
Into(result)
return
}
// Delete takes name of the loginRequest and deletes it. Returns an error if one occurs.
func (c *loginRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("loginrequests").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *loginRequests) 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().
Resource("loginrequests").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched loginRequest.
func (c *loginRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LoginRequest, err error) {
result = &v1alpha1.LoginRequest{}
err = c.client.Patch(pt).
Resource("loginrequests").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -0,0 +1,78 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/placeholder/v1alpha1"
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)
type PlaceholderV1alpha1Interface interface {
RESTClient() rest.Interface
LoginRequestsGetter
}
// PlaceholderV1alpha1Client is used to interact with features provided by the placeholder.suzerain-io.github.io group.
type PlaceholderV1alpha1Client struct {
restClient rest.Interface
}
func (c *PlaceholderV1alpha1Client) LoginRequests() LoginRequestInterface {
return newLoginRequests(c)
}
// NewForConfig creates a new PlaceholderV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*PlaceholderV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &PlaceholderV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new PlaceholderV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *PlaceholderV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new PlaceholderV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *PlaceholderV1alpha1Client {
return &PlaceholderV1alpha1Client{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 *PlaceholderV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View File

@ -0,0 +1,35 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by informer-gen. DO NOT EDIT.
package crdsplaceholder
import (
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/crdsplaceholder/v1alpha1"
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
)
// 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)
}

View File

@ -0,0 +1,34 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
)
// Interface provides access to all the informers in this group version.
type Interface interface {
// LoginDiscoveryConfigs returns a LoginDiscoveryConfigInformer.
LoginDiscoveryConfigs() LoginDiscoveryConfigInformer
}
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}
}
// LoginDiscoveryConfigs returns a LoginDiscoveryConfigInformer.
func (v *version) LoginDiscoveryConfigs() LoginDiscoveryConfigInformer {
return &loginDiscoveryConfigInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}

View File

@ -0,0 +1,79 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
crdsplaceholderv1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/crdsplaceholder/v1alpha1"
versioned "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/listers/crdsplaceholder/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// LoginDiscoveryConfigInformer provides access to a shared informer and lister for
// LoginDiscoveryConfigs.
type LoginDiscoveryConfigInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.LoginDiscoveryConfigLister
}
type loginDiscoveryConfigInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewLoginDiscoveryConfigInformer constructs a new informer for LoginDiscoveryConfig 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 NewLoginDiscoveryConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredLoginDiscoveryConfigInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredLoginDiscoveryConfigInformer constructs a new informer for LoginDiscoveryConfig 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 NewFilteredLoginDiscoveryConfigInformer(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.CrdsV1alpha1().LoginDiscoveryConfigs(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CrdsV1alpha1().LoginDiscoveryConfigs(namespace).Watch(context.TODO(), options)
},
},
&crdsplaceholderv1alpha1.LoginDiscoveryConfig{},
resyncPeriod,
indexers,
)
}
func (f *loginDiscoveryConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredLoginDiscoveryConfigInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *loginDiscoveryConfigInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&crdsplaceholderv1alpha1.LoginDiscoveryConfig{}, f.defaultInformer)
}
func (f *loginDiscoveryConfigInformer) Lister() v1alpha1.LoginDiscoveryConfigLister {
return v1alpha1.NewLoginDiscoveryConfigLister(f.Informer().GetIndexer())
}

View File

@ -0,0 +1,175 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by informer-gen. DO NOT EDIT.
package externalversions
import (
reflect "reflect"
sync "sync"
time "time"
versioned "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
crdsplaceholder "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/crdsplaceholder"
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
placeholder "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/placeholder"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
)
// SharedInformerOption defines the functional option type for SharedInformerFactory.
type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory
type sharedInformerFactory struct {
client versioned.Interface
namespace string
tweakListOptions internalinterfaces.TweakListOptionsFunc
lock sync.Mutex
defaultResync time.Duration
customResync map[reflect.Type]time.Duration
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
Crds() crdsplaceholder.Interface
Placeholder() placeholder.Interface
}
func (f *sharedInformerFactory) Crds() crdsplaceholder.Interface {
return crdsplaceholder.New(f, f.namespace, f.tweakListOptions)
}
func (f *sharedInformerFactory) Placeholder() placeholder.Interface {
return placeholder.New(f, f.namespace, f.tweakListOptions)
}

View File

@ -0,0 +1,56 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by informer-gen. DO NOT EDIT.
package externalversions
import (
"fmt"
v1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/crdsplaceholder/v1alpha1"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/placeholder/v1alpha1"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
)
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
// sharedInformers based on type
type GenericInformer interface {
Informer() cache.SharedIndexInformer
Lister() cache.GenericLister
}
type genericInformer struct {
informer cache.SharedIndexInformer
resource schema.GroupResource
}
// Informer returns the SharedIndexInformer.
func (f *genericInformer) Informer() cache.SharedIndexInformer {
return f.informer
}
// Lister returns the GenericLister.
func (f *genericInformer) Lister() cache.GenericLister {
return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource)
}
// ForResource gives generic access to a shared informer of the matching type
// TODO extend this to unknown resources with a client pool
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
switch resource {
// Group=crds.placeholder.suzerain-io.github.io, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("logindiscoveryconfigs"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Crds().V1alpha1().LoginDiscoveryConfigs().Informer()}, nil
// Group=placeholder.suzerain-io.github.io, Version=v1alpha1
case placeholderv1alpha1.SchemeGroupVersion.WithResource("loginrequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Placeholder().V1alpha1().LoginRequests().Informer()}, nil
}
return nil, fmt.Errorf("no informer found for %v", resource)
}

View File

@ -0,0 +1,29 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by informer-gen. DO NOT EDIT.
package internalinterfaces
import (
time "time"
versioned "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
cache "k8s.io/client-go/tools/cache"
)
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle
type SharedInformerFactory interface {
Start(stopCh <-chan struct{})
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
}
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions)

View File

@ -0,0 +1,35 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by informer-gen. DO NOT EDIT.
package placeholder
import (
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/placeholder/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)
}

View File

@ -0,0 +1,34 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
)
// Interface provides access to all the informers in this group version.
type Interface interface {
// LoginRequests returns a LoginRequestInformer.
LoginRequests() LoginRequestInformer
}
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}
}
// LoginRequests returns a LoginRequestInformer.
func (v *version) LoginRequests() LoginRequestInformer {
return &loginRequestInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}

View File

@ -0,0 +1,78 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/placeholder/v1alpha1"
versioned "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/listers/placeholder/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// LoginRequestInformer provides access to a shared informer and lister for
// LoginRequests.
type LoginRequestInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.LoginRequestLister
}
type loginRequestInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewLoginRequestInformer constructs a new informer for LoginRequest 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 NewLoginRequestInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredLoginRequestInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredLoginRequestInformer constructs a new informer for LoginRequest 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 NewFilteredLoginRequestInformer(client versioned.Interface, 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.PlaceholderV1alpha1().LoginRequests().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.PlaceholderV1alpha1().LoginRequests().Watch(context.TODO(), options)
},
},
&placeholderv1alpha1.LoginRequest{},
resyncPeriod,
indexers,
)
}
func (f *loginRequestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredLoginRequestInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *loginRequestInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&placeholderv1alpha1.LoginRequest{}, f.defaultInformer)
}
func (f *loginRequestInformer) Lister() v1alpha1.LoginRequestLister {
return v1alpha1.NewLoginRequestLister(f.Informer().GetIndexer())
}

View File

@ -0,0 +1,16 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
// LoginDiscoveryConfigListerExpansion allows custom methods to be added to
// LoginDiscoveryConfigLister.
type LoginDiscoveryConfigListerExpansion interface{}
// LoginDiscoveryConfigNamespaceListerExpansion allows custom methods to be added to
// LoginDiscoveryConfigNamespaceLister.
type LoginDiscoveryConfigNamespaceListerExpansion interface{}

View File

@ -0,0 +1,88 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/crdsplaceholder/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// LoginDiscoveryConfigLister helps list LoginDiscoveryConfigs.
// All objects returned here must be treated as read-only.
type LoginDiscoveryConfigLister interface {
// List lists all LoginDiscoveryConfigs in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.LoginDiscoveryConfig, err error)
// LoginDiscoveryConfigs returns an object that can list and get LoginDiscoveryConfigs.
LoginDiscoveryConfigs(namespace string) LoginDiscoveryConfigNamespaceLister
LoginDiscoveryConfigListerExpansion
}
// loginDiscoveryConfigLister implements the LoginDiscoveryConfigLister interface.
type loginDiscoveryConfigLister struct {
indexer cache.Indexer
}
// NewLoginDiscoveryConfigLister returns a new LoginDiscoveryConfigLister.
func NewLoginDiscoveryConfigLister(indexer cache.Indexer) LoginDiscoveryConfigLister {
return &loginDiscoveryConfigLister{indexer: indexer}
}
// List lists all LoginDiscoveryConfigs in the indexer.
func (s *loginDiscoveryConfigLister) List(selector labels.Selector) (ret []*v1alpha1.LoginDiscoveryConfig, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.LoginDiscoveryConfig))
})
return ret, err
}
// LoginDiscoveryConfigs returns an object that can list and get LoginDiscoveryConfigs.
func (s *loginDiscoveryConfigLister) LoginDiscoveryConfigs(namespace string) LoginDiscoveryConfigNamespaceLister {
return loginDiscoveryConfigNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// LoginDiscoveryConfigNamespaceLister helps list and get LoginDiscoveryConfigs.
// All objects returned here must be treated as read-only.
type LoginDiscoveryConfigNamespaceLister interface {
// List lists all LoginDiscoveryConfigs in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.LoginDiscoveryConfig, err error)
// Get retrieves the LoginDiscoveryConfig from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.LoginDiscoveryConfig, error)
LoginDiscoveryConfigNamespaceListerExpansion
}
// loginDiscoveryConfigNamespaceLister implements the LoginDiscoveryConfigNamespaceLister
// interface.
type loginDiscoveryConfigNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all LoginDiscoveryConfigs in the indexer for a given namespace.
func (s loginDiscoveryConfigNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.LoginDiscoveryConfig, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.LoginDiscoveryConfig))
})
return ret, err
}
// Get retrieves the LoginDiscoveryConfig from the indexer for a given namespace and name.
func (s loginDiscoveryConfigNamespaceLister) Get(name string) (*v1alpha1.LoginDiscoveryConfig, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("logindiscoveryconfig"), name)
}
return obj.(*v1alpha1.LoginDiscoveryConfig), nil
}

View File

@ -0,0 +1,12 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
// LoginRequestListerExpansion allows custom methods to be added to
// LoginRequestLister.
type LoginRequestListerExpansion interface{}

View File

@ -0,0 +1,57 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/placeholder/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// LoginRequestLister helps list LoginRequests.
// All objects returned here must be treated as read-only.
type LoginRequestLister interface {
// List lists all LoginRequests in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.LoginRequest, err error)
// Get retrieves the LoginRequest from the index for a given name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.LoginRequest, error)
LoginRequestListerExpansion
}
// loginRequestLister implements the LoginRequestLister interface.
type loginRequestLister struct {
indexer cache.Indexer
}
// NewLoginRequestLister returns a new LoginRequestLister.
func NewLoginRequestLister(indexer cache.Indexer) LoginRequestLister {
return &loginRequestLister{indexer: indexer}
}
// List lists all LoginRequests in the indexer.
func (s *loginRequestLister) List(selector labels.Selector) (ret []*v1alpha1.LoginRequest, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.LoginRequest))
})
return ret, err
}
// Get retrieves the LoginRequest from the index for a given name.
func (s *loginRequestLister) Get(name string) (*v1alpha1.LoginRequest, error) {
obj, exists, err := s.indexer.GetByKey(name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("loginrequest"), name)
}
return obj.(*v1alpha1.LoginRequest), nil
}

View File

@ -14,7 +14,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
placeholdernameclientset "github.com/suzerain-io/placeholder-name-client-go/pkg/generated/clientset/versioned"
placeholdernameclientset "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
)
func NewClientConfig(t *testing.T) *rest.Config {