mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-31 22:59:34 +00:00
Revert "Introduce APIs to support multiple ClusterCIDRs (#108290)"
This reverts commit b9792a9daef4d978c5c30b6d10cbcdfa77a9b6ac. Kubernetes-commit: 7d57d5c70d04f652b431d2b86b8af40e119cd66a
This commit is contained in:
committed by
Kubernetes Publisher
parent
af4295f501
commit
f9fdccdfc3
@@ -53,7 +53,6 @@ import (
|
||||
flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2"
|
||||
networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1"
|
||||
networkingv1alpha1 "k8s.io/client-go/kubernetes/typed/networking/v1alpha1"
|
||||
networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1"
|
||||
nodev1 "k8s.io/client-go/kubernetes/typed/node/v1"
|
||||
nodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1"
|
||||
@@ -105,7 +104,6 @@ type Interface interface {
|
||||
FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1Interface
|
||||
FlowcontrolV1beta2() flowcontrolv1beta2.FlowcontrolV1beta2Interface
|
||||
NetworkingV1() networkingv1.NetworkingV1Interface
|
||||
NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface
|
||||
NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface
|
||||
NodeV1() nodev1.NodeV1Interface
|
||||
NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface
|
||||
@@ -157,7 +155,6 @@ type Clientset struct {
|
||||
flowcontrolV1beta1 *flowcontrolv1beta1.FlowcontrolV1beta1Client
|
||||
flowcontrolV1beta2 *flowcontrolv1beta2.FlowcontrolV1beta2Client
|
||||
networkingV1 *networkingv1.NetworkingV1Client
|
||||
networkingV1alpha1 *networkingv1alpha1.NetworkingV1alpha1Client
|
||||
networkingV1beta1 *networkingv1beta1.NetworkingV1beta1Client
|
||||
nodeV1 *nodev1.NodeV1Client
|
||||
nodeV1alpha1 *nodev1alpha1.NodeV1alpha1Client
|
||||
@@ -325,11 +322,6 @@ func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface {
|
||||
return c.networkingV1
|
||||
}
|
||||
|
||||
// NetworkingV1alpha1 retrieves the NetworkingV1alpha1Client
|
||||
func (c *Clientset) NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface {
|
||||
return c.networkingV1alpha1
|
||||
}
|
||||
|
||||
// NetworkingV1beta1 retrieves the NetworkingV1beta1Client
|
||||
func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface {
|
||||
return c.networkingV1beta1
|
||||
@@ -569,10 +561,6 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.networkingV1alpha1, err = networkingv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.networkingV1beta1, err = networkingv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -684,7 +672,6 @@ func New(c rest.Interface) *Clientset {
|
||||
cs.flowcontrolV1beta1 = flowcontrolv1beta1.New(c)
|
||||
cs.flowcontrolV1beta2 = flowcontrolv1beta2.New(c)
|
||||
cs.networkingV1 = networkingv1.New(c)
|
||||
cs.networkingV1alpha1 = networkingv1alpha1.New(c)
|
||||
cs.networkingV1beta1 = networkingv1beta1.New(c)
|
||||
cs.nodeV1 = nodev1.New(c)
|
||||
cs.nodeV1alpha1 = nodev1alpha1.New(c)
|
||||
|
@@ -84,8 +84,6 @@ import (
|
||||
fakeflowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2/fake"
|
||||
networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1"
|
||||
fakenetworkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1/fake"
|
||||
networkingv1alpha1 "k8s.io/client-go/kubernetes/typed/networking/v1alpha1"
|
||||
fakenetworkingv1alpha1 "k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake"
|
||||
networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1"
|
||||
fakenetworkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1/fake"
|
||||
nodev1 "k8s.io/client-go/kubernetes/typed/node/v1"
|
||||
@@ -319,11 +317,6 @@ func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface {
|
||||
return &fakenetworkingv1.FakeNetworkingV1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// NetworkingV1alpha1 retrieves the NetworkingV1alpha1Client
|
||||
func (c *Clientset) NetworkingV1alpha1() networkingv1alpha1.NetworkingV1alpha1Interface {
|
||||
return &fakenetworkingv1alpha1.FakeNetworkingV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// NetworkingV1beta1 retrieves the NetworkingV1beta1Client
|
||||
func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface {
|
||||
return &fakenetworkingv1beta1.FakeNetworkingV1beta1{Fake: &c.Fake}
|
||||
|
@@ -49,7 +49,6 @@ import (
|
||||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
networkingv1 "k8s.io/api/networking/v1"
|
||||
networkingv1alpha1 "k8s.io/api/networking/v1alpha1"
|
||||
networkingv1beta1 "k8s.io/api/networking/v1beta1"
|
||||
nodev1 "k8s.io/api/node/v1"
|
||||
nodev1alpha1 "k8s.io/api/node/v1alpha1"
|
||||
@@ -106,7 +105,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
flowcontrolv1beta1.AddToScheme,
|
||||
flowcontrolv1beta2.AddToScheme,
|
||||
networkingv1.AddToScheme,
|
||||
networkingv1alpha1.AddToScheme,
|
||||
networkingv1beta1.AddToScheme,
|
||||
nodev1.AddToScheme,
|
||||
nodev1alpha1.AddToScheme,
|
||||
|
@@ -49,7 +49,6 @@ import (
|
||||
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
|
||||
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
|
||||
networkingv1 "k8s.io/api/networking/v1"
|
||||
networkingv1alpha1 "k8s.io/api/networking/v1alpha1"
|
||||
networkingv1beta1 "k8s.io/api/networking/v1beta1"
|
||||
nodev1 "k8s.io/api/node/v1"
|
||||
nodev1alpha1 "k8s.io/api/node/v1alpha1"
|
||||
@@ -106,7 +105,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
flowcontrolv1beta1.AddToScheme,
|
||||
flowcontrolv1beta2.AddToScheme,
|
||||
networkingv1.AddToScheme,
|
||||
networkingv1alpha1.AddToScheme,
|
||||
networkingv1beta1.AddToScheme,
|
||||
nodev1.AddToScheme,
|
||||
nodev1alpha1.AddToScheme,
|
||||
|
@@ -1,243 +0,0 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1alpha1 "k8s.io/api/networking/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1"
|
||||
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// ClusterCIDRConfigsGetter has a method to return a ClusterCIDRConfigInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ClusterCIDRConfigsGetter interface {
|
||||
ClusterCIDRConfigs() ClusterCIDRConfigInterface
|
||||
}
|
||||
|
||||
// ClusterCIDRConfigInterface has methods to work with ClusterCIDRConfig resources.
|
||||
type ClusterCIDRConfigInterface interface {
|
||||
Create(ctx context.Context, clusterCIDRConfig *v1alpha1.ClusterCIDRConfig, opts v1.CreateOptions) (*v1alpha1.ClusterCIDRConfig, error)
|
||||
Update(ctx context.Context, clusterCIDRConfig *v1alpha1.ClusterCIDRConfig, opts v1.UpdateOptions) (*v1alpha1.ClusterCIDRConfig, error)
|
||||
UpdateStatus(ctx context.Context, clusterCIDRConfig *v1alpha1.ClusterCIDRConfig, opts v1.UpdateOptions) (*v1alpha1.ClusterCIDRConfig, error)
|
||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterCIDRConfig, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterCIDRConfigList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterCIDRConfig, err error)
|
||||
Apply(ctx context.Context, clusterCIDRConfig *networkingv1alpha1.ClusterCIDRConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterCIDRConfig, err error)
|
||||
ApplyStatus(ctx context.Context, clusterCIDRConfig *networkingv1alpha1.ClusterCIDRConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterCIDRConfig, err error)
|
||||
ClusterCIDRConfigExpansion
|
||||
}
|
||||
|
||||
// clusterCIDRConfigs implements ClusterCIDRConfigInterface
|
||||
type clusterCIDRConfigs struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newClusterCIDRConfigs returns a ClusterCIDRConfigs
|
||||
func newClusterCIDRConfigs(c *NetworkingV1alpha1Client) *clusterCIDRConfigs {
|
||||
return &clusterCIDRConfigs{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the clusterCIDRConfig, and returns the corresponding clusterCIDRConfig object, and an error if there is any.
|
||||
func (c *clusterCIDRConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
result = &v1alpha1.ClusterCIDRConfig{}
|
||||
err = c.client.Get().
|
||||
Resource("clustercidrconfigs").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ClusterCIDRConfigs that match those selectors.
|
||||
func (c *clusterCIDRConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterCIDRConfigList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1alpha1.ClusterCIDRConfigList{}
|
||||
err = c.client.Get().
|
||||
Resource("clustercidrconfigs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested clusterCIDRConfigs.
|
||||
func (c *clusterCIDRConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Resource("clustercidrconfigs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a clusterCIDRConfig and creates it. Returns the server's representation of the clusterCIDRConfig, and an error, if there is any.
|
||||
func (c *clusterCIDRConfigs) Create(ctx context.Context, clusterCIDRConfig *v1alpha1.ClusterCIDRConfig, opts v1.CreateOptions) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
result = &v1alpha1.ClusterCIDRConfig{}
|
||||
err = c.client.Post().
|
||||
Resource("clustercidrconfigs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(clusterCIDRConfig).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a clusterCIDRConfig and updates it. Returns the server's representation of the clusterCIDRConfig, and an error, if there is any.
|
||||
func (c *clusterCIDRConfigs) Update(ctx context.Context, clusterCIDRConfig *v1alpha1.ClusterCIDRConfig, opts v1.UpdateOptions) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
result = &v1alpha1.ClusterCIDRConfig{}
|
||||
err = c.client.Put().
|
||||
Resource("clustercidrconfigs").
|
||||
Name(clusterCIDRConfig.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(clusterCIDRConfig).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *clusterCIDRConfigs) UpdateStatus(ctx context.Context, clusterCIDRConfig *v1alpha1.ClusterCIDRConfig, opts v1.UpdateOptions) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
result = &v1alpha1.ClusterCIDRConfig{}
|
||||
err = c.client.Put().
|
||||
Resource("clustercidrconfigs").
|
||||
Name(clusterCIDRConfig.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(clusterCIDRConfig).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the clusterCIDRConfig and deletes it. Returns an error if one occurs.
|
||||
func (c *clusterCIDRConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("clustercidrconfigs").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *clusterCIDRConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Resource("clustercidrconfigs").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched clusterCIDRConfig.
|
||||
func (c *clusterCIDRConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
result = &v1alpha1.ClusterCIDRConfig{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("clustercidrconfigs").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied clusterCIDRConfig.
|
||||
func (c *clusterCIDRConfigs) Apply(ctx context.Context, clusterCIDRConfig *networkingv1alpha1.ClusterCIDRConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
if clusterCIDRConfig == nil {
|
||||
return nil, fmt.Errorf("clusterCIDRConfig provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(clusterCIDRConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := clusterCIDRConfig.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("clusterCIDRConfig.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1alpha1.ClusterCIDRConfig{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Resource("clustercidrconfigs").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *clusterCIDRConfigs) ApplyStatus(ctx context.Context, clusterCIDRConfig *networkingv1alpha1.ClusterCIDRConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
if clusterCIDRConfig == nil {
|
||||
return nil, fmt.Errorf("clusterCIDRConfig provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(clusterCIDRConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
name := clusterCIDRConfig.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("clusterCIDRConfig.Name must be provided to Apply")
|
||||
}
|
||||
|
||||
result = &v1alpha1.ClusterCIDRConfig{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Resource("clustercidrconfigs").
|
||||
Name(*name).
|
||||
SubResource("status").
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1alpha1
|
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
@@ -1,179 +0,0 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
|
||||
v1alpha1 "k8s.io/api/networking/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeClusterCIDRConfigs implements ClusterCIDRConfigInterface
|
||||
type FakeClusterCIDRConfigs struct {
|
||||
Fake *FakeNetworkingV1alpha1
|
||||
}
|
||||
|
||||
var clustercidrconfigsResource = schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1alpha1", Resource: "clustercidrconfigs"}
|
||||
|
||||
var clustercidrconfigsKind = schema.GroupVersionKind{Group: "networking.k8s.io", Version: "v1alpha1", Kind: "ClusterCIDRConfig"}
|
||||
|
||||
// Get takes name of the clusterCIDRConfig, and returns the corresponding clusterCIDRConfig object, and an error if there is any.
|
||||
func (c *FakeClusterCIDRConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(clustercidrconfigsResource, name), &v1alpha1.ClusterCIDRConfig{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.ClusterCIDRConfig), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ClusterCIDRConfigs that match those selectors.
|
||||
func (c *FakeClusterCIDRConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterCIDRConfigList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(clustercidrconfigsResource, clustercidrconfigsKind, opts), &v1alpha1.ClusterCIDRConfigList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.ClusterCIDRConfigList{ListMeta: obj.(*v1alpha1.ClusterCIDRConfigList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.ClusterCIDRConfigList).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 clusterCIDRConfigs.
|
||||
func (c *FakeClusterCIDRConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(clustercidrconfigsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a clusterCIDRConfig and creates it. Returns the server's representation of the clusterCIDRConfig, and an error, if there is any.
|
||||
func (c *FakeClusterCIDRConfigs) Create(ctx context.Context, clusterCIDRConfig *v1alpha1.ClusterCIDRConfig, opts v1.CreateOptions) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(clustercidrconfigsResource, clusterCIDRConfig), &v1alpha1.ClusterCIDRConfig{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.ClusterCIDRConfig), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a clusterCIDRConfig and updates it. Returns the server's representation of the clusterCIDRConfig, and an error, if there is any.
|
||||
func (c *FakeClusterCIDRConfigs) Update(ctx context.Context, clusterCIDRConfig *v1alpha1.ClusterCIDRConfig, opts v1.UpdateOptions) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(clustercidrconfigsResource, clusterCIDRConfig), &v1alpha1.ClusterCIDRConfig{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.ClusterCIDRConfig), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeClusterCIDRConfigs) UpdateStatus(ctx context.Context, clusterCIDRConfig *v1alpha1.ClusterCIDRConfig, opts v1.UpdateOptions) (*v1alpha1.ClusterCIDRConfig, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceAction(clustercidrconfigsResource, "status", clusterCIDRConfig), &v1alpha1.ClusterCIDRConfig{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.ClusterCIDRConfig), err
|
||||
}
|
||||
|
||||
// Delete takes name of the clusterCIDRConfig and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeClusterCIDRConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(clustercidrconfigsResource, name, opts), &v1alpha1.ClusterCIDRConfig{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeClusterCIDRConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(clustercidrconfigsResource, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterCIDRConfigList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched clusterCIDRConfig.
|
||||
func (c *FakeClusterCIDRConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(clustercidrconfigsResource, name, pt, data, subresources...), &v1alpha1.ClusterCIDRConfig{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.ClusterCIDRConfig), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied clusterCIDRConfig.
|
||||
func (c *FakeClusterCIDRConfigs) Apply(ctx context.Context, clusterCIDRConfig *networkingv1alpha1.ClusterCIDRConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
if clusterCIDRConfig == nil {
|
||||
return nil, fmt.Errorf("clusterCIDRConfig provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(clusterCIDRConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := clusterCIDRConfig.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("clusterCIDRConfig.Name must be provided to Apply")
|
||||
}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(clustercidrconfigsResource, *name, types.ApplyPatchType, data), &v1alpha1.ClusterCIDRConfig{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.ClusterCIDRConfig), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeClusterCIDRConfigs) ApplyStatus(ctx context.Context, clusterCIDRConfig *networkingv1alpha1.ClusterCIDRConfigApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterCIDRConfig, err error) {
|
||||
if clusterCIDRConfig == nil {
|
||||
return nil, fmt.Errorf("clusterCIDRConfig provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(clusterCIDRConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := clusterCIDRConfig.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("clusterCIDRConfig.Name must be provided to Apply")
|
||||
}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(clustercidrconfigsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.ClusterCIDRConfig{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1alpha1.ClusterCIDRConfig), err
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1alpha1 "k8s.io/client-go/kubernetes/typed/networking/v1alpha1"
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
type FakeNetworkingV1alpha1 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeNetworkingV1alpha1) ClusterCIDRConfigs() v1alpha1.ClusterCIDRConfigInterface {
|
||||
return &FakeClusterCIDRConfigs{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeNetworkingV1alpha1) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
type ClusterCIDRConfigExpansion interface{}
|
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
v1alpha1 "k8s.io/api/networking/v1alpha1"
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type NetworkingV1alpha1Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
ClusterCIDRConfigsGetter
|
||||
}
|
||||
|
||||
// NetworkingV1alpha1Client is used to interact with features provided by the networking.k8s.io group.
|
||||
type NetworkingV1alpha1Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *NetworkingV1alpha1Client) ClusterCIDRConfigs() ClusterCIDRConfigInterface {
|
||||
return newClusterCIDRConfigs(c)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new NetworkingV1alpha1Client for the given config.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*NetworkingV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
httpClient, err := rest.HTTPClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewForConfigAndClient(&config, httpClient)
|
||||
}
|
||||
|
||||
// NewForConfigAndClient creates a new NetworkingV1alpha1Client for the given config and http client.
|
||||
// Note the http client provided takes precedence over the configured transport values.
|
||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1alpha1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &NetworkingV1alpha1Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new NetworkingV1alpha1Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *NetworkingV1alpha1Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new NetworkingV1alpha1Client for the given RESTClient.
|
||||
func New(c rest.Interface) *NetworkingV1alpha1Client {
|
||||
return &NetworkingV1alpha1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1alpha1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *NetworkingV1alpha1Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
Reference in New Issue
Block a user