mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-09-29 11:15:51 +00:00
Add generated API/client code for new UpstreamOIDCProvider CRD.
Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
configv1alpha1 "go.pinniped.dev/generated/1.19/client/supervisor/clientset/versioned/typed/config/v1alpha1"
|
||||
idpv1alpha1 "go.pinniped.dev/generated/1.19/client/supervisor/clientset/versioned/typed/idp/v1alpha1"
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
rest "k8s.io/client-go/rest"
|
||||
flowcontrol "k8s.io/client-go/util/flowcontrol"
|
||||
@@ -17,6 +18,7 @@ import (
|
||||
type Interface interface {
|
||||
Discovery() discovery.DiscoveryInterface
|
||||
ConfigV1alpha1() configv1alpha1.ConfigV1alpha1Interface
|
||||
IDPV1alpha1() idpv1alpha1.IDPV1alpha1Interface
|
||||
}
|
||||
|
||||
// Clientset contains the clients for groups. Each group has exactly one
|
||||
@@ -24,6 +26,7 @@ type Interface interface {
|
||||
type Clientset struct {
|
||||
*discovery.DiscoveryClient
|
||||
configV1alpha1 *configv1alpha1.ConfigV1alpha1Client
|
||||
iDPV1alpha1 *idpv1alpha1.IDPV1alpha1Client
|
||||
}
|
||||
|
||||
// ConfigV1alpha1 retrieves the ConfigV1alpha1Client
|
||||
@@ -31,6 +34,11 @@ func (c *Clientset) ConfigV1alpha1() configv1alpha1.ConfigV1alpha1Interface {
|
||||
return c.configV1alpha1
|
||||
}
|
||||
|
||||
// IDPV1alpha1 retrieves the IDPV1alpha1Client
|
||||
func (c *Clientset) IDPV1alpha1() idpv1alpha1.IDPV1alpha1Interface {
|
||||
return c.iDPV1alpha1
|
||||
}
|
||||
|
||||
// Discovery retrieves the DiscoveryClient
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
if c == nil {
|
||||
@@ -56,6 +64,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.iDPV1alpha1, err = idpv1alpha1.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
@@ -69,6 +81,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
var cs Clientset
|
||||
cs.configV1alpha1 = configv1alpha1.NewForConfigOrDie(c)
|
||||
cs.iDPV1alpha1 = idpv1alpha1.NewForConfigOrDie(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
||||
return &cs
|
||||
@@ -78,6 +91,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
func New(c rest.Interface) *Clientset {
|
||||
var cs Clientset
|
||||
cs.configV1alpha1 = configv1alpha1.New(c)
|
||||
cs.iDPV1alpha1 = idpv1alpha1.New(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||
return &cs
|
||||
|
||||
+7
@@ -9,6 +9,8 @@ import (
|
||||
clientset "go.pinniped.dev/generated/1.19/client/supervisor/clientset/versioned"
|
||||
configv1alpha1 "go.pinniped.dev/generated/1.19/client/supervisor/clientset/versioned/typed/config/v1alpha1"
|
||||
fakeconfigv1alpha1 "go.pinniped.dev/generated/1.19/client/supervisor/clientset/versioned/typed/config/v1alpha1/fake"
|
||||
idpv1alpha1 "go.pinniped.dev/generated/1.19/client/supervisor/clientset/versioned/typed/idp/v1alpha1"
|
||||
fakeidpv1alpha1 "go.pinniped.dev/generated/1.19/client/supervisor/clientset/versioned/typed/idp/v1alpha1/fake"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/discovery"
|
||||
@@ -67,3 +69,8 @@ var _ clientset.Interface = &Clientset{}
|
||||
func (c *Clientset) ConfigV1alpha1() configv1alpha1.ConfigV1alpha1Interface {
|
||||
return &fakeconfigv1alpha1.FakeConfigV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// IDPV1alpha1 retrieves the IDPV1alpha1Client
|
||||
func (c *Clientset) IDPV1alpha1() idpv1alpha1.IDPV1alpha1Interface {
|
||||
return &fakeidpv1alpha1.FakeIDPV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ package fake
|
||||
|
||||
import (
|
||||
configv1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/config/v1alpha1"
|
||||
idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/idp/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
@@ -19,6 +20,7 @@ var codecs = serializer.NewCodecFactory(scheme)
|
||||
|
||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
configv1alpha1.AddToScheme,
|
||||
idpv1alpha1.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
|
||||
@@ -7,6 +7,7 @@ package scheme
|
||||
|
||||
import (
|
||||
configv1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/config/v1alpha1"
|
||||
idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/idp/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
@@ -19,6 +20,7 @@ var Codecs = serializer.NewCodecFactory(Scheme)
|
||||
var ParameterCodec = runtime.NewParameterCodec(Scheme)
|
||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
configv1alpha1.AddToScheme,
|
||||
idpv1alpha1.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha1
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
Generated
+27
@@ -0,0 +1,27 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1alpha1 "go.pinniped.dev/generated/1.19/client/supervisor/clientset/versioned/typed/idp/v1alpha1"
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
type FakeIDPV1alpha1 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeIDPV1alpha1) UpstreamOIDCProviders(namespace string) v1alpha1.UpstreamOIDCProviderInterface {
|
||||
return &FakeUpstreamOIDCProviders{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeIDPV1alpha1) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/idp/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"
|
||||
)
|
||||
|
||||
// FakeUpstreamOIDCProviders implements UpstreamOIDCProviderInterface
|
||||
type FakeUpstreamOIDCProviders struct {
|
||||
Fake *FakeIDPV1alpha1
|
||||
ns string
|
||||
}
|
||||
|
||||
var upstreamoidcprovidersResource = schema.GroupVersionResource{Group: "idp.supervisor.pinniped.dev", Version: "v1alpha1", Resource: "upstreamoidcproviders"}
|
||||
|
||||
var upstreamoidcprovidersKind = schema.GroupVersionKind{Group: "idp.supervisor.pinniped.dev", Version: "v1alpha1", Kind: "UpstreamOIDCProvider"}
|
||||
|
||||
// Get takes name of the upstreamOIDCProvider, and returns the corresponding upstreamOIDCProvider object, and an error if there is any.
|
||||
func (c *FakeUpstreamOIDCProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.UpstreamOIDCProvider, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(upstreamoidcprovidersResource, c.ns, name), &v1alpha1.UpstreamOIDCProvider{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.UpstreamOIDCProvider), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of UpstreamOIDCProviders that match those selectors.
|
||||
func (c *FakeUpstreamOIDCProviders) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.UpstreamOIDCProviderList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(upstreamoidcprovidersResource, upstreamoidcprovidersKind, c.ns, opts), &v1alpha1.UpstreamOIDCProviderList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.UpstreamOIDCProviderList{ListMeta: obj.(*v1alpha1.UpstreamOIDCProviderList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.UpstreamOIDCProviderList).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 upstreamOIDCProviders.
|
||||
func (c *FakeUpstreamOIDCProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(upstreamoidcprovidersResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a upstreamOIDCProvider and creates it. Returns the server's representation of the upstreamOIDCProvider, and an error, if there is any.
|
||||
func (c *FakeUpstreamOIDCProviders) Create(ctx context.Context, upstreamOIDCProvider *v1alpha1.UpstreamOIDCProvider, opts v1.CreateOptions) (result *v1alpha1.UpstreamOIDCProvider, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(upstreamoidcprovidersResource, c.ns, upstreamOIDCProvider), &v1alpha1.UpstreamOIDCProvider{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.UpstreamOIDCProvider), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a upstreamOIDCProvider and updates it. Returns the server's representation of the upstreamOIDCProvider, and an error, if there is any.
|
||||
func (c *FakeUpstreamOIDCProviders) Update(ctx context.Context, upstreamOIDCProvider *v1alpha1.UpstreamOIDCProvider, opts v1.UpdateOptions) (result *v1alpha1.UpstreamOIDCProvider, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(upstreamoidcprovidersResource, c.ns, upstreamOIDCProvider), &v1alpha1.UpstreamOIDCProvider{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.UpstreamOIDCProvider), 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 *FakeUpstreamOIDCProviders) UpdateStatus(ctx context.Context, upstreamOIDCProvider *v1alpha1.UpstreamOIDCProvider, opts v1.UpdateOptions) (*v1alpha1.UpstreamOIDCProvider, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(upstreamoidcprovidersResource, "status", c.ns, upstreamOIDCProvider), &v1alpha1.UpstreamOIDCProvider{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.UpstreamOIDCProvider), err
|
||||
}
|
||||
|
||||
// Delete takes name of the upstreamOIDCProvider and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeUpstreamOIDCProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(upstreamoidcprovidersResource, c.ns, name), &v1alpha1.UpstreamOIDCProvider{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeUpstreamOIDCProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(upstreamoidcprovidersResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.UpstreamOIDCProviderList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched upstreamOIDCProvider.
|
||||
func (c *FakeUpstreamOIDCProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.UpstreamOIDCProvider, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(upstreamoidcprovidersResource, c.ns, name, pt, data, subresources...), &v1alpha1.UpstreamOIDCProvider{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.UpstreamOIDCProvider), err
|
||||
}
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
type UpstreamOIDCProviderExpansion interface{}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/idp/v1alpha1"
|
||||
"go.pinniped.dev/generated/1.19/client/supervisor/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type IDPV1alpha1Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
UpstreamOIDCProvidersGetter
|
||||
}
|
||||
|
||||
// IDPV1alpha1Client is used to interact with features provided by the idp.supervisor.pinniped.dev group.
|
||||
type IDPV1alpha1Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *IDPV1alpha1Client) UpstreamOIDCProviders(namespace string) UpstreamOIDCProviderInterface {
|
||||
return newUpstreamOIDCProviders(c, namespace)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new IDPV1alpha1Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*IDPV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &IDPV1alpha1Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new IDPV1alpha1Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *IDPV1alpha1Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new IDPV1alpha1Client for the given RESTClient.
|
||||
func New(c rest.Interface) *IDPV1alpha1Client {
|
||||
return &IDPV1alpha1Client{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 *IDPV1alpha1Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
Generated
+182
@@ -0,0 +1,182 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/idp/v1alpha1"
|
||||
scheme "go.pinniped.dev/generated/1.19/client/supervisor/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"
|
||||
)
|
||||
|
||||
// UpstreamOIDCProvidersGetter has a method to return a UpstreamOIDCProviderInterface.
|
||||
// A group's client should implement this interface.
|
||||
type UpstreamOIDCProvidersGetter interface {
|
||||
UpstreamOIDCProviders(namespace string) UpstreamOIDCProviderInterface
|
||||
}
|
||||
|
||||
// UpstreamOIDCProviderInterface has methods to work with UpstreamOIDCProvider resources.
|
||||
type UpstreamOIDCProviderInterface interface {
|
||||
Create(ctx context.Context, upstreamOIDCProvider *v1alpha1.UpstreamOIDCProvider, opts v1.CreateOptions) (*v1alpha1.UpstreamOIDCProvider, error)
|
||||
Update(ctx context.Context, upstreamOIDCProvider *v1alpha1.UpstreamOIDCProvider, opts v1.UpdateOptions) (*v1alpha1.UpstreamOIDCProvider, error)
|
||||
UpdateStatus(ctx context.Context, upstreamOIDCProvider *v1alpha1.UpstreamOIDCProvider, opts v1.UpdateOptions) (*v1alpha1.UpstreamOIDCProvider, 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.UpstreamOIDCProvider, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.UpstreamOIDCProviderList, 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.UpstreamOIDCProvider, err error)
|
||||
UpstreamOIDCProviderExpansion
|
||||
}
|
||||
|
||||
// upstreamOIDCProviders implements UpstreamOIDCProviderInterface
|
||||
type upstreamOIDCProviders struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newUpstreamOIDCProviders returns a UpstreamOIDCProviders
|
||||
func newUpstreamOIDCProviders(c *IDPV1alpha1Client, namespace string) *upstreamOIDCProviders {
|
||||
return &upstreamOIDCProviders{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the upstreamOIDCProvider, and returns the corresponding upstreamOIDCProvider object, and an error if there is any.
|
||||
func (c *upstreamOIDCProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.UpstreamOIDCProvider, err error) {
|
||||
result = &v1alpha1.UpstreamOIDCProvider{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("upstreamoidcproviders").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of UpstreamOIDCProviders that match those selectors.
|
||||
func (c *upstreamOIDCProviders) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.UpstreamOIDCProviderList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha1.UpstreamOIDCProviderList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("upstreamoidcproviders").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested upstreamOIDCProviders.
|
||||
func (c *upstreamOIDCProviders) 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("upstreamoidcproviders").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a upstreamOIDCProvider and creates it. Returns the server's representation of the upstreamOIDCProvider, and an error, if there is any.
|
||||
func (c *upstreamOIDCProviders) Create(ctx context.Context, upstreamOIDCProvider *v1alpha1.UpstreamOIDCProvider, opts v1.CreateOptions) (result *v1alpha1.UpstreamOIDCProvider, err error) {
|
||||
result = &v1alpha1.UpstreamOIDCProvider{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("upstreamoidcproviders").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(upstreamOIDCProvider).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a upstreamOIDCProvider and updates it. Returns the server's representation of the upstreamOIDCProvider, and an error, if there is any.
|
||||
func (c *upstreamOIDCProviders) Update(ctx context.Context, upstreamOIDCProvider *v1alpha1.UpstreamOIDCProvider, opts v1.UpdateOptions) (result *v1alpha1.UpstreamOIDCProvider, err error) {
|
||||
result = &v1alpha1.UpstreamOIDCProvider{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("upstreamoidcproviders").
|
||||
Name(upstreamOIDCProvider.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(upstreamOIDCProvider).
|
||||
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 *upstreamOIDCProviders) UpdateStatus(ctx context.Context, upstreamOIDCProvider *v1alpha1.UpstreamOIDCProvider, opts v1.UpdateOptions) (result *v1alpha1.UpstreamOIDCProvider, err error) {
|
||||
result = &v1alpha1.UpstreamOIDCProvider{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("upstreamoidcproviders").
|
||||
Name(upstreamOIDCProvider.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(upstreamOIDCProvider).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the upstreamOIDCProvider and deletes it. Returns an error if one occurs.
|
||||
func (c *upstreamOIDCProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("upstreamoidcproviders").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *upstreamOIDCProviders) 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("upstreamoidcproviders").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched upstreamOIDCProvider.
|
||||
func (c *upstreamOIDCProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.UpstreamOIDCProvider, err error) {
|
||||
result = &v1alpha1.UpstreamOIDCProvider{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("upstreamoidcproviders").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
versioned "go.pinniped.dev/generated/1.19/client/supervisor/clientset/versioned"
|
||||
config "go.pinniped.dev/generated/1.19/client/supervisor/informers/externalversions/config"
|
||||
idp "go.pinniped.dev/generated/1.19/client/supervisor/informers/externalversions/idp"
|
||||
internalinterfaces "go.pinniped.dev/generated/1.19/client/supervisor/informers/externalversions/internalinterfaces"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -160,8 +161,13 @@ type SharedInformerFactory interface {
|
||||
WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
|
||||
|
||||
Config() config.Interface
|
||||
IDP() idp.Interface
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Config() config.Interface {
|
||||
return config.New(f, f.namespace, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) IDP() idp.Interface {
|
||||
return idp.New(f, f.namespace, f.tweakListOptions)
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
v1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/config/v1alpha1"
|
||||
idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/idp/v1alpha1"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
@@ -43,6 +44,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
case v1alpha1.SchemeGroupVersion.WithResource("oidcproviders"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1alpha1().OIDCProviders().Informer()}, nil
|
||||
|
||||
// Group=idp.supervisor.pinniped.dev, Version=v1alpha1
|
||||
case idpv1alpha1.SchemeGroupVersion.WithResource("upstreamoidcproviders"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.IDP().V1alpha1().UpstreamOIDCProviders().Informer()}, nil
|
||||
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("no informer found for %v", resource)
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package idp
|
||||
|
||||
import (
|
||||
v1alpha1 "go.pinniped.dev/generated/1.19/client/supervisor/informers/externalversions/idp/v1alpha1"
|
||||
internalinterfaces "go.pinniped.dev/generated/1.19/client/supervisor/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)
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
internalinterfaces "go.pinniped.dev/generated/1.19/client/supervisor/informers/externalversions/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// UpstreamOIDCProviders returns a UpstreamOIDCProviderInformer.
|
||||
UpstreamOIDCProviders() UpstreamOIDCProviderInformer
|
||||
}
|
||||
|
||||
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}
|
||||
}
|
||||
|
||||
// UpstreamOIDCProviders returns a UpstreamOIDCProviderInformer.
|
||||
func (v *version) UpstreamOIDCProviders() UpstreamOIDCProviderInformer {
|
||||
return &upstreamOIDCProviderInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
Generated
+77
@@ -0,0 +1,77 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
idpv1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/idp/v1alpha1"
|
||||
versioned "go.pinniped.dev/generated/1.19/client/supervisor/clientset/versioned"
|
||||
internalinterfaces "go.pinniped.dev/generated/1.19/client/supervisor/informers/externalversions/internalinterfaces"
|
||||
v1alpha1 "go.pinniped.dev/generated/1.19/client/supervisor/listers/idp/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"
|
||||
)
|
||||
|
||||
// UpstreamOIDCProviderInformer provides access to a shared informer and lister for
|
||||
// UpstreamOIDCProviders.
|
||||
type UpstreamOIDCProviderInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1alpha1.UpstreamOIDCProviderLister
|
||||
}
|
||||
|
||||
type upstreamOIDCProviderInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewUpstreamOIDCProviderInformer constructs a new informer for UpstreamOIDCProvider 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 NewUpstreamOIDCProviderInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredUpstreamOIDCProviderInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredUpstreamOIDCProviderInformer constructs a new informer for UpstreamOIDCProvider 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 NewFilteredUpstreamOIDCProviderInformer(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.IDPV1alpha1().UpstreamOIDCProviders(namespace).List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.IDPV1alpha1().UpstreamOIDCProviders(namespace).Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&idpv1alpha1.UpstreamOIDCProvider{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *upstreamOIDCProviderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredUpstreamOIDCProviderInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *upstreamOIDCProviderInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&idpv1alpha1.UpstreamOIDCProvider{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *upstreamOIDCProviderInformer) Lister() v1alpha1.UpstreamOIDCProviderLister {
|
||||
return v1alpha1.NewUpstreamOIDCProviderLister(f.Informer().GetIndexer())
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// UpstreamOIDCProviderListerExpansion allows custom methods to be added to
|
||||
// UpstreamOIDCProviderLister.
|
||||
type UpstreamOIDCProviderListerExpansion interface{}
|
||||
|
||||
// UpstreamOIDCProviderNamespaceListerExpansion allows custom methods to be added to
|
||||
// UpstreamOIDCProviderNamespaceLister.
|
||||
type UpstreamOIDCProviderNamespaceListerExpansion interface{}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1alpha1 "go.pinniped.dev/generated/1.19/apis/supervisor/idp/v1alpha1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// UpstreamOIDCProviderLister helps list UpstreamOIDCProviders.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type UpstreamOIDCProviderLister interface {
|
||||
// List lists all UpstreamOIDCProviders in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v1alpha1.UpstreamOIDCProvider, err error)
|
||||
// UpstreamOIDCProviders returns an object that can list and get UpstreamOIDCProviders.
|
||||
UpstreamOIDCProviders(namespace string) UpstreamOIDCProviderNamespaceLister
|
||||
UpstreamOIDCProviderListerExpansion
|
||||
}
|
||||
|
||||
// upstreamOIDCProviderLister implements the UpstreamOIDCProviderLister interface.
|
||||
type upstreamOIDCProviderLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewUpstreamOIDCProviderLister returns a new UpstreamOIDCProviderLister.
|
||||
func NewUpstreamOIDCProviderLister(indexer cache.Indexer) UpstreamOIDCProviderLister {
|
||||
return &upstreamOIDCProviderLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all UpstreamOIDCProviders in the indexer.
|
||||
func (s *upstreamOIDCProviderLister) List(selector labels.Selector) (ret []*v1alpha1.UpstreamOIDCProvider, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1alpha1.UpstreamOIDCProvider))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// UpstreamOIDCProviders returns an object that can list and get UpstreamOIDCProviders.
|
||||
func (s *upstreamOIDCProviderLister) UpstreamOIDCProviders(namespace string) UpstreamOIDCProviderNamespaceLister {
|
||||
return upstreamOIDCProviderNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// UpstreamOIDCProviderNamespaceLister helps list and get UpstreamOIDCProviders.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type UpstreamOIDCProviderNamespaceLister interface {
|
||||
// List lists all UpstreamOIDCProviders in the indexer for a given namespace.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v1alpha1.UpstreamOIDCProvider, err error)
|
||||
// Get retrieves the UpstreamOIDCProvider from the indexer for a given namespace and name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v1alpha1.UpstreamOIDCProvider, error)
|
||||
UpstreamOIDCProviderNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// upstreamOIDCProviderNamespaceLister implements the UpstreamOIDCProviderNamespaceLister
|
||||
// interface.
|
||||
type upstreamOIDCProviderNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all UpstreamOIDCProviders in the indexer for a given namespace.
|
||||
func (s upstreamOIDCProviderNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.UpstreamOIDCProvider, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1alpha1.UpstreamOIDCProvider))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the UpstreamOIDCProvider from the indexer for a given namespace and name.
|
||||
func (s upstreamOIDCProviderNamespaceLister) Get(name string) (*v1alpha1.UpstreamOIDCProvider, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1alpha1.Resource("upstreamoidcprovider"), name)
|
||||
}
|
||||
return obj.(*v1alpha1.UpstreamOIDCProvider), nil
|
||||
}
|
||||
Reference in New Issue
Block a user