Initial v1.0.0 commit

This commit is contained in:
Jakub Vavřík
2021-01-28 17:37:47 +01:00
commit 1481d27782
4164 changed files with 1264675 additions and 0 deletions

View File

@@ -0,0 +1,97 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package versioned
import (
"fmt"
fleetv1alpha1 "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/typed/fleet.cattle.io/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
FleetV1alpha1() fleetv1alpha1.FleetV1alpha1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
type Clientset struct {
*discovery.DiscoveryClient
fleetV1alpha1 *fleetv1alpha1.FleetV1alpha1Client
}
// FleetV1alpha1 retrieves the FleetV1alpha1Client
func (c *Clientset) FleetV1alpha1() fleetv1alpha1.FleetV1alpha1Interface {
return c.fleetV1alpha1
}
// 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.fleetV1alpha1, err = fleetv1alpha1.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.fleetV1alpha1 = fleetv1alpha1.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.fleetV1alpha1 = fleetv1alpha1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs
}

View File

@@ -0,0 +1,20 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated clientset.
package versioned

View File

@@ -0,0 +1,82 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
clientset "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned"
fleetv1alpha1 "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/typed/fleet.cattle.io/v1alpha1"
fakefleetv1alpha1 "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/typed/fleet.cattle.io/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{}
// FleetV1alpha1 retrieves the FleetV1alpha1Client
func (c *Clientset) FleetV1alpha1() fleetv1alpha1.FleetV1alpha1Interface {
return &fakefleetv1alpha1.FakeFleetV1alpha1{Fake: &c.Fake}
}

View File

@@ -0,0 +1,20 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated fake clientset.
package fake

View File

