mirror of https://github.com/kubernetes/kops.git
make apimachinery
This commit is contained in:
parent
29efbe5881
commit
a5ed653f9d
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,46 @@
|
|||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by defaulter-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
// All generated defaulters are covering - they call all nested defaulters.
|
||||
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
scheme.AddTypeDefaultingFunc(&Cluster{}, func(obj interface{}) { SetObjectDefaults_Cluster(obj.(*Cluster)) })
|
||||
scheme.AddTypeDefaultingFunc(&ClusterList{}, func(obj interface{}) { SetObjectDefaults_ClusterList(obj.(*ClusterList)) })
|
||||
return nil
|
||||
}
|
||||
|
||||
func SetObjectDefaults_Cluster(in *Cluster) {
|
||||
SetDefaults_ClusterSpec(&in.Spec)
|
||||
}
|
||||
|
||||
func SetObjectDefaults_ClusterList(in *ClusterList) {
|
||||
for i := range in.Items {
|
||||
a := &in.Items[i]
|
||||
SetObjectDefaults_Cluster(a)
|
||||
}
|
||||
}
|
||||
|
|
@ -26,12 +26,14 @@ import (
|
|||
flowcontrol "k8s.io/client-go/util/flowcontrol"
|
||||
kopsinternalversion "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/internalversion"
|
||||
kopsv1alpha2 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2"
|
||||
kopsv1alpha3 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha3"
|
||||
)
|
||||
|
||||
type Interface interface {
|
||||
Discovery() discovery.DiscoveryInterface
|
||||
Kops() kopsinternalversion.KopsInterface
|
||||
KopsV1alpha2() kopsv1alpha2.KopsV1alpha2Interface
|
||||
KopsV1alpha3() kopsv1alpha3.KopsV1alpha3Interface
|
||||
}
|
||||
|
||||
// Clientset contains the clients for groups. Each group has exactly one
|
||||
|
|
@ -40,6 +42,7 @@ type Clientset struct {
|
|||
*discovery.DiscoveryClient
|
||||
kops *kopsinternalversion.KopsClient
|
||||
kopsV1alpha2 *kopsv1alpha2.KopsV1alpha2Client
|
||||
kopsV1alpha3 *kopsv1alpha3.KopsV1alpha3Client
|
||||
}
|
||||
|
||||
// Kops retrieves the KopsClient
|
||||
|
|
@ -52,6 +55,11 @@ func (c *Clientset) KopsV1alpha2() kopsv1alpha2.KopsV1alpha2Interface {
|
|||
return c.kopsV1alpha2
|
||||
}
|
||||
|
||||
// KopsV1alpha3 retrieves the KopsV1alpha3Client
|
||||
func (c *Clientset) KopsV1alpha3() kopsv1alpha3.KopsV1alpha3Interface {
|
||||
return c.kopsV1alpha3
|
||||
}
|
||||
|
||||
// Discovery retrieves the DiscoveryClient
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
if c == nil {
|
||||
|
|
@ -81,6 +89,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.kopsV1alpha3, err = kopsv1alpha3.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
|
|
@ -95,6 +107,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
|
|||
var cs Clientset
|
||||
cs.kops = kopsinternalversion.NewForConfigOrDie(c)
|
||||
cs.kopsV1alpha2 = kopsv1alpha2.NewForConfigOrDie(c)
|
||||
cs.kopsV1alpha3 = kopsv1alpha3.NewForConfigOrDie(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
||||
return &cs
|
||||
|
|
@ -105,6 +118,7 @@ func New(c rest.Interface) *Clientset {
|
|||
var cs Clientset
|
||||
cs.kops = kopsinternalversion.New(c)
|
||||
cs.kopsV1alpha2 = kopsv1alpha2.New(c)
|
||||
cs.kopsV1alpha3 = kopsv1alpha3.New(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||
return &cs
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ import (
|
|||
fakekopsinternalversion "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake"
|
||||
kopsv1alpha2 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2"
|
||||
fakekopsv1alpha2 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake"
|
||||
kopsv1alpha3 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha3"
|
||||
fakekopsv1alpha3 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha3/fake"
|
||||
)
|
||||
|
||||
// NewSimpleClientset returns a clientset that will respond with the provided objects.
|
||||
|
|
@ -90,3 +92,8 @@ func (c *Clientset) Kops() kopsinternalversion.KopsInterface {
|
|||
func (c *Clientset) KopsV1alpha2() kopsv1alpha2.KopsV1alpha2Interface {
|
||||
return &fakekopsv1alpha2.FakeKopsV1alpha2{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// KopsV1alpha3 retrieves the KopsV1alpha3Client
|
||||
func (c *Clientset) KopsV1alpha3() kopsv1alpha3.KopsV1alpha3Interface {
|
||||
return &fakekopsv1alpha3.FakeKopsV1alpha3{Fake: &c.Fake}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import (
|
|||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
kopsinternalversion "k8s.io/kops/pkg/apis/kops"
|
||||
kopsv1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2"
|
||||
kopsv1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
)
|
||||
|
||||
var scheme = runtime.NewScheme()
|
||||
|
|
@ -34,6 +35,7 @@ var codecs = serializer.NewCodecFactory(scheme)
|
|||
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
kopsinternalversion.AddToScheme,
|
||||
kopsv1alpha2.AddToScheme,
|
||||
kopsv1alpha3.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
|
|
|
|||
|
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme"
|
||||
)
|
||||
|
||||
// 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 *v1alpha3.Cluster, opts v1.CreateOptions) (*v1alpha3.Cluster, error)
|
||||
Update(ctx context.Context, cluster *v1alpha3.Cluster, opts v1.UpdateOptions) (*v1alpha3.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) (*v1alpha3.Cluster, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.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 *v1alpha3.Cluster, err error)
|
||||
ClusterExpansion
|
||||
}
|
||||
|
||||
// clusters implements ClusterInterface
|
||||
type clusters struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newClusters returns a Clusters
|
||||
func newClusters(c *KopsV1alpha3Client, 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 *v1alpha3.Cluster, err error) {
|
||||
result = &v1alpha3.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 *v1alpha3.ClusterList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha3.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 *v1alpha3.Cluster, opts v1.CreateOptions) (result *v1alpha3.Cluster, err error) {
|
||||
result = &v1alpha3.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 *v1alpha3.Cluster, opts v1.UpdateOptions) (result *v1alpha3.Cluster, err error) {
|
||||
result = &v1alpha3.Cluster{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("clusters").
|
||||
Name(cluster.Name).
|
||||
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 *v1alpha3.Cluster, err error) {
|
||||
result = &v1alpha3.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
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha3
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
)
|
||||
|
||||
// FakeClusters implements ClusterInterface
|
||||
type FakeClusters struct {
|
||||
Fake *FakeKopsV1alpha3
|
||||
ns string
|
||||
}
|
||||
|
||||
var clustersResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha3", Resource: "clusters"}
|
||||
|
||||
var clustersKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha3", 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 *v1alpha3.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(clustersResource, c.ns, name), &v1alpha3.Cluster{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.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 *v1alpha3.ClusterList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(clustersResource, clustersKind, c.ns, opts), &v1alpha3.ClusterList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha3.ClusterList{ListMeta: obj.(*v1alpha3.ClusterList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha3.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 *v1alpha3.Cluster, opts v1.CreateOptions) (result *v1alpha3.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(clustersResource, c.ns, cluster), &v1alpha3.Cluster{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.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 *v1alpha3.Cluster, opts v1.UpdateOptions) (result *v1alpha3.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(clustersResource, c.ns, cluster), &v1alpha3.Cluster{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.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), &v1alpha3.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, &v1alpha3.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 *v1alpha3.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, pt, data, subresources...), &v1alpha3.Cluster{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.Cluster), err
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
)
|
||||
|
||||
// FakeInstanceGroups implements InstanceGroupInterface
|
||||
type FakeInstanceGroups struct {
|
||||
Fake *FakeKopsV1alpha3
|
||||
ns string
|
||||
}
|
||||
|
||||
var instancegroupsResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha3", Resource: "instancegroups"}
|
||||
|
||||
var instancegroupsKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha3", Kind: "InstanceGroup"}
|
||||
|
||||
// Get takes name of the instanceGroup, and returns the corresponding instanceGroup object, and an error if there is any.
|
||||
func (c *FakeInstanceGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.InstanceGroup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(instancegroupsResource, c.ns, name), &v1alpha3.InstanceGroup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.InstanceGroup), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of InstanceGroups that match those selectors.
|
||||
func (c *FakeInstanceGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.InstanceGroupList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(instancegroupsResource, instancegroupsKind, c.ns, opts), &v1alpha3.InstanceGroupList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha3.InstanceGroupList{ListMeta: obj.(*v1alpha3.InstanceGroupList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha3.InstanceGroupList).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 instanceGroups.
|
||||
func (c *FakeInstanceGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(instancegroupsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a instanceGroup and creates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
|
||||
func (c *FakeInstanceGroups) Create(ctx context.Context, instanceGroup *v1alpha3.InstanceGroup, opts v1.CreateOptions) (result *v1alpha3.InstanceGroup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(instancegroupsResource, c.ns, instanceGroup), &v1alpha3.InstanceGroup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.InstanceGroup), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a instanceGroup and updates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
|
||||
func (c *FakeInstanceGroups) Update(ctx context.Context, instanceGroup *v1alpha3.InstanceGroup, opts v1.UpdateOptions) (result *v1alpha3.InstanceGroup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(instancegroupsResource, c.ns, instanceGroup), &v1alpha3.InstanceGroup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.InstanceGroup), err
|
||||
}
|
||||
|
||||
// Delete takes name of the instanceGroup and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeInstanceGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(instancegroupsResource, c.ns, name), &v1alpha3.InstanceGroup{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeInstanceGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(instancegroupsResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha3.InstanceGroupList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched instanceGroup.
|
||||
func (c *FakeInstanceGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.InstanceGroup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(instancegroupsResource, c.ns, name, pt, data, subresources...), &v1alpha3.InstanceGroup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.InstanceGroup), err
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
)
|
||||
|
||||
// FakeKeysets implements KeysetInterface
|
||||
type FakeKeysets struct {
|
||||
Fake *FakeKopsV1alpha3
|
||||
ns string
|
||||
}
|
||||
|
||||
var keysetsResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha3", Resource: "keysets"}
|
||||
|
||||
var keysetsKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha3", Kind: "Keyset"}
|
||||
|
||||
// Get takes name of the keyset, and returns the corresponding keyset object, and an error if there is any.
|
||||
func (c *FakeKeysets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.Keyset, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(keysetsResource, c.ns, name), &v1alpha3.Keyset{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.Keyset), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Keysets that match those selectors.
|
||||
func (c *FakeKeysets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.KeysetList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(keysetsResource, keysetsKind, c.ns, opts), &v1alpha3.KeysetList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha3.KeysetList{ListMeta: obj.(*v1alpha3.KeysetList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha3.KeysetList).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 keysets.
|
||||
func (c *FakeKeysets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(keysetsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a keyset and creates it. Returns the server's representation of the keyset, and an error, if there is any.
|
||||
func (c *FakeKeysets) Create(ctx context.Context, keyset *v1alpha3.Keyset, opts v1.CreateOptions) (result *v1alpha3.Keyset, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(keysetsResource, c.ns, keyset), &v1alpha3.Keyset{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.Keyset), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a keyset and updates it. Returns the server's representation of the keyset, and an error, if there is any.
|
||||
func (c *FakeKeysets) Update(ctx context.Context, keyset *v1alpha3.Keyset, opts v1.UpdateOptions) (result *v1alpha3.Keyset, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(keysetsResource, c.ns, keyset), &v1alpha3.Keyset{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.Keyset), err
|
||||
}
|
||||
|
||||
// Delete takes name of the keyset and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeKeysets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(keysetsResource, c.ns, name), &v1alpha3.Keyset{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeKeysets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(keysetsResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha3.KeysetList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched keyset.
|
||||
func (c *FakeKeysets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.Keyset, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(keysetsResource, c.ns, name, pt, data, subresources...), &v1alpha3.Keyset{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.Keyset), err
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
v1alpha3 "k8s.io/kops/pkg/client/clientset_generated/clientset/typed/kops/v1alpha3"
|
||||
)
|
||||
|
||||
type FakeKopsV1alpha3 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeKopsV1alpha3) Clusters(namespace string) v1alpha3.ClusterInterface {
|
||||
return &FakeClusters{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeKopsV1alpha3) InstanceGroups(namespace string) v1alpha3.InstanceGroupInterface {
|
||||
return &FakeInstanceGroups{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeKopsV1alpha3) Keysets(namespace string) v1alpha3.KeysetInterface {
|
||||
return &FakeKeysets{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeKopsV1alpha3) SSHCredentials(namespace string) v1alpha3.SSHCredentialInterface {
|
||||
return &FakeSSHCredentials{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeKopsV1alpha3) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
)
|
||||
|
||||
// FakeSSHCredentials implements SSHCredentialInterface
|
||||
type FakeSSHCredentials struct {
|
||||
Fake *FakeKopsV1alpha3
|
||||
ns string
|
||||
}
|
||||
|
||||
var sshcredentialsResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha3", Resource: "sshcredentials"}
|
||||
|
||||
var sshcredentialsKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha3", Kind: "SSHCredential"}
|
||||
|
||||
// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any.
|
||||
func (c *FakeSSHCredentials) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.SSHCredential, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(sshcredentialsResource, c.ns, name), &v1alpha3.SSHCredential{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.SSHCredential), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors.
|
||||
func (c *FakeSSHCredentials) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.SSHCredentialList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(sshcredentialsResource, sshcredentialsKind, c.ns, opts), &v1alpha3.SSHCredentialList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha3.SSHCredentialList{ListMeta: obj.(*v1alpha3.SSHCredentialList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha3.SSHCredentialList).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 sSHCredentials.
|
||||
func (c *FakeSSHCredentials) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(sshcredentialsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
|
||||
func (c *FakeSSHCredentials) Create(ctx context.Context, sSHCredential *v1alpha3.SSHCredential, opts v1.CreateOptions) (result *v1alpha3.SSHCredential, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha3.SSHCredential{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.SSHCredential), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
|
||||
func (c *FakeSSHCredentials) Update(ctx context.Context, sSHCredential *v1alpha3.SSHCredential, opts v1.UpdateOptions) (result *v1alpha3.SSHCredential, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha3.SSHCredential{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.SSHCredential), err
|
||||
}
|
||||
|
||||
// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeSSHCredentials) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(sshcredentialsResource, c.ns, name), &v1alpha3.SSHCredential{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeSSHCredentials) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(sshcredentialsResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha3.SSHCredentialList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched sSHCredential.
|
||||
func (c *FakeSSHCredentials) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.SSHCredential, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(sshcredentialsResource, c.ns, name, pt, data, subresources...), &v1alpha3.SSHCredential{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.SSHCredential), err
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
type ClusterExpansion interface{}
|
||||
|
||||
type InstanceGroupExpansion interface{}
|
||||
|
||||
type KeysetExpansion interface{}
|
||||
|
||||
type SSHCredentialExpansion interface{}
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme"
|
||||
)
|
||||
|
||||
// InstanceGroupsGetter has a method to return a InstanceGroupInterface.
|
||||
// A group's client should implement this interface.
|
||||
type InstanceGroupsGetter interface {
|
||||
InstanceGroups(namespace string) InstanceGroupInterface
|
||||
}
|
||||
|
||||
// InstanceGroupInterface has methods to work with InstanceGroup resources.
|
||||
type InstanceGroupInterface interface {
|
||||
Create(ctx context.Context, instanceGroup *v1alpha3.InstanceGroup, opts v1.CreateOptions) (*v1alpha3.InstanceGroup, error)
|
||||
Update(ctx context.Context, instanceGroup *v1alpha3.InstanceGroup, opts v1.UpdateOptions) (*v1alpha3.InstanceGroup, 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) (*v1alpha3.InstanceGroup, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.InstanceGroupList, 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 *v1alpha3.InstanceGroup, err error)
|
||||
InstanceGroupExpansion
|
||||
}
|
||||
|
||||
// instanceGroups implements InstanceGroupInterface
|
||||
type instanceGroups struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newInstanceGroups returns a InstanceGroups
|
||||
func newInstanceGroups(c *KopsV1alpha3Client, namespace string) *instanceGroups {
|
||||
return &instanceGroups{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the instanceGroup, and returns the corresponding instanceGroup object, and an error if there is any.
|
||||
func (c *instanceGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.InstanceGroup, err error) {
|
||||
result = &v1alpha3.InstanceGroup{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("instancegroups").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of InstanceGroups that match those selectors.
|
||||
func (c *instanceGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.InstanceGroupList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha3.InstanceGroupList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("instancegroups").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested instanceGroups.
|
||||
func (c *instanceGroups) 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("instancegroups").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a instanceGroup and creates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
|
||||
func (c *instanceGroups) Create(ctx context.Context, instanceGroup *v1alpha3.InstanceGroup, opts v1.CreateOptions) (result *v1alpha3.InstanceGroup, err error) {
|
||||
result = &v1alpha3.InstanceGroup{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("instancegroups").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(instanceGroup).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a instanceGroup and updates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
|
||||
func (c *instanceGroups) Update(ctx context.Context, instanceGroup *v1alpha3.InstanceGroup, opts v1.UpdateOptions) (result *v1alpha3.InstanceGroup, err error) {
|
||||
result = &v1alpha3.InstanceGroup{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("instancegroups").
|
||||
Name(instanceGroup.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(instanceGroup).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the instanceGroup and deletes it. Returns an error if one occurs.
|
||||
func (c *instanceGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("instancegroups").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *instanceGroups) 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("instancegroups").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched instanceGroup.
|
||||
func (c *instanceGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.InstanceGroup, err error) {
|
||||
result = &v1alpha3.InstanceGroup{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("instancegroups").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme"
|
||||
)
|
||||
|
||||
// KeysetsGetter has a method to return a KeysetInterface.
|
||||
// A group's client should implement this interface.
|
||||
type KeysetsGetter interface {
|
||||
Keysets(namespace string) KeysetInterface
|
||||
}
|
||||
|
||||
// KeysetInterface has methods to work with Keyset resources.
|
||||
type KeysetInterface interface {
|
||||
Create(ctx context.Context, keyset *v1alpha3.Keyset, opts v1.CreateOptions) (*v1alpha3.Keyset, error)
|
||||
Update(ctx context.Context, keyset *v1alpha3.Keyset, opts v1.UpdateOptions) (*v1alpha3.Keyset, 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) (*v1alpha3.Keyset, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.KeysetList, 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 *v1alpha3.Keyset, err error)
|
||||
KeysetExpansion
|
||||
}
|
||||
|
||||
// keysets implements KeysetInterface
|
||||
type keysets struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newKeysets returns a Keysets
|
||||
func newKeysets(c *KopsV1alpha3Client, namespace string) *keysets {
|
||||
return &keysets{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the keyset, and returns the corresponding keyset object, and an error if there is any.
|
||||
func (c *keysets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.Keyset, err error) {
|
||||
result = &v1alpha3.Keyset{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("keysets").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Keysets that match those selectors.
|
||||
func (c *keysets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.KeysetList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha3.KeysetList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("keysets").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested keysets.
|
||||
func (c *keysets) 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("keysets").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a keyset and creates it. Returns the server's representation of the keyset, and an error, if there is any.
|
||||
func (c *keysets) Create(ctx context.Context, keyset *v1alpha3.Keyset, opts v1.CreateOptions) (result *v1alpha3.Keyset, err error) {
|
||||
result = &v1alpha3.Keyset{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("keysets").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(keyset).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a keyset and updates it. Returns the server's representation of the keyset, and an error, if there is any.
|
||||
func (c *keysets) Update(ctx context.Context, keyset *v1alpha3.Keyset, opts v1.UpdateOptions) (result *v1alpha3.Keyset, err error) {
|
||||
result = &v1alpha3.Keyset{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("keysets").
|
||||
Name(keyset.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(keyset).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the keyset and deletes it. Returns an error if one occurs.
|
||||
func (c *keysets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("keysets").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *keysets) 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("keysets").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched keyset.
|
||||
func (c *keysets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.Keyset, err error) {
|
||||
result = &v1alpha3.Keyset{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("keysets").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
"k8s.io/kops/pkg/client/clientset_generated/clientset/scheme"
|
||||
)
|
||||
|
||||
type KopsV1alpha3Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
ClustersGetter
|
||||
InstanceGroupsGetter
|
||||
KeysetsGetter
|
||||
SSHCredentialsGetter
|
||||
}
|
||||
|
||||
// KopsV1alpha3Client is used to interact with features provided by the kops.k8s.io group.
|
||||
type KopsV1alpha3Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *KopsV1alpha3Client) Clusters(namespace string) ClusterInterface {
|
||||
return newClusters(c, namespace)
|
||||
}
|
||||
|
||||
func (c *KopsV1alpha3Client) InstanceGroups(namespace string) InstanceGroupInterface {
|
||||
return newInstanceGroups(c, namespace)
|
||||
}
|
||||
|
||||
func (c *KopsV1alpha3Client) Keysets(namespace string) KeysetInterface {
|
||||
return newKeysets(c, namespace)
|
||||
}
|
||||
|
||||
func (c *KopsV1alpha3Client) SSHCredentials(namespace string) SSHCredentialInterface {
|
||||
return newSSHCredentials(c, namespace)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new KopsV1alpha3Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*KopsV1alpha3Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &KopsV1alpha3Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new KopsV1alpha3Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *KopsV1alpha3Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new KopsV1alpha3Client for the given RESTClient.
|
||||
func New(c rest.Interface) *KopsV1alpha3Client {
|
||||
return &KopsV1alpha3Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha3.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 *KopsV1alpha3Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme"
|
||||
)
|
||||
|
||||
// SSHCredentialsGetter has a method to return a SSHCredentialInterface.
|
||||
// A group's client should implement this interface.
|
||||
type SSHCredentialsGetter interface {
|
||||
SSHCredentials(namespace string) SSHCredentialInterface
|
||||
}
|
||||
|
||||
// SSHCredentialInterface has methods to work with SSHCredential resources.
|
||||
type SSHCredentialInterface interface {
|
||||
Create(ctx context.Context, sSHCredential *v1alpha3.SSHCredential, opts v1.CreateOptions) (*v1alpha3.SSHCredential, error)
|
||||
Update(ctx context.Context, sSHCredential *v1alpha3.SSHCredential, opts v1.UpdateOptions) (*v1alpha3.SSHCredential, 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) (*v1alpha3.SSHCredential, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.SSHCredentialList, 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 *v1alpha3.SSHCredential, err error)
|
||||
SSHCredentialExpansion
|
||||
}
|
||||
|
||||
// sSHCredentials implements SSHCredentialInterface
|
||||
type sSHCredentials struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newSSHCredentials returns a SSHCredentials
|
||||
func newSSHCredentials(c *KopsV1alpha3Client, namespace string) *sSHCredentials {
|
||||
return &sSHCredentials{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any.
|
||||
func (c *sSHCredentials) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.SSHCredential, err error) {
|
||||
result = &v1alpha3.SSHCredential{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("sshcredentials").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors.
|
||||
func (c *sSHCredentials) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.SSHCredentialList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha3.SSHCredentialList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("sshcredentials").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested sSHCredentials.
|
||||
func (c *sSHCredentials) 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("sshcredentials").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
|
||||
func (c *sSHCredentials) Create(ctx context.Context, sSHCredential *v1alpha3.SSHCredential, opts v1.CreateOptions) (result *v1alpha3.SSHCredential, err error) {
|
||||
result = &v1alpha3.SSHCredential{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("sshcredentials").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(sSHCredential).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
|
||||
func (c *sSHCredentials) Update(ctx context.Context, sSHCredential *v1alpha3.SSHCredential, opts v1.UpdateOptions) (result *v1alpha3.SSHCredential, err error) {
|
||||
result = &v1alpha3.SSHCredential{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("sshcredentials").
|
||||
Name(sSHCredential.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(sSHCredential).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs.
|
||||
func (c *sSHCredentials) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("sshcredentials").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *sSHCredentials) 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("sshcredentials").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched sSHCredential.
|
||||
func (c *sSHCredentials) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.SSHCredential, err error) {
|
||||
result = &v1alpha3.SSHCredential{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("sshcredentials").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
|
@ -26,12 +26,14 @@ import (
|
|||
flowcontrol "k8s.io/client-go/util/flowcontrol"
|
||||
kopsinternalversion "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion"
|
||||
kopsv1alpha2 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2"
|
||||
kopsv1alpha3 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha3"
|
||||
)
|
||||
|
||||
type Interface interface {
|
||||
Discovery() discovery.DiscoveryInterface
|
||||
Kops() kopsinternalversion.KopsInterface
|
||||
KopsV1alpha2() kopsv1alpha2.KopsV1alpha2Interface
|
||||
KopsV1alpha3() kopsv1alpha3.KopsV1alpha3Interface
|
||||
}
|
||||
|
||||
// Clientset contains the clients for groups. Each group has exactly one
|
||||
|
|
@ -40,6 +42,7 @@ type Clientset struct {
|
|||
*discovery.DiscoveryClient
|
||||
kops *kopsinternalversion.KopsClient
|
||||
kopsV1alpha2 *kopsv1alpha2.KopsV1alpha2Client
|
||||
kopsV1alpha3 *kopsv1alpha3.KopsV1alpha3Client
|
||||
}
|
||||
|
||||
// Kops retrieves the KopsClient
|
||||
|
|
@ -52,6 +55,11 @@ func (c *Clientset) KopsV1alpha2() kopsv1alpha2.KopsV1alpha2Interface {
|
|||
return c.kopsV1alpha2
|
||||
}
|
||||
|
||||
// KopsV1alpha3 retrieves the KopsV1alpha3Client
|
||||
func (c *Clientset) KopsV1alpha3() kopsv1alpha3.KopsV1alpha3Interface {
|
||||
return c.kopsV1alpha3
|
||||
}
|
||||
|
||||
// Discovery retrieves the DiscoveryClient
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
if c == nil {
|
||||
|
|
@ -81,6 +89,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.kopsV1alpha3, err = kopsv1alpha3.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
|
|
@ -95,6 +107,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
|
|||
var cs Clientset
|
||||
cs.kops = kopsinternalversion.NewForConfigOrDie(c)
|
||||
cs.kopsV1alpha2 = kopsv1alpha2.NewForConfigOrDie(c)
|
||||
cs.kopsV1alpha3 = kopsv1alpha3.NewForConfigOrDie(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
||||
return &cs
|
||||
|
|
@ -105,6 +118,7 @@ func New(c rest.Interface) *Clientset {
|
|||
var cs Clientset
|
||||
cs.kops = kopsinternalversion.New(c)
|
||||
cs.kopsV1alpha2 = kopsv1alpha2.New(c)
|
||||
cs.kopsV1alpha3 = kopsv1alpha3.New(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||
return &cs
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ import (
|
|||
fakekopsinternalversion "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake"
|
||||
kopsv1alpha2 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2"
|
||||
fakekopsv1alpha2 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake"
|
||||
kopsv1alpha3 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha3"
|
||||
fakekopsv1alpha3 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha3/fake"
|
||||
)
|
||||
|
||||
// NewSimpleClientset returns a clientset that will respond with the provided objects.
|
||||
|
|
@ -90,3 +92,8 @@ func (c *Clientset) Kops() kopsinternalversion.KopsInterface {
|
|||
func (c *Clientset) KopsV1alpha2() kopsv1alpha2.KopsV1alpha2Interface {
|
||||
return &fakekopsv1alpha2.FakeKopsV1alpha2{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// KopsV1alpha3 retrieves the KopsV1alpha3Client
|
||||
func (c *Clientset) KopsV1alpha3() kopsv1alpha3.KopsV1alpha3Interface {
|
||||
return &fakekopsv1alpha3.FakeKopsV1alpha3{Fake: &c.Fake}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import (
|
|||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
kopsinternalversion "k8s.io/kops/pkg/apis/kops"
|
||||
kopsv1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2"
|
||||
kopsv1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
)
|
||||
|
||||
var scheme = runtime.NewScheme()
|
||||
|
|
@ -34,6 +35,7 @@ var codecs = serializer.NewCodecFactory(scheme)
|
|||
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
kopsinternalversion.AddToScheme,
|
||||
kopsv1alpha2.AddToScheme,
|
||||
kopsv1alpha3.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
|
|
|
|||
|
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme"
|
||||
)
|
||||
|
||||
// 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 *v1alpha3.Cluster, opts v1.CreateOptions) (*v1alpha3.Cluster, error)
|
||||
Update(ctx context.Context, cluster *v1alpha3.Cluster, opts v1.UpdateOptions) (*v1alpha3.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) (*v1alpha3.Cluster, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.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 *v1alpha3.Cluster, err error)
|
||||
ClusterExpansion
|
||||
}
|
||||
|
||||
// clusters implements ClusterInterface
|
||||
type clusters struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newClusters returns a Clusters
|
||||
func newClusters(c *KopsV1alpha3Client, 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 *v1alpha3.Cluster, err error) {
|
||||
result = &v1alpha3.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 *v1alpha3.ClusterList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha3.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 *v1alpha3.Cluster, opts v1.CreateOptions) (result *v1alpha3.Cluster, err error) {
|
||||
result = &v1alpha3.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 *v1alpha3.Cluster, opts v1.UpdateOptions) (result *v1alpha3.Cluster, err error) {
|
||||
result = &v1alpha3.Cluster{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("clusters").
|
||||
Name(cluster.Name).
|
||||
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 *v1alpha3.Cluster, err error) {
|
||||
result = &v1alpha3.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
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha3
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
)
|
||||
|
||||
// FakeClusters implements ClusterInterface
|
||||
type FakeClusters struct {
|
||||
Fake *FakeKopsV1alpha3
|
||||
ns string
|
||||
}
|
||||
|
||||
var clustersResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha3", Resource: "clusters"}
|
||||
|
||||
var clustersKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha3", 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 *v1alpha3.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(clustersResource, c.ns, name), &v1alpha3.Cluster{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.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 *v1alpha3.ClusterList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(clustersResource, clustersKind, c.ns, opts), &v1alpha3.ClusterList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha3.ClusterList{ListMeta: obj.(*v1alpha3.ClusterList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha3.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 *v1alpha3.Cluster, opts v1.CreateOptions) (result *v1alpha3.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(clustersResource, c.ns, cluster), &v1alpha3.Cluster{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.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 *v1alpha3.Cluster, opts v1.UpdateOptions) (result *v1alpha3.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(clustersResource, c.ns, cluster), &v1alpha3.Cluster{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.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), &v1alpha3.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, &v1alpha3.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 *v1alpha3.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, pt, data, subresources...), &v1alpha3.Cluster{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.Cluster), err
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
)
|
||||
|
||||
// FakeInstanceGroups implements InstanceGroupInterface
|
||||
type FakeInstanceGroups struct {
|
||||
Fake *FakeKopsV1alpha3
|
||||
ns string
|
||||
}
|
||||
|
||||
var instancegroupsResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha3", Resource: "instancegroups"}
|
||||
|
||||
var instancegroupsKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha3", Kind: "InstanceGroup"}
|
||||
|
||||
// Get takes name of the instanceGroup, and returns the corresponding instanceGroup object, and an error if there is any.
|
||||
func (c *FakeInstanceGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.InstanceGroup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(instancegroupsResource, c.ns, name), &v1alpha3.InstanceGroup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.InstanceGroup), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of InstanceGroups that match those selectors.
|
||||
func (c *FakeInstanceGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.InstanceGroupList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(instancegroupsResource, instancegroupsKind, c.ns, opts), &v1alpha3.InstanceGroupList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha3.InstanceGroupList{ListMeta: obj.(*v1alpha3.InstanceGroupList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha3.InstanceGroupList).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 instanceGroups.
|
||||
func (c *FakeInstanceGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(instancegroupsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a instanceGroup and creates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
|
||||
func (c *FakeInstanceGroups) Create(ctx context.Context, instanceGroup *v1alpha3.InstanceGroup, opts v1.CreateOptions) (result *v1alpha3.InstanceGroup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(instancegroupsResource, c.ns, instanceGroup), &v1alpha3.InstanceGroup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.InstanceGroup), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a instanceGroup and updates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
|
||||
func (c *FakeInstanceGroups) Update(ctx context.Context, instanceGroup *v1alpha3.InstanceGroup, opts v1.UpdateOptions) (result *v1alpha3.InstanceGroup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(instancegroupsResource, c.ns, instanceGroup), &v1alpha3.InstanceGroup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.InstanceGroup), err
|
||||
}
|
||||
|
||||
// Delete takes name of the instanceGroup and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeInstanceGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(instancegroupsResource, c.ns, name), &v1alpha3.InstanceGroup{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeInstanceGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(instancegroupsResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha3.InstanceGroupList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched instanceGroup.
|
||||
func (c *FakeInstanceGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.InstanceGroup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(instancegroupsResource, c.ns, name, pt, data, subresources...), &v1alpha3.InstanceGroup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.InstanceGroup), err
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
)
|
||||
|
||||
// FakeKeysets implements KeysetInterface
|
||||
type FakeKeysets struct {
|
||||
Fake *FakeKopsV1alpha3
|
||||
ns string
|
||||
}
|
||||
|
||||
var keysetsResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha3", Resource: "keysets"}
|
||||
|
||||
var keysetsKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha3", Kind: "Keyset"}
|
||||
|
||||
// Get takes name of the keyset, and returns the corresponding keyset object, and an error if there is any.
|
||||
func (c *FakeKeysets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.Keyset, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(keysetsResource, c.ns, name), &v1alpha3.Keyset{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.Keyset), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Keysets that match those selectors.
|
||||
func (c *FakeKeysets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.KeysetList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(keysetsResource, keysetsKind, c.ns, opts), &v1alpha3.KeysetList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha3.KeysetList{ListMeta: obj.(*v1alpha3.KeysetList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha3.KeysetList).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 keysets.
|
||||
func (c *FakeKeysets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(keysetsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a keyset and creates it. Returns the server's representation of the keyset, and an error, if there is any.
|
||||
func (c *FakeKeysets) Create(ctx context.Context, keyset *v1alpha3.Keyset, opts v1.CreateOptions) (result *v1alpha3.Keyset, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(keysetsResource, c.ns, keyset), &v1alpha3.Keyset{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.Keyset), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a keyset and updates it. Returns the server's representation of the keyset, and an error, if there is any.
|
||||
func (c *FakeKeysets) Update(ctx context.Context, keyset *v1alpha3.Keyset, opts v1.UpdateOptions) (result *v1alpha3.Keyset, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(keysetsResource, c.ns, keyset), &v1alpha3.Keyset{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.Keyset), err
|
||||
}
|
||||
|
||||
// Delete takes name of the keyset and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeKeysets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(keysetsResource, c.ns, name), &v1alpha3.Keyset{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeKeysets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(keysetsResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha3.KeysetList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched keyset.
|
||||
func (c *FakeKeysets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.Keyset, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(keysetsResource, c.ns, name, pt, data, subresources...), &v1alpha3.Keyset{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.Keyset), err
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
v1alpha3 "k8s.io/kops/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha3"
|
||||
)
|
||||
|
||||
type FakeKopsV1alpha3 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeKopsV1alpha3) Clusters(namespace string) v1alpha3.ClusterInterface {
|
||||
return &FakeClusters{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeKopsV1alpha3) InstanceGroups(namespace string) v1alpha3.InstanceGroupInterface {
|
||||
return &FakeInstanceGroups{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeKopsV1alpha3) Keysets(namespace string) v1alpha3.KeysetInterface {
|
||||
return &FakeKeysets{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeKopsV1alpha3) SSHCredentials(namespace string) v1alpha3.SSHCredentialInterface {
|
||||
return &FakeSSHCredentials{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeKopsV1alpha3) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
)
|
||||
|
||||
// FakeSSHCredentials implements SSHCredentialInterface
|
||||
type FakeSSHCredentials struct {
|
||||
Fake *FakeKopsV1alpha3
|
||||
ns string
|
||||
}
|
||||
|
||||
var sshcredentialsResource = schema.GroupVersionResource{Group: "kops.k8s.io", Version: "v1alpha3", Resource: "sshcredentials"}
|
||||
|
||||
var sshcredentialsKind = schema.GroupVersionKind{Group: "kops.k8s.io", Version: "v1alpha3", Kind: "SSHCredential"}
|
||||
|
||||
// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any.
|
||||
func (c *FakeSSHCredentials) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.SSHCredential, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(sshcredentialsResource, c.ns, name), &v1alpha3.SSHCredential{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.SSHCredential), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors.
|
||||
func (c *FakeSSHCredentials) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.SSHCredentialList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(sshcredentialsResource, sshcredentialsKind, c.ns, opts), &v1alpha3.SSHCredentialList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha3.SSHCredentialList{ListMeta: obj.(*v1alpha3.SSHCredentialList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha3.SSHCredentialList).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 sSHCredentials.
|
||||
func (c *FakeSSHCredentials) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(sshcredentialsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
|
||||
func (c *FakeSSHCredentials) Create(ctx context.Context, sSHCredential *v1alpha3.SSHCredential, opts v1.CreateOptions) (result *v1alpha3.SSHCredential, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha3.SSHCredential{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.SSHCredential), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
|
||||
func (c *FakeSSHCredentials) Update(ctx context.Context, sSHCredential *v1alpha3.SSHCredential, opts v1.UpdateOptions) (result *v1alpha3.SSHCredential, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha3.SSHCredential{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.SSHCredential), err
|
||||
}
|
||||
|
||||
// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeSSHCredentials) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(sshcredentialsResource, c.ns, name), &v1alpha3.SSHCredential{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeSSHCredentials) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(sshcredentialsResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha3.SSHCredentialList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched sSHCredential.
|
||||
func (c *FakeSSHCredentials) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.SSHCredential, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(sshcredentialsResource, c.ns, name, pt, data, subresources...), &v1alpha3.SSHCredential{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha3.SSHCredential), err
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
type ClusterExpansion interface{}
|
||||
|
||||
type InstanceGroupExpansion interface{}
|
||||
|
||||
type KeysetExpansion interface{}
|
||||
|
||||
type SSHCredentialExpansion interface{}
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme"
|
||||
)
|
||||
|
||||
// InstanceGroupsGetter has a method to return a InstanceGroupInterface.
|
||||
// A group's client should implement this interface.
|
||||
type InstanceGroupsGetter interface {
|
||||
InstanceGroups(namespace string) InstanceGroupInterface
|
||||
}
|
||||
|
||||
// InstanceGroupInterface has methods to work with InstanceGroup resources.
|
||||
type InstanceGroupInterface interface {
|
||||
Create(ctx context.Context, instanceGroup *v1alpha3.InstanceGroup, opts v1.CreateOptions) (*v1alpha3.InstanceGroup, error)
|
||||
Update(ctx context.Context, instanceGroup *v1alpha3.InstanceGroup, opts v1.UpdateOptions) (*v1alpha3.InstanceGroup, 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) (*v1alpha3.InstanceGroup, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.InstanceGroupList, 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 *v1alpha3.InstanceGroup, err error)
|
||||
InstanceGroupExpansion
|
||||
}
|
||||
|
||||
// instanceGroups implements InstanceGroupInterface
|
||||
type instanceGroups struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newInstanceGroups returns a InstanceGroups
|
||||
func newInstanceGroups(c *KopsV1alpha3Client, namespace string) *instanceGroups {
|
||||
return &instanceGroups{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the instanceGroup, and returns the corresponding instanceGroup object, and an error if there is any.
|
||||
func (c *instanceGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.InstanceGroup, err error) {
|
||||
result = &v1alpha3.InstanceGroup{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("instancegroups").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of InstanceGroups that match those selectors.
|
||||
func (c *instanceGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.InstanceGroupList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha3.InstanceGroupList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("instancegroups").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested instanceGroups.
|
||||
func (c *instanceGroups) 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("instancegroups").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a instanceGroup and creates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
|
||||
func (c *instanceGroups) Create(ctx context.Context, instanceGroup *v1alpha3.InstanceGroup, opts v1.CreateOptions) (result *v1alpha3.InstanceGroup, err error) {
|
||||
result = &v1alpha3.InstanceGroup{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("instancegroups").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(instanceGroup).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a instanceGroup and updates it. Returns the server's representation of the instanceGroup, and an error, if there is any.
|
||||
func (c *instanceGroups) Update(ctx context.Context, instanceGroup *v1alpha3.InstanceGroup, opts v1.UpdateOptions) (result *v1alpha3.InstanceGroup, err error) {
|
||||
result = &v1alpha3.InstanceGroup{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("instancegroups").
|
||||
Name(instanceGroup.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(instanceGroup).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the instanceGroup and deletes it. Returns an error if one occurs.
|
||||
func (c *instanceGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("instancegroups").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *instanceGroups) 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("instancegroups").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched instanceGroup.
|
||||
func (c *instanceGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.InstanceGroup, err error) {
|
||||
result = &v1alpha3.InstanceGroup{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("instancegroups").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme"
|
||||
)
|
||||
|
||||
// KeysetsGetter has a method to return a KeysetInterface.
|
||||
// A group's client should implement this interface.
|
||||
type KeysetsGetter interface {
|
||||
Keysets(namespace string) KeysetInterface
|
||||
}
|
||||
|
||||
// KeysetInterface has methods to work with Keyset resources.
|
||||
type KeysetInterface interface {
|
||||
Create(ctx context.Context, keyset *v1alpha3.Keyset, opts v1.CreateOptions) (*v1alpha3.Keyset, error)
|
||||
Update(ctx context.Context, keyset *v1alpha3.Keyset, opts v1.UpdateOptions) (*v1alpha3.Keyset, 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) (*v1alpha3.Keyset, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.KeysetList, 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 *v1alpha3.Keyset, err error)
|
||||
KeysetExpansion
|
||||
}
|
||||
|
||||
// keysets implements KeysetInterface
|
||||
type keysets struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newKeysets returns a Keysets
|
||||
func newKeysets(c *KopsV1alpha3Client, namespace string) *keysets {
|
||||
return &keysets{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the keyset, and returns the corresponding keyset object, and an error if there is any.
|
||||
func (c *keysets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.Keyset, err error) {
|
||||
result = &v1alpha3.Keyset{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("keysets").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Keysets that match those selectors.
|
||||
func (c *keysets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.KeysetList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha3.KeysetList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("keysets").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested keysets.
|
||||
func (c *keysets) 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("keysets").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a keyset and creates it. Returns the server's representation of the keyset, and an error, if there is any.
|
||||
func (c *keysets) Create(ctx context.Context, keyset *v1alpha3.Keyset, opts v1.CreateOptions) (result *v1alpha3.Keyset, err error) {
|
||||
result = &v1alpha3.Keyset{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("keysets").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(keyset).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a keyset and updates it. Returns the server's representation of the keyset, and an error, if there is any.
|
||||
func (c *keysets) Update(ctx context.Context, keyset *v1alpha3.Keyset, opts v1.UpdateOptions) (result *v1alpha3.Keyset, err error) {
|
||||
result = &v1alpha3.Keyset{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("keysets").
|
||||
Name(keyset.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(keyset).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the keyset and deletes it. Returns an error if one occurs.
|
||||
func (c *keysets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("keysets").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *keysets) 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("keysets").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched keyset.
|
||||
func (c *keysets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.Keyset, err error) {
|
||||
result = &v1alpha3.Keyset{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("keysets").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
"k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme"
|
||||
)
|
||||
|
||||
type KopsV1alpha3Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
ClustersGetter
|
||||
InstanceGroupsGetter
|
||||
KeysetsGetter
|
||||
SSHCredentialsGetter
|
||||
}
|
||||
|
||||
// KopsV1alpha3Client is used to interact with features provided by the kops.k8s.io group.
|
||||
type KopsV1alpha3Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *KopsV1alpha3Client) Clusters(namespace string) ClusterInterface {
|
||||
return newClusters(c, namespace)
|
||||
}
|
||||
|
||||
func (c *KopsV1alpha3Client) InstanceGroups(namespace string) InstanceGroupInterface {
|
||||
return newInstanceGroups(c, namespace)
|
||||
}
|
||||
|
||||
func (c *KopsV1alpha3Client) Keysets(namespace string) KeysetInterface {
|
||||
return newKeysets(c, namespace)
|
||||
}
|
||||
|
||||
func (c *KopsV1alpha3Client) SSHCredentials(namespace string) SSHCredentialInterface {
|
||||
return newSSHCredentials(c, namespace)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new KopsV1alpha3Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*KopsV1alpha3Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &KopsV1alpha3Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new KopsV1alpha3Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *KopsV1alpha3Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new KopsV1alpha3Client for the given RESTClient.
|
||||
func New(c rest.Interface) *KopsV1alpha3Client {
|
||||
return &KopsV1alpha3Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha3.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 *KopsV1alpha3Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha3
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme"
|
||||
)
|
||||
|
||||
// SSHCredentialsGetter has a method to return a SSHCredentialInterface.
|
||||
// A group's client should implement this interface.
|
||||
type SSHCredentialsGetter interface {
|
||||
SSHCredentials(namespace string) SSHCredentialInterface
|
||||
}
|
||||
|
||||
// SSHCredentialInterface has methods to work with SSHCredential resources.
|
||||
type SSHCredentialInterface interface {
|
||||
Create(ctx context.Context, sSHCredential *v1alpha3.SSHCredential, opts v1.CreateOptions) (*v1alpha3.SSHCredential, error)
|
||||
Update(ctx context.Context, sSHCredential *v1alpha3.SSHCredential, opts v1.UpdateOptions) (*v1alpha3.SSHCredential, 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) (*v1alpha3.SSHCredential, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.SSHCredentialList, 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 *v1alpha3.SSHCredential, err error)
|
||||
SSHCredentialExpansion
|
||||
}
|
||||
|
||||
// sSHCredentials implements SSHCredentialInterface
|
||||
type sSHCredentials struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newSSHCredentials returns a SSHCredentials
|
||||
func newSSHCredentials(c *KopsV1alpha3Client, namespace string) *sSHCredentials {
|
||||
return &sSHCredentials{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any.
|
||||
func (c *sSHCredentials) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.SSHCredential, err error) {
|
||||
result = &v1alpha3.SSHCredential{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("sshcredentials").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors.
|
||||
func (c *sSHCredentials) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.SSHCredentialList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha3.SSHCredentialList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("sshcredentials").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested sSHCredentials.
|
||||
func (c *sSHCredentials) 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("sshcredentials").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
|
||||
func (c *sSHCredentials) Create(ctx context.Context, sSHCredential *v1alpha3.SSHCredential, opts v1.CreateOptions) (result *v1alpha3.SSHCredential, err error) {
|
||||
result = &v1alpha3.SSHCredential{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("sshcredentials").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(sSHCredential).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any.
|
||||
func (c *sSHCredentials) Update(ctx context.Context, sSHCredential *v1alpha3.SSHCredential, opts v1.UpdateOptions) (result *v1alpha3.SSHCredential, err error) {
|
||||
result = &v1alpha3.SSHCredential{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("sshcredentials").
|
||||
Name(sSHCredential.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(sSHCredential).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs.
|
||||
func (c *sSHCredentials) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("sshcredentials").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *sSHCredentials) 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("sshcredentials").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched sSHCredential.
|
||||
func (c *sSHCredentials) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.SSHCredential, err error) {
|
||||
result = &v1alpha3.SSHCredential{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("sshcredentials").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
Loading…
Reference in New Issue