Update Kubernetes packages to v1.23.0

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan
2021-12-14 17:56:59 +02:00
parent 6ca99a5ddb
commit 47ff00e9b9
33 changed files with 394 additions and 167 deletions
+37 -27
View File
@@ -20,6 +20,7 @@ package versioned
import (
"fmt"
"net/http"
appmeshv1beta1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta1"
appmeshv1beta2 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta2"
@@ -135,62 +136,81 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface {
// NewForConfig creates a new Clientset for the given config.
// If config's RateLimiter is not set and QPS and Burst are acceptable,
// NewForConfig will generate a rate-limiter in configShallowCopy.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*Clientset, error) {
configShallowCopy := *c
// share the transport between all clients
httpClient, err := rest.HTTPClientFor(&configShallowCopy)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&configShallowCopy, httpClient)
}
// NewForConfigAndClient creates a new Clientset for the given config and http client.
// Note the http client provided takes precedence over the configured transport values.
// If config's RateLimiter is not set and QPS and Burst are acceptable,
// NewForConfigAndClient will generate a rate-limiter in configShallowCopy.
func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) {
configShallowCopy := *c
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
if configShallowCopy.Burst <= 0 {
return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
}
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
}
var cs Clientset
var err error
cs.appmeshV1beta2, err = appmeshv1beta2.NewForConfig(&configShallowCopy)
cs.appmeshV1beta2, err = appmeshv1beta2.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.appmeshV1beta1, err = appmeshv1beta1.NewForConfig(&configShallowCopy)
cs.appmeshV1beta1, err = appmeshv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.flaggerV1beta1, err = flaggerv1beta1.NewForConfig(&configShallowCopy)
cs.flaggerV1beta1, err = flaggerv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.gatewayV1, err = gatewayv1.NewForConfig(&configShallowCopy)
cs.gatewayV1, err = gatewayv1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.glooV1, err = gloov1.NewForConfig(&configShallowCopy)
cs.glooV1, err = gloov1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.networkingV1alpha3, err = networkingv1alpha3.NewForConfig(&configShallowCopy)
cs.networkingV1alpha3, err = networkingv1alpha3.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.projectcontourV1, err = projectcontourv1.NewForConfig(&configShallowCopy)
cs.projectcontourV1, err = projectcontourv1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.splitV1alpha1, err = splitv1alpha1.NewForConfig(&configShallowCopy)
cs.splitV1alpha1, err = splitv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.splitV1alpha2, err = splitv1alpha2.NewForConfig(&configShallowCopy)
cs.splitV1alpha2, err = splitv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.splitV1alpha3, err = splitv1alpha3.NewForConfig(&configShallowCopy)
cs.splitV1alpha3, err = splitv1alpha3.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.traefikV1alpha1, err = traefikv1alpha1.NewForConfig(&configShallowCopy)
cs.traefikV1alpha1, err = traefikv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient)
if err != nil {
return nil, err
}
@@ -200,21 +220,11 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
// NewForConfigOrDie creates a new Clientset for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset
cs.appmeshV1beta2 = appmeshv1beta2.NewForConfigOrDie(c)
cs.appmeshV1beta1 = appmeshv1beta1.NewForConfigOrDie(c)
cs.flaggerV1beta1 = flaggerv1beta1.NewForConfigOrDie(c)
cs.gatewayV1 = gatewayv1.NewForConfigOrDie(c)
cs.glooV1 = gloov1.NewForConfigOrDie(c)
cs.networkingV1alpha3 = networkingv1alpha3.NewForConfigOrDie(c)
cs.projectcontourV1 = projectcontourv1.NewForConfigOrDie(c)
cs.splitV1alpha1 = splitv1alpha1.NewForConfigOrDie(c)
cs.splitV1alpha2 = splitv1alpha2.NewForConfigOrDie(c)
cs.splitV1alpha3 = splitv1alpha3.NewForConfigOrDie(c)
cs.traefikV1alpha1 = traefikv1alpha1.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs
cs, err := NewForConfig(c)
if err != nil {
panic(err)
}
return cs
}
// New creates a new Clientset for the given RESTClient.
@@ -94,7 +94,10 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
return c.tracker
}
var _ clientset.Interface = &Clientset{}
var (
_ clientset.Interface = &Clientset{}
_ testing.FakeClient = &Clientset{}
)
// AppmeshV1beta2 retrieves the AppmeshV1beta2Client
func (c *Clientset) AppmeshV1beta2() appmeshv1beta2.AppmeshV1beta2Interface {
@@ -19,6 +19,8 @@ limitations under the License.
package v1beta1
import (
"net/http"
v1beta1 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta1"
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
@@ -49,12 +51,28 @@ func (c *AppmeshV1beta1Client) VirtualServices(namespace string) VirtualServiceI
}
// NewForConfig creates a new AppmeshV1beta1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*AppmeshV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new AppmeshV1beta1Client 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) (*AppmeshV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
@@ -110,7 +110,7 @@ func (c *FakeMeshes) UpdateStatus(ctx context.Context, mesh *v1beta1.Mesh, opts
// Delete takes name of the mesh and deletes it. Returns an error if one occurs.
func (c *FakeMeshes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(meshesResource, name), &v1beta1.Mesh{})
Invokes(testing.NewRootDeleteActionWithOptions(meshesResource, name, opts), &v1beta1.Mesh{})
return err
}
@@ -117,7 +117,7 @@ func (c *FakeVirtualNodes) UpdateStatus(ctx context.Context, virtualNode *v1beta
// Delete takes name of the virtualNode and deletes it. Returns an error if one occurs.
func (c *FakeVirtualNodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(virtualnodesResource, c.ns, name), &v1beta1.VirtualNode{})
Invokes(testing.NewDeleteActionWithOptions(virtualnodesResource, c.ns, name, opts), &v1beta1.VirtualNode{})
return err
}
@@ -117,7 +117,7 @@ func (c *FakeVirtualServices) UpdateStatus(ctx context.Context, virtualService *
// Delete takes name of the virtualService and deletes it. Returns an error if one occurs.
func (c *FakeVirtualServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(virtualservicesResource, c.ns, name), &v1beta1.VirtualService{})
Invokes(testing.NewDeleteActionWithOptions(virtualservicesResource, c.ns, name, opts), &v1beta1.VirtualService{})
return err
}
@@ -19,6 +19,8 @@ limitations under the License.
package v1beta2
import (
"net/http"
v1beta2 "github.com/fluxcd/flagger/pkg/apis/appmesh/v1beta2"
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
@@ -49,12 +51,28 @@ func (c *AppmeshV1beta2Client) VirtualServices(namespace string) VirtualServiceI
}
// NewForConfig creates a new AppmeshV1beta2Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*AppmeshV1beta2Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new AppmeshV1beta2Client 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) (*AppmeshV1beta2Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
@@ -117,7 +117,7 @@ func (c *FakeVirtualNodes) UpdateStatus(ctx context.Context, virtualNode *v1beta
// Delete takes name of the virtualNode and deletes it. Returns an error if one occurs.
func (c *FakeVirtualNodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(virtualnodesResource, c.ns, name), &v1beta2.VirtualNode{})
Invokes(testing.NewDeleteActionWithOptions(virtualnodesResource, c.ns, name, opts), &v1beta2.VirtualNode{})
return err
}
@@ -117,7 +117,7 @@ func (c *FakeVirtualRouters) UpdateStatus(ctx context.Context, virtualRouter *v1
// Delete takes name of the virtualRouter and deletes it. Returns an error if one occurs.
func (c *FakeVirtualRouters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(virtualroutersResource, c.ns, name), &v1beta2.VirtualRouter{})
Invokes(testing.NewDeleteActionWithOptions(virtualroutersResource, c.ns, name, opts), &v1beta2.VirtualRouter{})
return err
}
@@ -117,7 +117,7 @@ func (c *FakeVirtualServices) UpdateStatus(ctx context.Context, virtualService *
// Delete takes name of the virtualService and deletes it. Returns an error if one occurs.
func (c *FakeVirtualServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(virtualservicesResource, c.ns, name), &v1beta2.VirtualService{})
Invokes(testing.NewDeleteActionWithOptions(virtualservicesResource, c.ns, name, opts), &v1beta2.VirtualService{})
return err
}
@@ -117,7 +117,7 @@ func (c *FakeAlertProviders) UpdateStatus(ctx context.Context, alertProvider *v1
// Delete takes name of the alertProvider and deletes it. Returns an error if one occurs.
func (c *FakeAlertProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(alertprovidersResource, c.ns, name), &v1beta1.AlertProvider{})
Invokes(testing.NewDeleteActionWithOptions(alertprovidersResource, c.ns, name, opts), &v1beta1.AlertProvider{})
return err
}
@@ -117,7 +117,7 @@ func (c *FakeCanaries) UpdateStatus(ctx context.Context, canary *v1beta1.Canary,
// Delete takes name of the canary and deletes it. Returns an error if one occurs.
func (c *FakeCanaries) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(canariesResource, c.ns, name), &v1beta1.Canary{})
Invokes(testing.NewDeleteActionWithOptions(canariesResource, c.ns, name, opts), &v1beta1.Canary{})
return err
}
@@ -117,7 +117,7 @@ func (c *FakeMetricTemplates) UpdateStatus(ctx context.Context, metricTemplate *
// Delete takes name of the metricTemplate and deletes it. Returns an error if one occurs.
func (c *FakeMetricTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(metrictemplatesResource, c.ns, name), &v1beta1.MetricTemplate{})
Invokes(testing.NewDeleteActionWithOptions(metrictemplatesResource, c.ns, name, opts), &v1beta1.MetricTemplate{})
return err
}
@@ -19,6 +19,8 @@ limitations under the License.
package v1beta1
import (
"net/http"
v1beta1 "github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
@@ -49,12 +51,28 @@ func (c *FlaggerV1beta1Client) MetricTemplates(namespace string) MetricTemplateI
}
// NewForConfig creates a new FlaggerV1beta1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*FlaggerV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new FlaggerV1beta1Client 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) (*FlaggerV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
@@ -105,7 +105,7 @@ func (c *FakeRouteTables) Update(ctx context.Context, routeTable *gatewayv1.Rout
// Delete takes name of the routeTable and deletes it. Returns an error if one occurs.
func (c *FakeRouteTables) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(routetablesResource, c.ns, name), &gatewayv1.RouteTable{})
Invokes(testing.NewDeleteActionWithOptions(routetablesResource, c.ns, name, opts), &gatewayv1.RouteTable{})
return err
}
@@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"net/http"
v1 "github.com/fluxcd/flagger/pkg/apis/gloo/gateway/v1"
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
@@ -39,12 +41,28 @@ func (c *GatewayV1Client) RouteTables(namespace string) RouteTableInterface {
}
// NewForConfig creates a new GatewayV1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*GatewayV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new GatewayV1Client 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) (*GatewayV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
@@ -105,7 +105,7 @@ func (c *FakeUpstreams) Update(ctx context.Context, upstream *gloov1.Upstream, o
// Delete takes name of the upstream and deletes it. Returns an error if one occurs.
func (c *FakeUpstreams) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(upstreamsResource, c.ns, name), &gloov1.Upstream{})
Invokes(testing.NewDeleteActionWithOptions(upstreamsResource, c.ns, name, opts), &gloov1.Upstream{})
return err
}
@@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"net/http"
v1 "github.com/fluxcd/flagger/pkg/apis/gloo/gloo/v1"
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
@@ -39,12 +41,28 @@ func (c *GlooV1Client) Upstreams(namespace string) UpstreamInterface {
}
// NewForConfig creates a new GlooV1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*GlooV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new GlooV1Client 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) (*GlooV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
@@ -105,7 +105,7 @@ func (c *FakeDestinationRules) Update(ctx context.Context, destinationRule *v1al
// Delete takes name of the destinationRule and deletes it. Returns an error if one occurs.
func (c *FakeDestinationRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(destinationrulesResource, c.ns, name), &v1alpha3.DestinationRule{})
Invokes(testing.NewDeleteActionWithOptions(destinationrulesResource, c.ns, name, opts), &v1alpha3.DestinationRule{})
return err
}
@@ -105,7 +105,7 @@ func (c *FakeVirtualServices) Update(ctx context.Context, virtualService *v1alph
// Delete takes name of the virtualService and deletes it. Returns an error if one occurs.
func (c *FakeVirtualServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(virtualservicesResource, c.ns, name), &v1alpha3.VirtualService{})
Invokes(testing.NewDeleteActionWithOptions(virtualservicesResource, c.ns, name, opts), &v1alpha3.VirtualService{})
return err
}
@@ -19,6 +19,8 @@ limitations under the License.
package v1alpha3
import (
"net/http"
v1alpha3 "github.com/fluxcd/flagger/pkg/apis/istio/v1alpha3"
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
@@ -44,12 +46,28 @@ func (c *NetworkingV1alpha3Client) VirtualServices(namespace string) VirtualServ
}
// NewForConfig creates a new NetworkingV1alpha3Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*NetworkingV1alpha3Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new NetworkingV1alpha3Client 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) (*NetworkingV1alpha3Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
@@ -117,7 +117,7 @@ func (c *FakeHTTPProxies) UpdateStatus(ctx context.Context, hTTPProxy *projectco
// Delete takes name of the hTTPProxy and deletes it. Returns an error if one occurs.
func (c *FakeHTTPProxies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(httpproxiesResource, c.ns, name), &projectcontourv1.HTTPProxy{})
Invokes(testing.NewDeleteActionWithOptions(httpproxiesResource, c.ns, name, opts), &projectcontourv1.HTTPProxy{})
return err
}
@@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"net/http"
v1 "github.com/fluxcd/flagger/pkg/apis/projectcontour/v1"
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
@@ -39,12 +41,28 @@ func (c *ProjectcontourV1Client) HTTPProxies(namespace string) HTTPProxyInterfac
}
// NewForConfig creates a new ProjectcontourV1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*ProjectcontourV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new ProjectcontourV1Client 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) (*ProjectcontourV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
@@ -105,7 +105,7 @@ func (c *FakeTrafficSplits) Update(ctx context.Context, trafficSplit *v1alpha1.T
// Delete takes name of the trafficSplit and deletes it. Returns an error if one occurs.
func (c *FakeTrafficSplits) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(trafficsplitsResource, c.ns, name), &v1alpha1.TrafficSplit{})
Invokes(testing.NewDeleteActionWithOptions(trafficsplitsResource, c.ns, name, opts), &v1alpha1.TrafficSplit{})
return err
}
@@ -19,6 +19,8 @@ limitations under the License.
package v1alpha1
import (
"net/http"
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha1"
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
@@ -39,12 +41,28 @@ func (c *SplitV1alpha1Client) TrafficSplits(namespace string) TrafficSplitInterf
}
// NewForConfig creates a new SplitV1alpha1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*SplitV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new SplitV1alpha1Client 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) (*SplitV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
@@ -105,7 +105,7 @@ func (c *FakeTrafficSplits) Update(ctx context.Context, trafficSplit *v1alpha2.T
// Delete takes name of the trafficSplit and deletes it. Returns an error if one occurs.
func (c *FakeTrafficSplits) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(trafficsplitsResource, c.ns, name), &v1alpha2.TrafficSplit{})
Invokes(testing.NewDeleteActionWithOptions(trafficsplitsResource, c.ns, name, opts), &v1alpha2.TrafficSplit{})
return err
}
@@ -19,6 +19,8 @@ limitations under the License.
package v1alpha2
import (
"net/http"
v1alpha2 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha2"
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
@@ -39,12 +41,28 @@ func (c *SplitV1alpha2Client) TrafficSplits(namespace string) TrafficSplitInterf
}
// NewForConfig creates a new SplitV1alpha2Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*SplitV1alpha2Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new SplitV1alpha2Client 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) (*SplitV1alpha2Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
@@ -105,7 +105,7 @@ func (c *FakeTrafficSplits) Update(ctx context.Context, trafficSplit *v1alpha3.T
// Delete takes name of the trafficSplit and deletes it. Returns an error if one occurs.
func (c *FakeTrafficSplits) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(trafficsplitsResource, c.ns, name), &v1alpha3.TrafficSplit{})
Invokes(testing.NewDeleteActionWithOptions(trafficsplitsResource, c.ns, name, opts), &v1alpha3.TrafficSplit{})
return err
}
@@ -19,6 +19,8 @@ limitations under the License.
package v1alpha3
import (
"net/http"
v1alpha3 "github.com/fluxcd/flagger/pkg/apis/smi/v1alpha3"
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
@@ -39,12 +41,28 @@ func (c *SplitV1alpha3Client) TrafficSplits(namespace string) TrafficSplitInterf
}
// NewForConfig creates a new SplitV1alpha3Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*SplitV1alpha3Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new SplitV1alpha3Client 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) (*SplitV1alpha3Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}
@@ -105,7 +105,7 @@ func (c *FakeTraefikServices) Update(ctx context.Context, traefikService *v1alph
// Delete takes name of the traefikService and deletes it. Returns an error if one occurs.
func (c *FakeTraefikServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(traefikservicesResource, c.ns, name), &v1alpha1.TraefikService{})
Invokes(testing.NewDeleteActionWithOptions(traefikservicesResource, c.ns, name, opts), &v1alpha1.TraefikService{})
return err
}
@@ -19,6 +19,8 @@ limitations under the License.
package v1alpha1
import (
"net/http"
v1alpha1 "github.com/fluxcd/flagger/pkg/apis/traefik/v1alpha1"
"github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
@@ -39,12 +41,28 @@ func (c *TraefikV1alpha1Client) TraefikServices(namespace string) TraefikService
}
// NewForConfig creates a new TraefikV1alpha1Client for the given config.
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
// where httpClient was generated with rest.HTTPClientFor(c).
func NewForConfig(c *rest.Config) (*TraefikV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
httpClient, err := rest.HTTPClientFor(&config)
if err != nil {
return nil, err
}
return NewForConfigAndClient(&config, httpClient)
}
// NewForConfigAndClient creates a new TraefikV1alpha1Client 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) (*TraefikV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientForConfigAndClient(&config, h)
if err != nil {
return nil, err
}