@@ -0,0 +1,56 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
fleetv1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/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{
fleetv1alpha1.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,20 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package contains the scheme of the automatically generated clientset.
package scheme

View File

@@ -0,0 +1,56 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package scheme
import (
fleetv1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/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{
fleetv1alpha1.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,195 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
scheme "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/scheme"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
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"
)
// BundlesGetter has a method to return a BundleInterface.
// A group's client should implement this interface.
type BundlesGetter interface {
Bundles(namespace string) BundleInterface
}
// BundleInterface has methods to work with Bundle resources.
type BundleInterface interface {
Create(ctx context.Context, bundle *v1alpha1.Bundle, opts v1.CreateOptions) (*v1alpha1.Bundle, error)
Update(ctx context.Context, bundle *v1alpha1.Bundle, opts v1.UpdateOptions) (*v1alpha1.Bundle, error)
UpdateStatus(ctx context.Context, bundle *v1alpha1.Bundle, opts v1.UpdateOptions) (*v1alpha1.Bundle, 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.Bundle, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BundleList, 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.Bundle, err error)
BundleExpansion
}
// bundles implements BundleInterface
type bundles struct {
client rest.Interface
ns string
}
// newBundles returns a Bundles
func newBundles(c *FleetV1alpha1Client, namespace string) *bundles {
return &bundles{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the bundle, and returns the corresponding bundle object, and an error if there is any.
func (c *bundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Bundle, err error) {
result = &v1alpha1.Bundle{}
err = c.client.Get().
Namespace(c.ns).
Resource("bundles").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Bundles that match those selectors.
func (c *bundles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BundleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.BundleList{}
err = c.client.Get().
Namespace(c.ns).
Resource("bundles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested bundles.
func (c *bundles) 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("bundles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a bundle and creates it. Returns the server's representation of the bundle, and an error, if there is any.
func (c *bundles) Create(ctx context.Context, bundle *v1alpha1.Bundle, opts v1.CreateOptions) (result *v1alpha1.Bundle, err error) {
result = &v1alpha1.Bundle{}
err = c.client.Post().
Namespace(c.ns).
Resource("bundles").
VersionedParams(&opts, scheme.ParameterCodec).
Body(bundle).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a bundle and updates it. Returns the server's representation of the bundle, and an error, if there is any.
func (c *bundles) Update(ctx context.Context, bundle *v1alpha1.Bundle, opts v1.UpdateOptions) (result *v1alpha1.Bundle, err error) {
result = &v1alpha1.Bundle{}
err = c.client.Put().
Namespace(c.ns).
Resource("bundles").
Name(bundle.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(bundle).
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 *bundles) UpdateStatus(ctx context.Context, bundle *v1alpha1.Bundle, opts v1.UpdateOptions) (result *v1alpha1.Bundle, err error) {
result = &v1alpha1.Bundle{}
err = c.client.Put().
Namespace(c.ns).
Resource("bundles").
Name(bundle.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(bundle).
Do(ctx).
Into(result)
return
}
// Delete takes name of the bundle and deletes it. Returns an error if one occurs.
func (c *bundles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("bundles").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *bundles) 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("bundles").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched bundle.
func (c *bundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Bundle, err error) {
result = &v1alpha1.Bundle{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("bundles").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -0,0 +1,195 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
scheme "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/scheme"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
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"
)
// BundleDeploymentsGetter has a method to return a BundleDeploymentInterface.
// A group's client should implement this interface.
type BundleDeploymentsGetter interface {
BundleDeployments(namespace string) BundleDeploymentInterface
}
// BundleDeploymentInterface has methods to work with BundleDeployment resources.
type BundleDeploymentInterface interface {
Create(ctx context.Context, bundleDeployment *v1alpha1.BundleDeployment, opts v1.CreateOptions) (*v1alpha1.BundleDeployment, error)
Update(ctx context.Context, bundleDeployment *v1alpha1.BundleDeployment, opts v1.UpdateOptions) (*v1alpha1.BundleDeployment, error)
UpdateStatus(ctx context.Context, bundleDeployment *v1alpha1.BundleDeployment, opts v1.UpdateOptions) (*v1alpha1.BundleDeployment, 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.BundleDeployment, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BundleDeploymentList, 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.BundleDeployment, err error)
BundleDeploymentExpansion
}
// bundleDeployments implements BundleDeploymentInterface
type bundleDeployments struct {
client rest.Interface
ns string
}
// newBundleDeployments returns a BundleDeployments
func newBundleDeployments(c *FleetV1alpha1Client, namespace string) *bundleDeployments {
return &bundleDeployments{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the bundleDeployment, and returns the corresponding bundleDeployment object, and an error if there is any.
func (c *bundleDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BundleDeployment, err error) {
result = &v1alpha1.BundleDeployment{}
err = c.client.Get().
Namespace(c.ns).
Resource("bundledeployments").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of BundleDeployments that match those selectors.
func (c *bundleDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BundleDeploymentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.BundleDeploymentList{}
err = c.client.Get().
Namespace(c.ns).
Resource("bundledeployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested bundleDeployments.
func (c *bundleDeployments) 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("bundledeployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a bundleDeployment and creates it. Returns the server's representation of the bundleDeployment, and an error, if there is any.
func (c *bundleDeployments) Create(ctx context.Context, bundleDeployment *v1alpha1.BundleDeployment, opts v1.CreateOptions) (result *v1alpha1.BundleDeployment, err error) {
result = &v1alpha1.BundleDeployment{}
err = c.client.Post().
Namespace(c.ns).
Resource("bundledeployments").
VersionedParams(&opts, scheme.ParameterCodec).
Body(bundleDeployment).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a bundleDeployment and updates it. Returns the server's representation of the bundleDeployment, and an error, if there is any.
func (c *bundleDeployments) Update(ctx context.Context, bundleDeployment *v1alpha1.BundleDeployment, opts v1.UpdateOptions) (result *v1alpha1.BundleDeployment, err error) {
result = &v1alpha1.BundleDeployment{}
err = c.client.Put().
Namespace(c.ns).
Resource("bundledeployments").
Name(bundleDeployment.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(bundleDeployment).
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 *bundleDeployments) UpdateStatus(ctx context.Context, bundleDeployment *v1alpha1.BundleDeployment, opts v1.UpdateOptions) (result *v1alpha1.BundleDeployment, err error) {
result = &v1alpha1.BundleDeployment{}
err = c.client.Put().
Namespace(c.ns).
Resource("bundledeployments").
Name(bundleDeployment.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(bundleDeployment).
Do(ctx).
Into(result)
return
}
// Delete takes name of the bundleDeployment and deletes it. Returns an error if one occurs.
func (c *bundleDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("bundledeployments").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *bundleDeployments) 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("bundledeployments").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched bundleDeployment.
func (c *bundleDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BundleDeployment, err error) {
result = &v1alpha1.BundleDeployment{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("bundledeployments").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -0,0 +1,178 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
scheme "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/scheme"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
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"
)
// BundleNamespaceMappingsGetter has a method to return a BundleNamespaceMappingInterface.
// A group's client should implement this interface.
type BundleNamespaceMappingsGetter interface {
BundleNamespaceMappings(namespace string) BundleNamespaceMappingInterface
}
// BundleNamespaceMappingInterface has methods to work with BundleNamespaceMapping resources.
type BundleNamespaceMappingInterface interface {
Create(ctx context.Context, bundleNamespaceMapping *v1alpha1.BundleNamespaceMapping, opts v1.CreateOptions) (*v1alpha1.BundleNamespaceMapping, error)
Update(ctx context.Context, bundleNamespaceMapping *v1alpha1.BundleNamespaceMapping, opts v1.UpdateOptions) (*v1alpha1.BundleNamespaceMapping, 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.BundleNamespaceMapping, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BundleNamespaceMappingList, 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.BundleNamespaceMapping, err error)
BundleNamespaceMappingExpansion
}
// bundleNamespaceMappings implements BundleNamespaceMappingInterface
type bundleNamespaceMappings struct {
client rest.Interface
ns string
}
// newBundleNamespaceMappings returns a BundleNamespaceMappings
func newBundleNamespaceMappings(c *FleetV1alpha1Client, namespace string) *bundleNamespaceMappings {
return &bundleNamespaceMappings{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the bundleNamespaceMapping, and returns the corresponding bundleNamespaceMapping object, and an error if there is any.
func (c *bundleNamespaceMappings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BundleNamespaceMapping, err error) {
result = &v1alpha1.BundleNamespaceMapping{}
err = c.client.Get().
Namespace(c.ns).
Resource("bundlenamespacemappings").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of BundleNamespaceMappings that match those selectors.
func (c *bundleNamespaceMappings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BundleNamespaceMappingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.BundleNamespaceMappingList{}
err = c.client.Get().
Namespace(c.ns).
Resource("bundlenamespacemappings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested bundleNamespaceMappings.
func (c *bundleNamespaceMappings) 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("bundlenamespacemappings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a bundleNamespaceMapping and creates it. Returns the server's representation of the bundleNamespaceMapping, and an error, if there is any.
func (c *bundleNamespaceMappings) Create(ctx context.Context, bundleNamespaceMapping *v1alpha1.BundleNamespaceMapping, opts v1.CreateOptions) (result *v1alpha1.BundleNamespaceMapping, err error) {
result = &v1alpha1.BundleNamespaceMapping{}
err = c.client.Post().
Namespace(c.ns).
Resource("bundlenamespacemappings").
VersionedParams(&opts, scheme.ParameterCodec).
Body(bundleNamespaceMapping).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a bundleNamespaceMapping and updates it. Returns the server's representation of the bundleNamespaceMapping, and an error, if there is any.
func (c *bundleNamespaceMappings) Update(ctx context.Context, bundleNamespaceMapping *v1alpha1.BundleNamespaceMapping, opts v1.UpdateOptions) (result *v1alpha1.BundleNamespaceMapping, err error) {
result = &v1alpha1.BundleNamespaceMapping{}
err = c.client.Put().
Namespace(c.ns).
Resource("bundlenamespacemappings").
Name(bundleNamespaceMapping.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(bundleNamespaceMapping).
Do(ctx).
Into(result)
return
}
// Delete takes name of the bundleNamespaceMapping and deletes it. Returns an error if one occurs.
func (c *bundleNamespaceMappings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("bundlenamespacemappings").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *bundleNamespaceMappings) 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("bundlenamespacemappings").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched bundleNamespaceMapping.
func (c *bundleNamespaceMappings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BundleNamespaceMapping, err error) {
result = &v1alpha1.BundleNamespaceMapping{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("bundlenamespacemappings").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -0,0 +1,195 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
scheme "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/scheme"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
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"
)
// ClustersGetter has a method to return a ClusterInterface.
// A group's client should implement this interface.
type ClustersGetter interface {
Clusters(namespace string) ClusterInterface
}
// ClusterInterface has methods to work with Cluster resources.
type ClusterInterface interface {
Create(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.CreateOptions) (*v1alpha1.Cluster, error)
Update(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (*v1alpha1.Cluster, error)
UpdateStatus(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (*v1alpha1.Cluster, 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.Cluster, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterList, 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.Cluster, err error)
ClusterExpansion
}
// clusters implements ClusterInterface
type clusters struct {
client rest.Interface
ns string
}
// newClusters returns a Clusters
func newClusters(c *FleetV1alpha1Client, namespace string) *clusters {
return &clusters{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
func (c *clusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Get().
Namespace(c.ns).
Resource("clusters").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
func (c *clusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterList{}
err = c.client.Get().
Namespace(c.ns).
Resource("clusters").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusters.
func (c *clusters) 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("clusters").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *clusters) Create(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.CreateOptions) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Post().
Namespace(c.ns).
Resource("clusters").
VersionedParams(&opts, scheme.ParameterCodec).
Body(cluster).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *clusters) Update(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Put().
Namespace(c.ns).
Resource("clusters").
Name(cluster.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(cluster).
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 *clusters) UpdateStatus(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Put().
Namespace(c.ns).
Resource("clusters").
Name(cluster.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(cluster).
Do(ctx).
Into(result)
return
}
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
func (c *clusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("clusters").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *clusters) 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("clusters").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched cluster.
func (c *clusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error) {
result = &v1alpha1.Cluster{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("clusters").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -0,0 +1,195 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
scheme "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/scheme"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
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"
)
// ClusterGroupsGetter has a method to return a ClusterGroupInterface.
// A group's client should implement this interface.
type ClusterGroupsGetter interface {
ClusterGroups(namespace string) ClusterGroupInterface
}
// ClusterGroupInterface has methods to work with ClusterGroup resources.
type ClusterGroupInterface interface {
Create(ctx context.Context, clusterGroup *v1alpha1.ClusterGroup, opts v1.CreateOptions) (*v1alpha1.ClusterGroup, error)
Update(ctx context.Context, clusterGroup *v1alpha1.ClusterGroup, opts v1.UpdateOptions) (*v1alpha1.ClusterGroup, error)
UpdateStatus(ctx context.Context, clusterGroup *v1alpha1.ClusterGroup, opts v1.UpdateOptions) (*v1alpha1.ClusterGroup, 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.ClusterGroup, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterGroupList, 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.ClusterGroup, err error)
ClusterGroupExpansion
}
// clusterGroups implements ClusterGroupInterface
type clusterGroups struct {
client rest.Interface
ns string
}
// newClusterGroups returns a ClusterGroups
func newClusterGroups(c *FleetV1alpha1Client, namespace string) *clusterGroups {
return &clusterGroups{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the clusterGroup, and returns the corresponding clusterGroup object, and an error if there is any.
func (c *clusterGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterGroup, err error) {
result = &v1alpha1.ClusterGroup{}
err = c.client.Get().
Namespace(c.ns).
Resource("clustergroups").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of ClusterGroups that match those selectors.
func (c *clusterGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterGroupList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterGroupList{}
err = c.client.Get().
Namespace(c.ns).
Resource("clustergroups").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterGroups.
func (c *clusterGroups) 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("clustergroups").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a clusterGroup and creates it. Returns the server's representation of the clusterGroup, and an error, if there is any.
func (c *clusterGroups) Create(ctx context.Context, clusterGroup *v1alpha1.ClusterGroup, opts v1.CreateOptions) (result *v1alpha1.ClusterGroup, err error) {
result = &v1alpha1.ClusterGroup{}
err = c.client.Post().
Namespace(c.ns).
Resource("clustergroups").
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterGroup).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a clusterGroup and updates it. Returns the server's representation of the clusterGroup, and an error, if there is any.
func (c *clusterGroups) Update(ctx context.Context, clusterGroup *v1alpha1.ClusterGroup, opts v1.UpdateOptions) (result *v1alpha1.ClusterGroup, err error) {
result = &v1alpha1.ClusterGroup{}
err = c.client.Put().
Namespace(c.ns).
Resource("clustergroups").
Name(clusterGroup.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterGroup).
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 *clusterGroups) UpdateStatus(ctx context.Context, clusterGroup *v1alpha1.ClusterGroup, opts v1.UpdateOptions) (result *v1alpha1.ClusterGroup, err error) {
result = &v1alpha1.ClusterGroup{}
err = c.client.Put().
Namespace(c.ns).
Resource("clustergroups").
Name(clusterGroup.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterGroup).
Do(ctx).
Into(result)
return
}
// Delete takes name of the clusterGroup and deletes it. Returns an error if one occurs.
func (c *clusterGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("clustergroups").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *clusterGroups) 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("clustergroups").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched clusterGroup.
func (c *clusterGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterGroup, err error) {
result = &v1alpha1.ClusterGroup{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("clustergroups").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -0,0 +1,195 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
scheme "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/scheme"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
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"
)
// ClusterRegistrationsGetter has a method to return a ClusterRegistrationInterface.
// A group's client should implement this interface.
type ClusterRegistrationsGetter interface {
ClusterRegistrations(namespace string) ClusterRegistrationInterface
}
// ClusterRegistrationInterface has methods to work with ClusterRegistration resources.
type ClusterRegistrationInterface interface {
Create(ctx context.Context, clusterRegistration *v1alpha1.ClusterRegistration, opts v1.CreateOptions) (*v1alpha1.ClusterRegistration, error)
Update(ctx context.Context, clusterRegistration *v1alpha1.ClusterRegistration, opts v1.UpdateOptions) (*v1alpha1.ClusterRegistration, error)
UpdateStatus(ctx context.Context, clusterRegistration *v1alpha1.ClusterRegistration, opts v1.UpdateOptions) (*v1alpha1.ClusterRegistration, 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.ClusterRegistration, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRegistrationList, 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.ClusterRegistration, err error)
ClusterRegistrationExpansion
}
// clusterRegistrations implements ClusterRegistrationInterface
type clusterRegistrations struct {
client rest.Interface
ns string
}
// newClusterRegistrations returns a ClusterRegistrations
func newClusterRegistrations(c *FleetV1alpha1Client, namespace string) *clusterRegistrations {
return &clusterRegistrations{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the clusterRegistration, and returns the corresponding clusterRegistration object, and an error if there is any.
func (c *clusterRegistrations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRegistration, err error) {
result = &v1alpha1.ClusterRegistration{}
err = c.client.Get().
Namespace(c.ns).
Resource("clusterregistrations").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of ClusterRegistrations that match those selectors.
func (c *clusterRegistrations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRegistrationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterRegistrationList{}
err = c.client.Get().
Namespace(c.ns).
Resource("clusterregistrations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterRegistrations.
func (c *clusterRegistrations) 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("clusterregistrations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a clusterRegistration and creates it. Returns the server's representation of the clusterRegistration, and an error, if there is any.
func (c *clusterRegistrations) Create(ctx context.Context, clusterRegistration *v1alpha1.ClusterRegistration, opts v1.CreateOptions) (result *v1alpha1.ClusterRegistration, err error) {
result = &v1alpha1.ClusterRegistration{}
err = c.client.Post().
Namespace(c.ns).
Resource("clusterregistrations").
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterRegistration).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a clusterRegistration and updates it. Returns the server's representation of the clusterRegistration, and an error, if there is any.
func (c *clusterRegistrations) Update(ctx context.Context, clusterRegistration *v1alpha1.ClusterRegistration, opts v1.UpdateOptions) (result *v1alpha1.ClusterRegistration, err error) {
result = &v1alpha1.ClusterRegistration{}
err = c.client.Put().
Namespace(c.ns).
Resource("clusterregistrations").
Name(clusterRegistration.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterRegistration).
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 *clusterRegistrations) UpdateStatus(ctx context.Context, clusterRegistration *v1alpha1.ClusterRegistration, opts v1.UpdateOptions) (result *v1alpha1.ClusterRegistration, err error) {
result = &v1alpha1.ClusterRegistration{}
err = c.client.Put().
Namespace(c.ns).
Resource("clusterregistrations").
Name(clusterRegistration.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterRegistration).
Do(ctx).
Into(result)
return
}
// Delete takes name of the clusterRegistration and deletes it. Returns an error if one occurs.
func (c *clusterRegistrations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("clusterregistrations").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *clusterRegistrations) 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("clusterregistrations").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched clusterRegistration.
func (c *clusterRegistrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRegistration, err error) {
result = &v1alpha1.ClusterRegistration{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("clusterregistrations").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -0,0 +1,195 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
scheme "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/scheme"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
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"
)
// ClusterRegistrationTokensGetter has a method to return a ClusterRegistrationTokenInterface.
// A group's client should implement this interface.
type ClusterRegistrationTokensGetter interface {
ClusterRegistrationTokens(namespace string) ClusterRegistrationTokenInterface
}
// ClusterRegistrationTokenInterface has methods to work with ClusterRegistrationToken resources.
type ClusterRegistrationTokenInterface interface {
Create(ctx context.Context, clusterRegistrationToken *v1alpha1.ClusterRegistrationToken, opts v1.CreateOptions) (*v1alpha1.ClusterRegistrationToken, error)
Update(ctx context.Context, clusterRegistrationToken *v1alpha1.ClusterRegistrationToken, opts v1.UpdateOptions) (*v1alpha1.ClusterRegistrationToken, error)
UpdateStatus(ctx context.Context, clusterRegistrationToken *v1alpha1.ClusterRegistrationToken, opts v1.UpdateOptions) (*v1alpha1.ClusterRegistrationToken, 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.ClusterRegistrationToken, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRegistrationTokenList, 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.ClusterRegistrationToken, err error)
ClusterRegistrationTokenExpansion
}
// clusterRegistrationTokens implements ClusterRegistrationTokenInterface
type clusterRegistrationTokens struct {
client rest.Interface
ns string
}
// newClusterRegistrationTokens returns a ClusterRegistrationTokens
func newClusterRegistrationTokens(c *FleetV1alpha1Client, namespace string) *clusterRegistrationTokens {
return &clusterRegistrationTokens{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the clusterRegistrationToken, and returns the corresponding clusterRegistrationToken object, and an error if there is any.
func (c *clusterRegistrationTokens) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRegistrationToken, err error) {
result = &v1alpha1.ClusterRegistrationToken{}
err = c.client.Get().
Namespace(c.ns).
Resource("clusterregistrationtokens").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of ClusterRegistrationTokens that match those selectors.
func (c *clusterRegistrationTokens) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRegistrationTokenList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterRegistrationTokenList{}
err = c.client.Get().
Namespace(c.ns).
Resource("clusterregistrationtokens").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterRegistrationTokens.
func (c *clusterRegistrationTokens) 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("clusterregistrationtokens").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a clusterRegistrationToken and creates it. Returns the server's representation of the clusterRegistrationToken, and an error, if there is any.
func (c *clusterRegistrationTokens) Create(ctx context.Context, clusterRegistrationToken *v1alpha1.ClusterRegistrationToken, opts v1.CreateOptions) (result *v1alpha1.ClusterRegistrationToken, err error) {
result = &v1alpha1.ClusterRegistrationToken{}
err = c.client.Post().
Namespace(c.ns).
Resource("clusterregistrationtokens").
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterRegistrationToken).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a clusterRegistrationToken and updates it. Returns the server's representation of the clusterRegistrationToken, and an error, if there is any.
func (c *clusterRegistrationTokens) Update(ctx context.Context, clusterRegistrationToken *v1alpha1.ClusterRegistrationToken, opts v1.UpdateOptions) (result *v1alpha1.ClusterRegistrationToken, err error) {
result = &v1alpha1.ClusterRegistrationToken{}
err = c.client.Put().
Namespace(c.ns).
Resource("clusterregistrationtokens").
Name(clusterRegistrationToken.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterRegistrationToken).
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 *clusterRegistrationTokens) UpdateStatus(ctx context.Context, clusterRegistrationToken *v1alpha1.ClusterRegistrationToken, opts v1.UpdateOptions) (result *v1alpha1.ClusterRegistrationToken, err error) {
result = &v1alpha1.ClusterRegistrationToken{}
err = c.client.Put().
Namespace(c.ns).
Resource("clusterregistrationtokens").
Name(clusterRegistrationToken.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(clusterRegistrationToken).
Do(ctx).
Into(result)
return
}
// Delete takes name of the clusterRegistrationToken and deletes it. Returns an error if one occurs.
func (c *clusterRegistrationTokens) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("clusterregistrationtokens").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *clusterRegistrationTokens) 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("clusterregistrationtokens").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched clusterRegistrationToken.
func (c *clusterRegistrationTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRegistrationToken, err error) {
result = &v1alpha1.ClusterRegistrationToken{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("clusterregistrationtokens").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -0,0 +1,168 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
scheme "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/scheme"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
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"
)
// ContentsGetter has a method to return a ContentInterface.
// A group's client should implement this interface.
type ContentsGetter interface {
Contents() ContentInterface
}
// ContentInterface has methods to work with Content resources.
type ContentInterface interface {
Create(ctx context.Context, content *v1alpha1.Content, opts v1.CreateOptions) (*v1alpha1.Content, error)
Update(ctx context.Context, content *v1alpha1.Content, opts v1.UpdateOptions) (*v1alpha1.Content, 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.Content, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ContentList, 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.Content, err error)
ContentExpansion
}
// contents implements ContentInterface
type contents struct {
client rest.Interface
}
// newContents returns a Contents
func newContents(c *FleetV1alpha1Client) *contents {
return &contents{
client: c.RESTClient(),
}
}
// Get takes name of the content, and returns the corresponding content object, and an error if there is any.
func (c *contents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Content, err error) {
result = &v1alpha1.Content{}
err = c.client.Get().
Resource("contents").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Contents that match those selectors.
func (c *contents) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ContentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ContentList{}
err = c.client.Get().
Resource("contents").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested contents.
func (c *contents) 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("contents").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a content and creates it. Returns the server's representation of the content, and an error, if there is any.
func (c *contents) Create(ctx context.Context, content *v1alpha1.Content, opts v1.CreateOptions) (result *v1alpha1.Content, err error) {
result = &v1alpha1.Content{}
err = c.client.Post().
Resource("contents").
VersionedParams(&opts, scheme.ParameterCodec).
Body(content).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a content and updates it. Returns the server's representation of the content, and an error, if there is any.
func (c *contents) Update(ctx context.Context, content *v1alpha1.Content, opts v1.UpdateOptions) (result *v1alpha1.Content, err error) {
result = &v1alpha1.Content{}
err = c.client.Put().
Resource("contents").
Name(content.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(content).
Do(ctx).
Into(result)
return
}
// Delete takes name of the content and deletes it. Returns an error if one occurs.
func (c *contents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("contents").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *contents) 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("contents").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched content.
func (c *contents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Content, err error) {
result = &v1alpha1.Content{}
err = c.client.Patch(pt).
Resource("contents").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -0,0 +1,20 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1

View File

@@ -0,0 +1,20 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake

View File

@@ -0,0 +1,142 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/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"
)
// FakeBundles implements BundleInterface
type FakeBundles struct {
Fake *FakeFleetV1alpha1
ns string
}
var bundlesResource = schema.GroupVersionResource{Group: "fleet.cattle.io", Version: "v1alpha1", Resource: "bundles"}
var bundlesKind = schema.GroupVersionKind{Group: "fleet.cattle.io", Version: "v1alpha1", Kind: "Bundle"}
// Get takes name of the bundle, and returns the corresponding bundle object, and an error if there is any.
func (c *FakeBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Bundle, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(bundlesResource, c.ns, name), &v1alpha1.Bundle{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Bundle), err
}
// List takes label and field selectors, and returns the list of Bundles that match those selectors.
func (c *FakeBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BundleList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(bundlesResource, bundlesKind, c.ns, opts), &v1alpha1.BundleList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.BundleList{ListMeta: obj.(*v1alpha1.BundleList).ListMeta}
for _, item := range obj.(*v1alpha1.BundleList).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 bundles.
func (c *FakeBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(bundlesResource, c.ns, opts))
}
// Create takes the representation of a bundle and creates it. Returns the server's representation of the bundle, and an error, if there is any.
func (c *FakeBundles) Create(ctx context.Context, bundle *v1alpha1.Bundle, opts v1.CreateOptions) (result *v1alpha1.Bundle, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(bundlesResource, c.ns, bundle), &v1alpha1.Bundle{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Bundle), err
}
// Update takes the representation of a bundle and updates it. Returns the server's representation of the bundle, and an error, if there is any.
func (c *FakeBundles) Update(ctx context.Context, bundle *v1alpha1.Bundle, opts v1.UpdateOptions) (result *v1alpha1.Bundle, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(bundlesResource, c.ns, bundle), &v1alpha1.Bundle{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Bundle), 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 *FakeBundles) UpdateStatus(ctx context.Context, bundle *v1alpha1.Bundle, opts v1.UpdateOptions) (*v1alpha1.Bundle, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(bundlesResource, "status", c.ns, bundle), &v1alpha1.Bundle{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Bundle), err
}
// Delete takes name of the bundle and deletes it. Returns an error if one occurs.
func (c *FakeBundles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(bundlesResource, c.ns, name), &v1alpha1.Bundle{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeBundles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(bundlesResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.BundleList{})
return err
}
// Patch applies the patch and returns the patched bundle.
func (c *FakeBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Bundle, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(bundlesResource, c.ns, name, pt, data, subresources...), &v1alpha1.Bundle{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Bundle), err
}

View File

@@ -0,0 +1,142 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/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"
)
// FakeBundleDeployments implements BundleDeploymentInterface
type FakeBundleDeployments struct {
Fake *FakeFleetV1alpha1
ns string
}
var bundledeploymentsResource = schema.GroupVersionResource{Group: "fleet.cattle.io", Version: "v1alpha1", Resource: "bundledeployments"}
var bundledeploymentsKind = schema.GroupVersionKind{Group: "fleet.cattle.io", Version: "v1alpha1", Kind: "BundleDeployment"}
// Get takes name of the bundleDeployment, and returns the corresponding bundleDeployment object, and an error if there is any.
func (c *FakeBundleDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BundleDeployment, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(bundledeploymentsResource, c.ns, name), &v1alpha1.BundleDeployment{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.BundleDeployment), err
}
// List takes label and field selectors, and returns the list of BundleDeployments that match those selectors.
func (c *FakeBundleDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BundleDeploymentList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(bundledeploymentsResource, bundledeploymentsKind, c.ns, opts), &v1alpha1.BundleDeploymentList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.BundleDeploymentList{ListMeta: obj.(*v1alpha1.BundleDeploymentList).ListMeta}
for _, item := range obj.(*v1alpha1.BundleDeploymentList).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 bundleDeployments.
func (c *FakeBundleDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(bundledeploymentsResource, c.ns, opts))
}
// Create takes the representation of a bundleDeployment and creates it. Returns the server's representation of the bundleDeployment, and an error, if there is any.
func (c *FakeBundleDeployments) Create(ctx context.Context, bundleDeployment *v1alpha1.BundleDeployment, opts v1.CreateOptions) (result *v1alpha1.BundleDeployment, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(bundledeploymentsResource, c.ns, bundleDeployment), &v1alpha1.BundleDeployment{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.BundleDeployment), err
}
// Update takes the representation of a bundleDeployment and updates it. Returns the server's representation of the bundleDeployment, and an error, if there is any.
func (c *FakeBundleDeployments) Update(ctx context.Context, bundleDeployment *v1alpha1.BundleDeployment, opts v1.UpdateOptions) (result *v1alpha1.BundleDeployment, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(bundledeploymentsResource, c.ns, bundleDeployment), &v1alpha1.BundleDeployment{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.BundleDeployment), 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 *FakeBundleDeployments) UpdateStatus(ctx context.Context, bundleDeployment *v1alpha1.BundleDeployment, opts v1.UpdateOptions) (*v1alpha1.BundleDeployment, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(bundledeploymentsResource, "status", c.ns, bundleDeployment), &v1alpha1.BundleDeployment{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.BundleDeployment), err
}
// Delete takes name of the bundleDeployment and deletes it. Returns an error if one occurs.
func (c *FakeBundleDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(bundledeploymentsResource, c.ns, name), &v1alpha1.BundleDeployment{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeBundleDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(bundledeploymentsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.BundleDeploymentList{})
return err
}
// Patch applies the patch and returns the patched bundleDeployment.
func (c *FakeBundleDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BundleDeployment, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(bundledeploymentsResource, c.ns, name, pt, data, subresources...), &v1alpha1.BundleDeployment{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.BundleDeployment), err
}

View File

@@ -0,0 +1,130 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/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"
)
// FakeBundleNamespaceMappings implements BundleNamespaceMappingInterface
type FakeBundleNamespaceMappings struct {
Fake *FakeFleetV1alpha1
ns string
}
var bundlenamespacemappingsResource = schema.GroupVersionResource{Group: "fleet.cattle.io", Version: "v1alpha1", Resource: "bundlenamespacemappings"}
var bundlenamespacemappingsKind = schema.GroupVersionKind{Group: "fleet.cattle.io", Version: "v1alpha1", Kind: "BundleNamespaceMapping"}
// Get takes name of the bundleNamespaceMapping, and returns the corresponding bundleNamespaceMapping object, and an error if there is any.
func (c *FakeBundleNamespaceMappings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BundleNamespaceMapping, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(bundlenamespacemappingsResource, c.ns, name), &v1alpha1.BundleNamespaceMapping{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.BundleNamespaceMapping), err
}
// List takes label and field selectors, and returns the list of BundleNamespaceMappings that match those selectors.
func (c *FakeBundleNamespaceMappings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BundleNamespaceMappingList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(bundlenamespacemappingsResource, bundlenamespacemappingsKind, c.ns, opts), &v1alpha1.BundleNamespaceMappingList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.BundleNamespaceMappingList{ListMeta: obj.(*v1alpha1.BundleNamespaceMappingList).ListMeta}
for _, item := range obj.(*v1alpha1.BundleNamespaceMappingList).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 bundleNamespaceMappings.
func (c *FakeBundleNamespaceMappings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(bundlenamespacemappingsResource, c.ns, opts))
}
// Create takes the representation of a bundleNamespaceMapping and creates it. Returns the server's representation of the bundleNamespaceMapping, and an error, if there is any.
func (c *FakeBundleNamespaceMappings) Create(ctx context.Context, bundleNamespaceMapping *v1alpha1.BundleNamespaceMapping, opts v1.CreateOptions) (result *v1alpha1.BundleNamespaceMapping, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(bundlenamespacemappingsResource, c.ns, bundleNamespaceMapping), &v1alpha1.BundleNamespaceMapping{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.BundleNamespaceMapping), err
}
// Update takes the representation of a bundleNamespaceMapping and updates it. Returns the server's representation of the bundleNamespaceMapping, and an error, if there is any.
func (c *FakeBundleNamespaceMappings) Update(ctx context.Context, bundleNamespaceMapping *v1alpha1.BundleNamespaceMapping, opts v1.UpdateOptions) (result *v1alpha1.BundleNamespaceMapping, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(bundlenamespacemappingsResource, c.ns, bundleNamespaceMapping), &v1alpha1.BundleNamespaceMapping{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.BundleNamespaceMapping), err
}
// Delete takes name of the bundleNamespaceMapping and deletes it. Returns an error if one occurs.
func (c *FakeBundleNamespaceMappings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(bundlenamespacemappingsResource, c.ns, name), &v1alpha1.BundleNamespaceMapping{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeBundleNamespaceMappings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(bundlenamespacemappingsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.BundleNamespaceMappingList{})
return err
}
// Patch applies the patch and returns the patched bundleNamespaceMapping.
func (c *FakeBundleNamespaceMappings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BundleNamespaceMapping, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(bundlenamespacemappingsResource, c.ns, name, pt, data, subresources...), &v1alpha1.BundleNamespaceMapping{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.BundleNamespaceMapping), err
}

View File

@@ -0,0 +1,142 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/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"
)
// FakeClusters implements ClusterInterface
type FakeClusters struct {
Fake *FakeFleetV1alpha1
ns string
}
var clustersResource = schema.GroupVersionResource{Group: "fleet.cattle.io", Version: "v1alpha1", Resource: "clusters"}
var clustersKind = schema.GroupVersionKind{Group: "fleet.cattle.io", Version: "v1alpha1", Kind: "Cluster"}
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
func (c *FakeClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(clustersResource, c.ns, name), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
func (c *FakeClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(clustersResource, clustersKind, c.ns, opts), &v1alpha1.ClusterList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ClusterList{ListMeta: obj.(*v1alpha1.ClusterList).ListMeta}
for _, item := range obj.(*v1alpha1.ClusterList).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 clusters.
func (c *FakeClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(clustersResource, c.ns, opts))
}
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *FakeClusters) Create(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.CreateOptions) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
func (c *FakeClusters) Update(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), 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 *FakeClusters) UpdateStatus(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (*v1alpha1.Cluster, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(clustersResource, "status", c.ns, cluster), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
func (c *FakeClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(clustersResource, c.ns, name), &v1alpha1.Cluster{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(clustersResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterList{})
return err
}
// Patch applies the patch and returns the patched cluster.
func (c *FakeClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, pt, data, subresources...), &v1alpha1.Cluster{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Cluster), err
}

View File

@@ -0,0 +1,142 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/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"
)
// FakeClusterGroups implements ClusterGroupInterface
type FakeClusterGroups struct {
Fake *FakeFleetV1alpha1
ns string
}
var clustergroupsResource = schema.GroupVersionResource{Group: "fleet.cattle.io", Version: "v1alpha1", Resource: "clustergroups"}
var clustergroupsKind = schema.GroupVersionKind{Group: "fleet.cattle.io", Version: "v1alpha1", Kind: "ClusterGroup"}
// Get takes name of the clusterGroup, and returns the corresponding clusterGroup object, and an error if there is any.
func (c *FakeClusterGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterGroup, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(clustergroupsResource, c.ns, name), &v1alpha1.ClusterGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterGroup), err
}
// List takes label and field selectors, and returns the list of ClusterGroups that match those selectors.
func (c *FakeClusterGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterGroupList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(clustergroupsResource, clustergroupsKind, c.ns, opts), &v1alpha1.ClusterGroupList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ClusterGroupList{ListMeta: obj.(*v1alpha1.ClusterGroupList).ListMeta}
for _, item := range obj.(*v1alpha1.ClusterGroupList).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 clusterGroups.
func (c *FakeClusterGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(clustergroupsResource, c.ns, opts))
}
// Create takes the representation of a clusterGroup and creates it. Returns the server's representation of the clusterGroup, and an error, if there is any.
func (c *FakeClusterGroups) Create(ctx context.Context, clusterGroup *v1alpha1.ClusterGroup, opts v1.CreateOptions) (result *v1alpha1.ClusterGroup, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(clustergroupsResource, c.ns, clusterGroup), &v1alpha1.ClusterGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterGroup), err
}
// Update takes the representation of a clusterGroup and updates it. Returns the server's representation of the clusterGroup, and an error, if there is any.
func (c *FakeClusterGroups) Update(ctx context.Context, clusterGroup *v1alpha1.ClusterGroup, opts v1.UpdateOptions) (result *v1alpha1.ClusterGroup, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(clustergroupsResource, c.ns, clusterGroup), &v1alpha1.ClusterGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterGroup), 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 *FakeClusterGroups) UpdateStatus(ctx context.Context, clusterGroup *v1alpha1.ClusterGroup, opts v1.UpdateOptions) (*v1alpha1.ClusterGroup, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(clustergroupsResource, "status", c.ns, clusterGroup), &v1alpha1.ClusterGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterGroup), err
}
// Delete takes name of the clusterGroup and deletes it. Returns an error if one occurs.
func (c *FakeClusterGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(clustergroupsResource, c.ns, name), &v1alpha1.ClusterGroup{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(clustergroupsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterGroupList{})
return err
}
// Patch applies the patch and returns the patched clusterGroup.
func (c *FakeClusterGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterGroup, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(clustergroupsResource, c.ns, name, pt, data, subresources...), &v1alpha1.ClusterGroup{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterGroup), err
}

View File

@@ -0,0 +1,142 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/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"
)
// FakeClusterRegistrations implements ClusterRegistrationInterface
type FakeClusterRegistrations struct {
Fake *FakeFleetV1alpha1
ns string
}
var clusterregistrationsResource = schema.GroupVersionResource{Group: "fleet.cattle.io", Version: "v1alpha1", Resource: "clusterregistrations"}
var clusterregistrationsKind = schema.GroupVersionKind{Group: "fleet.cattle.io", Version: "v1alpha1", Kind: "ClusterRegistration"}
// Get takes name of the clusterRegistration, and returns the corresponding clusterRegistration object, and an error if there is any.
func (c *FakeClusterRegistrations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRegistration, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(clusterregistrationsResource, c.ns, name), &v1alpha1.ClusterRegistration{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterRegistration), err
}
// List takes label and field selectors, and returns the list of ClusterRegistrations that match those selectors.
func (c *FakeClusterRegistrations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRegistrationList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(clusterregistrationsResource, clusterregistrationsKind, c.ns, opts), &v1alpha1.ClusterRegistrationList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ClusterRegistrationList{ListMeta: obj.(*v1alpha1.ClusterRegistrationList).ListMeta}
for _, item := range obj.(*v1alpha1.ClusterRegistrationList).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 clusterRegistrations.
func (c *FakeClusterRegistrations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(clusterregistrationsResource, c.ns, opts))
}
// Create takes the representation of a clusterRegistration and creates it. Returns the server's representation of the clusterRegistration, and an error, if there is any.
func (c *FakeClusterRegistrations) Create(ctx context.Context, clusterRegistration *v1alpha1.ClusterRegistration, opts v1.CreateOptions) (result *v1alpha1.ClusterRegistration, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(clusterregistrationsResource, c.ns, clusterRegistration), &v1alpha1.ClusterRegistration{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterRegistration), err
}
// Update takes the representation of a clusterRegistration and updates it. Returns the server's representation of the clusterRegistration, and an error, if there is any.
func (c *FakeClusterRegistrations) Update(ctx context.Context, clusterRegistration *v1alpha1.ClusterRegistration, opts v1.UpdateOptions) (result *v1alpha1.ClusterRegistration, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(clusterregistrationsResource, c.ns, clusterRegistration), &v1alpha1.ClusterRegistration{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterRegistration), 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 *FakeClusterRegistrations) UpdateStatus(ctx context.Context, clusterRegistration *v1alpha1.ClusterRegistration, opts v1.UpdateOptions) (*v1alpha1.ClusterRegistration, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(clusterregistrationsResource, "status", c.ns, clusterRegistration), &v1alpha1.ClusterRegistration{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterRegistration), err
}
// Delete takes name of the clusterRegistration and deletes it. Returns an error if one occurs.
func (c *FakeClusterRegistrations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(clusterregistrationsResource, c.ns, name), &v1alpha1.ClusterRegistration{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterRegistrations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(clusterregistrationsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterRegistrationList{})
return err
}
// Patch applies the patch and returns the patched clusterRegistration.
func (c *FakeClusterRegistrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRegistration, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(clusterregistrationsResource, c.ns, name, pt, data, subresources...), &v1alpha1.ClusterRegistration{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterRegistration), err
}

View File

@@ -0,0 +1,142 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/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"
)
// FakeClusterRegistrationTokens implements ClusterRegistrationTokenInterface
type FakeClusterRegistrationTokens struct {
Fake *FakeFleetV1alpha1
ns string
}
var clusterregistrationtokensResource = schema.GroupVersionResource{Group: "fleet.cattle.io", Version: "v1alpha1", Resource: "clusterregistrationtokens"}
var clusterregistrationtokensKind = schema.GroupVersionKind{Group: "fleet.cattle.io", Version: "v1alpha1", Kind: "ClusterRegistrationToken"}
// Get takes name of the clusterRegistrationToken, and returns the corresponding clusterRegistrationToken object, and an error if there is any.
func (c *FakeClusterRegistrationTokens) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRegistrationToken, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(clusterregistrationtokensResource, c.ns, name), &v1alpha1.ClusterRegistrationToken{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterRegistrationToken), err
}
// List takes label and field selectors, and returns the list of ClusterRegistrationTokens that match those selectors.
func (c *FakeClusterRegistrationTokens) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRegistrationTokenList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(clusterregistrationtokensResource, clusterregistrationtokensKind, c.ns, opts), &v1alpha1.ClusterRegistrationTokenList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ClusterRegistrationTokenList{ListMeta: obj.(*v1alpha1.ClusterRegistrationTokenList).ListMeta}
for _, item := range obj.(*v1alpha1.ClusterRegistrationTokenList).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 clusterRegistrationTokens.
func (c *FakeClusterRegistrationTokens) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(clusterregistrationtokensResource, c.ns, opts))
}
// Create takes the representation of a clusterRegistrationToken and creates it. Returns the server's representation of the clusterRegistrationToken, and an error, if there is any.
func (c *FakeClusterRegistrationTokens) Create(ctx context.Context, clusterRegistrationToken *v1alpha1.ClusterRegistrationToken, opts v1.CreateOptions) (result *v1alpha1.ClusterRegistrationToken, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(clusterregistrationtokensResource, c.ns, clusterRegistrationToken), &v1alpha1.ClusterRegistrationToken{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterRegistrationToken), err
}
// Update takes the representation of a clusterRegistrationToken and updates it. Returns the server's representation of the clusterRegistrationToken, and an error, if there is any.
func (c *FakeClusterRegistrationTokens) Update(ctx context.Context, clusterRegistrationToken *v1alpha1.ClusterRegistrationToken, opts v1.UpdateOptions) (result *v1alpha1.ClusterRegistrationToken, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(clusterregistrationtokensResource, c.ns, clusterRegistrationToken), &v1alpha1.ClusterRegistrationToken{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterRegistrationToken), 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 *FakeClusterRegistrationTokens) UpdateStatus(ctx context.Context, clusterRegistrationToken *v1alpha1.ClusterRegistrationToken, opts v1.UpdateOptions) (*v1alpha1.ClusterRegistrationToken, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(clusterregistrationtokensResource, "status", c.ns, clusterRegistrationToken), &v1alpha1.ClusterRegistrationToken{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterRegistrationToken), err
}
// Delete takes name of the clusterRegistrationToken and deletes it. Returns an error if one occurs.
func (c *FakeClusterRegistrationTokens) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(clusterregistrationtokensResource, c.ns, name), &v1alpha1.ClusterRegistrationToken{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeClusterRegistrationTokens) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(clusterregistrationtokensResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterRegistrationTokenList{})
return err
}
// Patch applies the patch and returns the patched clusterRegistrationToken.
func (c *FakeClusterRegistrationTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRegistrationToken, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(clusterregistrationtokensResource, c.ns, name, pt, data, subresources...), &v1alpha1.ClusterRegistrationToken{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ClusterRegistrationToken), err
}

View File

@@ -0,0 +1,122 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/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"
)
// FakeContents implements ContentInterface
type FakeContents struct {
Fake *FakeFleetV1alpha1
}
var contentsResource = schema.GroupVersionResource{Group: "fleet.cattle.io", Version: "v1alpha1", Resource: "contents"}
var contentsKind = schema.GroupVersionKind{Group: "fleet.cattle.io", Version: "v1alpha1", Kind: "Content"}
// Get takes name of the content, and returns the corresponding content object, and an error if there is any.
func (c *FakeContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Content, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(contentsResource, name), &v1alpha1.Content{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Content), err
}
// List takes label and field selectors, and returns the list of Contents that match those selectors.
func (c *FakeContents) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ContentList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(contentsResource, contentsKind, opts), &v1alpha1.ContentList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ContentList{ListMeta: obj.(*v1alpha1.ContentList).ListMeta}
for _, item := range obj.(*v1alpha1.ContentList).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 contents.
func (c *FakeContents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(contentsResource, opts))
}
// Create takes the representation of a content and creates it. Returns the server's representation of the content, and an error, if there is any.
func (c *FakeContents) Create(ctx context.Context, content *v1alpha1.Content, opts v1.CreateOptions) (result *v1alpha1.Content, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(contentsResource, content), &v1alpha1.Content{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Content), err
}
// Update takes the representation of a content and updates it. Returns the server's representation of the content, and an error, if there is any.
func (c *FakeContents) Update(ctx context.Context, content *v1alpha1.Content, opts v1.UpdateOptions) (result *v1alpha1.Content, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(contentsResource, content), &v1alpha1.Content{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Content), err
}
// Delete takes name of the content and deletes it. Returns an error if one occurs.
func (c *FakeContents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(contentsResource, name), &v1alpha1.Content{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeContents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(contentsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.ContentList{})
return err
}
// Patch applies the patch and returns the patched content.
func (c *FakeContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Content, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(contentsResource, name, pt, data, subresources...), &v1alpha1.Content{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.Content), err
}

View File

@@ -0,0 +1,76 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1alpha1 "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/typed/fleet.cattle.io/v1alpha1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeFleetV1alpha1 struct {
*testing.Fake
}
func (c *FakeFleetV1alpha1) Bundles(namespace string) v1alpha1.BundleInterface {
return &FakeBundles{c, namespace}
}
func (c *FakeFleetV1alpha1) BundleDeployments(namespace string) v1alpha1.BundleDeploymentInterface {
return &FakeBundleDeployments{c, namespace}
}
func (c *FakeFleetV1alpha1) BundleNamespaceMappings(namespace string) v1alpha1.BundleNamespaceMappingInterface {
return &FakeBundleNamespaceMappings{c, namespace}
}
func (c *FakeFleetV1alpha1) Clusters(namespace string) v1alpha1.ClusterInterface {
return &FakeClusters{c, namespace}
}
func (c *FakeFleetV1alpha1) ClusterGroups(namespace string) v1alpha1.ClusterGroupInterface {
return &FakeClusterGroups{c, namespace}
}
func (c *FakeFleetV1alpha1) ClusterRegistrations(namespace string) v1alpha1.ClusterRegistrationInterface {
return &FakeClusterRegistrations{c, namespace}
}
func (c *FakeFleetV1alpha1) ClusterRegistrationTokens(namespace string) v1alpha1.ClusterRegistrationTokenInterface {
return &FakeClusterRegistrationTokens{c, namespace}
}
func (c *FakeFleetV1alpha1) Contents() v1alpha1.ContentInterface {
return &FakeContents{c}
}
func (c *FakeFleetV1alpha1) GitRepos(namespace string) v1alpha1.GitRepoInterface {
return &FakeGitRepos{c, namespace}
}
func (c *FakeFleetV1alpha1) GitRepoRestrictions(namespace string) v1alpha1.GitRepoRestrictionInterface {
return &FakeGitRepoRestrictions{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeFleetV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View File

@@ -0,0 +1,142 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/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"
)
// FakeGitRepos implements GitRepoInterface
type FakeGitRepos struct {
Fake *FakeFleetV1alpha1
ns string
}
var gitreposResource = schema.GroupVersionResource{Group: "fleet.cattle.io", Version: "v1alpha1", Resource: "gitrepos"}
var gitreposKind = schema.GroupVersionKind{Group: "fleet.cattle.io", Version: "v1alpha1", Kind: "GitRepo"}
// Get takes name of the gitRepo, and returns the corresponding gitRepo object, and an error if there is any.
func (c *FakeGitRepos) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GitRepo, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(gitreposResource, c.ns, name), &v1alpha1.GitRepo{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.GitRepo), err
}
// List takes label and field selectors, and returns the list of GitRepos that match those selectors.
func (c *FakeGitRepos) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GitRepoList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(gitreposResource, gitreposKind, c.ns, opts), &v1alpha1.GitRepoList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.GitRepoList{ListMeta: obj.(*v1alpha1.GitRepoList).ListMeta}
for _, item := range obj.(*v1alpha1.GitRepoList).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 gitRepos.
func (c *FakeGitRepos) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(gitreposResource, c.ns, opts))
}
// Create takes the representation of a gitRepo and creates it. Returns the server's representation of the gitRepo, and an error, if there is any.
func (c *FakeGitRepos) Create(ctx context.Context, gitRepo *v1alpha1.GitRepo, opts v1.CreateOptions) (result *v1alpha1.GitRepo, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(gitreposResource, c.ns, gitRepo), &v1alpha1.GitRepo{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.GitRepo), err
}
// Update takes the representation of a gitRepo and updates it. Returns the server's representation of the gitRepo, and an error, if there is any.
func (c *FakeGitRepos) Update(ctx context.Context, gitRepo *v1alpha1.GitRepo, opts v1.UpdateOptions) (result *v1alpha1.GitRepo, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(gitreposResource, c.ns, gitRepo), &v1alpha1.GitRepo{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.GitRepo), 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 *FakeGitRepos) UpdateStatus(ctx context.Context, gitRepo *v1alpha1.GitRepo, opts v1.UpdateOptions) (*v1alpha1.GitRepo, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(gitreposResource, "status", c.ns, gitRepo), &v1alpha1.GitRepo{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.GitRepo), err
}
// Delete takes name of the gitRepo and deletes it. Returns an error if one occurs.
func (c *FakeGitRepos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(gitreposResource, c.ns, name), &v1alpha1.GitRepo{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeGitRepos) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(gitreposResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.GitRepoList{})
return err
}
// Patch applies the patch and returns the patched gitRepo.
func (c *FakeGitRepos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.GitRepo, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(gitreposResource, c.ns, name, pt, data, subresources...), &v1alpha1.GitRepo{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.GitRepo), err
}

View File

@@ -0,0 +1,130 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/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"
)
// FakeGitRepoRestrictions implements GitRepoRestrictionInterface
type FakeGitRepoRestrictions struct {
Fake *FakeFleetV1alpha1
ns string
}
var gitreporestrictionsResource = schema.GroupVersionResource{Group: "fleet.cattle.io", Version: "v1alpha1", Resource: "gitreporestrictions"}
var gitreporestrictionsKind = schema.GroupVersionKind{Group: "fleet.cattle.io", Version: "v1alpha1", Kind: "GitRepoRestriction"}
// Get takes name of the gitRepoRestriction, and returns the corresponding gitRepoRestriction object, and an error if there is any.
func (c *FakeGitRepoRestrictions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GitRepoRestriction, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(gitreporestrictionsResource, c.ns, name), &v1alpha1.GitRepoRestriction{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.GitRepoRestriction), err
}
// List takes label and field selectors, and returns the list of GitRepoRestrictions that match those selectors.
func (c *FakeGitRepoRestrictions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GitRepoRestrictionList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(gitreporestrictionsResource, gitreporestrictionsKind, c.ns, opts), &v1alpha1.GitRepoRestrictionList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.GitRepoRestrictionList{ListMeta: obj.(*v1alpha1.GitRepoRestrictionList).ListMeta}
for _, item := range obj.(*v1alpha1.GitRepoRestrictionList).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 gitRepoRestrictions.
func (c *FakeGitRepoRestrictions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(gitreporestrictionsResource, c.ns, opts))
}
// Create takes the representation of a gitRepoRestriction and creates it. Returns the server's representation of the gitRepoRestriction, and an error, if there is any.
func (c *FakeGitRepoRestrictions) Create(ctx context.Context, gitRepoRestriction *v1alpha1.GitRepoRestriction, opts v1.CreateOptions) (result *v1alpha1.GitRepoRestriction, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(gitreporestrictionsResource, c.ns, gitRepoRestriction), &v1alpha1.GitRepoRestriction{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.GitRepoRestriction), err
}
// Update takes the representation of a gitRepoRestriction and updates it. Returns the server's representation of the gitRepoRestriction, and an error, if there is any.
func (c *FakeGitRepoRestrictions) Update(ctx context.Context, gitRepoRestriction *v1alpha1.GitRepoRestriction, opts v1.UpdateOptions) (result *v1alpha1.GitRepoRestriction, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(gitreporestrictionsResource, c.ns, gitRepoRestriction), &v1alpha1.GitRepoRestriction{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.GitRepoRestriction), err
}
// Delete takes name of the gitRepoRestriction and deletes it. Returns an error if one occurs.
func (c *FakeGitRepoRestrictions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(gitreporestrictionsResource, c.ns, name), &v1alpha1.GitRepoRestriction{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeGitRepoRestrictions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(gitreporestrictionsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.GitRepoRestrictionList{})
return err
}
// Patch applies the patch and returns the patched gitRepoRestriction.
func (c *FakeGitRepoRestrictions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.GitRepoRestriction, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(gitreporestrictionsResource, c.ns, name, pt, data, subresources...), &v1alpha1.GitRepoRestriction{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.GitRepoRestriction), err
}

View File

@@ -0,0 +1,134 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/scheme"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
rest "k8s.io/client-go/rest"
)
type FleetV1alpha1Interface interface {
RESTClient() rest.Interface
BundlesGetter
BundleDeploymentsGetter
BundleNamespaceMappingsGetter
ClustersGetter
ClusterGroupsGetter
ClusterRegistrationsGetter
ClusterRegistrationTokensGetter
ContentsGetter
GitReposGetter
GitRepoRestrictionsGetter
}
// FleetV1alpha1Client is used to interact with features provided by the fleet.cattle.io group.
type FleetV1alpha1Client struct {
restClient rest.Interface
}
func (c *FleetV1alpha1Client) Bundles(namespace string) BundleInterface {
return newBundles(c, namespace)
}
func (c *FleetV1alpha1Client) BundleDeployments(namespace string) BundleDeploymentInterface {
return newBundleDeployments(c, namespace)
}
func (c *FleetV1alpha1Client) BundleNamespaceMappings(namespace string) BundleNamespaceMappingInterface {
return newBundleNamespaceMappings(c, namespace)
}
func (c *FleetV1alpha1Client) Clusters(namespace string) ClusterInterface {
return newClusters(c, namespace)
}
func (c *FleetV1alpha1Client) ClusterGroups(namespace string) ClusterGroupInterface {
return newClusterGroups(c, namespace)
}
func (c *FleetV1alpha1Client) ClusterRegistrations(namespace string) ClusterRegistrationInterface {
return newClusterRegistrations(c, namespace)
}
func (c *FleetV1alpha1Client) ClusterRegistrationTokens(namespace string) ClusterRegistrationTokenInterface {
return newClusterRegistrationTokens(c, namespace)
}
func (c *FleetV1alpha1Client) Contents() ContentInterface {
return newContents(c)
}
func (c *FleetV1alpha1Client) GitRepos(namespace string) GitRepoInterface {
return newGitRepos(c, namespace)
}
func (c *FleetV1alpha1Client) GitRepoRestrictions(namespace string) GitRepoRestrictionInterface {
return newGitRepoRestrictions(c, namespace)
}
// NewForConfig creates a new FleetV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*FleetV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &FleetV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new FleetV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *FleetV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new FleetV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *FleetV1alpha1Client {
return &FleetV1alpha1Client{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 *FleetV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View File

@@ -0,0 +1,39 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
type BundleExpansion interface{}
type BundleDeploymentExpansion interface{}
type BundleNamespaceMappingExpansion interface{}
type ClusterExpansion interface{}
type ClusterGroupExpansion interface{}
type ClusterRegistrationExpansion interface{}
type ClusterRegistrationTokenExpansion interface{}
type ContentExpansion interface{}
type GitRepoExpansion interface{}
type GitRepoRestrictionExpansion interface{}

View File

@@ -0,0 +1,195 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
scheme "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/scheme"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
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"
)
// GitReposGetter has a method to return a GitRepoInterface.
// A group's client should implement this interface.
type GitReposGetter interface {
GitRepos(namespace string) GitRepoInterface
}
// GitRepoInterface has methods to work with GitRepo resources.
type GitRepoInterface interface {
Create(ctx context.Context, gitRepo *v1alpha1.GitRepo, opts v1.CreateOptions) (*v1alpha1.GitRepo, error)
Update(ctx context.Context, gitRepo *v1alpha1.GitRepo, opts v1.UpdateOptions) (*v1alpha1.GitRepo, error)
UpdateStatus(ctx context.Context, gitRepo *v1alpha1.GitRepo, opts v1.UpdateOptions) (*v1alpha1.GitRepo, 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.GitRepo, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.GitRepoList, 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.GitRepo, err error)
GitRepoExpansion
}
// gitRepos implements GitRepoInterface
type gitRepos struct {
client rest.Interface
ns string
}
// newGitRepos returns a GitRepos
func newGitRepos(c *FleetV1alpha1Client, namespace string) *gitRepos {
return &gitRepos{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the gitRepo, and returns the corresponding gitRepo object, and an error if there is any.
func (c *gitRepos) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GitRepo, err error) {
result = &v1alpha1.GitRepo{}
err = c.client.Get().
Namespace(c.ns).
Resource("gitrepos").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of GitRepos that match those selectors.
func (c *gitRepos) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GitRepoList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.GitRepoList{}
err = c.client.Get().
Namespace(c.ns).
Resource("gitrepos").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested gitRepos.
func (c *gitRepos) 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("gitrepos").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a gitRepo and creates it. Returns the server's representation of the gitRepo, and an error, if there is any.
func (c *gitRepos) Create(ctx context.Context, gitRepo *v1alpha1.GitRepo, opts v1.CreateOptions) (result *v1alpha1.GitRepo, err error) {
result = &v1alpha1.GitRepo{}
err = c.client.Post().
Namespace(c.ns).
Resource("gitrepos").
VersionedParams(&opts, scheme.ParameterCodec).
Body(gitRepo).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a gitRepo and updates it. Returns the server's representation of the gitRepo, and an error, if there is any.
func (c *gitRepos) Update(ctx context.Context, gitRepo *v1alpha1.GitRepo, opts v1.UpdateOptions) (result *v1alpha1.GitRepo, err error) {
result = &v1alpha1.GitRepo{}
err = c.client.Put().
Namespace(c.ns).
Resource("gitrepos").
Name(gitRepo.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(gitRepo).
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 *gitRepos) UpdateStatus(ctx context.Context, gitRepo *v1alpha1.GitRepo, opts v1.UpdateOptions) (result *v1alpha1.GitRepo, err error) {
result = &v1alpha1.GitRepo{}
err = c.client.Put().
Namespace(c.ns).
Resource("gitrepos").
Name(gitRepo.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(gitRepo).
Do(ctx).
Into(result)
return
}
// Delete takes name of the gitRepo and deletes it. Returns an error if one occurs.
func (c *gitRepos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("gitrepos").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *gitRepos) 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("gitrepos").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched gitRepo.
func (c *gitRepos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.GitRepo, err error) {
result = &v1alpha1.GitRepo{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("gitrepos").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@@ -0,0 +1,178 @@
/*
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
scheme "github.com/javamachr/gardener-extension-shoot-fleet-agent/pkg/client/fleet/clientset/versioned/scheme"
v1alpha1 "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
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"
)
// GitRepoRestrictionsGetter has a method to return a GitRepoRestrictionInterface.
// A group's client should implement this interface.
type GitRepoRestrictionsGetter interface {
GitRepoRestrictions(namespace string) GitRepoRestrictionInterface
}
// GitRepoRestrictionInterface has methods to work with GitRepoRestriction resources.
type GitRepoRestrictionInterface interface {
Create(ctx context.Context, gitRepoRestriction *v1alpha1.GitRepoRestriction, opts v1.CreateOptions) (*v1alpha1.GitRepoRestriction, error)
Update(ctx context.Context, gitRepoRestriction *v1alpha1.GitRepoRestriction, opts v1.UpdateOptions) (*v1alpha1.GitRepoRestriction, 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.GitRepoRestriction, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.GitRepoRestrictionList, 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.GitRepoRestriction, err error)
GitRepoRestrictionExpansion
}
// gitRepoRestrictions implements GitRepoRestrictionInterface
type gitRepoRestrictions struct {
client rest.Interface
ns string
}
// newGitRepoRestrictions returns a GitRepoRestrictions
func newGitRepoRestrictions(c *FleetV1alpha1Client, namespace string) *gitRepoRestrictions {
return &gitRepoRestrictions{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the gitRepoRestriction, and returns the corresponding gitRepoRestriction object, and an error if there is any.
func (c *gitRepoRestrictions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GitRepoRestriction, err error) {
result = &v1alpha1.GitRepoRestriction{}
err = c.client.Get().
Namespace(c.ns).
Resource("gitreporestrictions").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of GitRepoRestrictions that match those selectors.
func (c *gitRepoRestrictions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GitRepoRestrictionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.GitRepoRestrictionList{}
err = c.client.Get().
Namespace(c.ns).
Resource("gitreporestrictions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested gitRepoRestrictions.
func (c *gitRepoRestrictions) 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("gitreporestrictions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a gitRepoRestriction and creates it. Returns the server's representation of the gitRepoRestriction, and an error, if there is any.
func (c *gitRepoRestrictions) Create(ctx context.Context, gitRepoRestriction *v1alpha1.GitRepoRestriction, opts v1.CreateOptions) (result *v1alpha1.GitRepoRestriction, err error) {
result = &v1alpha1.GitRepoRestriction{}
err = c.client.Post().
Namespace(c.ns).
Resource("gitreporestrictions").
VersionedParams(&opts, scheme.ParameterCodec).
Body(gitRepoRestriction).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a gitRepoRestriction and updates it. Returns the server's representation of the gitRepoRestriction, and an error, if there is any.
func (c *gitRepoRestrictions) Update(ctx context.Context, gitRepoRestriction *v1alpha1.GitRepoRestriction, opts v1.UpdateOptions) (result *v1alpha1.GitRepoRestriction, err error) {
result = &v1alpha1.GitRepoRestriction{}
err = c.client.Put().
Namespace(c.ns).
Resource("gitreporestrictions").
Name(gitRepoRestriction.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(gitRepoRestriction).
Do(ctx).
Into(result)
return
}
// Delete takes name of the gitRepoRestriction and deletes it. Returns an error if one occurs.
func (c *gitRepoRestrictions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("gitreporestrictions").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *gitRepoRestrictions) 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("gitreporestrictions").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched gitRepoRestriction.
func (c *gitRepoRestrictions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.GitRepoRestriction, err error) {
result = &v1alpha1.GitRepoRestriction{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("gitreporestrictions").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}