mirror of https://github.com/kubernetes/kops.git
Run "make apimachinery"
This commit is contained in:
parent
dad2539310
commit
1221b0e178
|
@ -20,6 +20,7 @@ package clientset
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
rest "k8s.io/client-go/rest"
|
||||
|
@ -71,30 +72,53 @@ 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
|
||||
|
||||
if configShallowCopy.UserAgent == "" {
|
||||
configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
// 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.kops, err = kopsinternalversion.NewForConfig(&configShallowCopy)
|
||||
cs.kops, err = kopsinternalversion.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.kopsV1alpha2, err = kopsv1alpha2.NewForConfig(&configShallowCopy)
|
||||
cs.kopsV1alpha2, err = kopsv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.kopsV1alpha3, err = kopsv1alpha3.NewForConfig(&configShallowCopy)
|
||||
cs.kopsV1alpha3, err = kopsv1alpha3.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
|
||||
}
|
||||
|
@ -104,13 +128,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.kops = kopsinternalversion.NewForConfigOrDie(c)
|
||||
cs.kopsV1alpha2 = kopsv1alpha2.NewForConfigOrDie(c)
|
||||
cs.kopsV1alpha3 = kopsv1alpha3.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.
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeClusters) Update(ctx context.Context, cluster *kops.Cluster, opts v
|
|||
// 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), &kops.Cluster{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(clustersResource, c.ns, name, opts), &kops.Cluster{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeInstanceGroups) Update(ctx context.Context, instanceGroup *kops.Ins
|
|||
// 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), &kops.InstanceGroup{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(instancegroupsResource, c.ns, name, opts), &kops.InstanceGroup{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeKeysets) Update(ctx context.Context, keyset *kops.Keyset, opts v1.U
|
|||
// 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), &kops.Keyset{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(keysetsResource, c.ns, name, opts), &kops.Keyset{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeSSHCredentials) Update(ctx context.Context, sSHCredential *kops.SSH
|
|||
// 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), &kops.SSHCredential{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(sshcredentialsResource, c.ns, name, opts), &kops.SSHCredential{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ limitations under the License.
|
|||
package internalversion
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
rest "k8s.io/client-go/rest"
|
||||
"k8s.io/kops/pkg/client/clientset_generated/clientset/scheme"
|
||||
)
|
||||
|
@ -53,12 +55,28 @@ func (c *KopsClient) SSHCredentials(namespace string) SSHCredentialInterface {
|
|||
}
|
||||
|
||||
// NewForConfig creates a new KopsClient for the given config.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*KopsClient, 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 KopsClient 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) (*KopsClient, 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 *FakeClusters) Update(ctx context.Context, cluster *v1alpha2.Cluster, op
|
|||
// 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), &v1alpha2.Cluster{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(clustersResource, c.ns, name, opts), &v1alpha2.Cluster{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeInstanceGroups) Update(ctx context.Context, instanceGroup *v1alpha2
|
|||
// 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), &v1alpha2.InstanceGroup{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(instancegroupsResource, c.ns, name, opts), &v1alpha2.InstanceGroup{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeKeysets) Update(ctx context.Context, keyset *v1alpha2.Keyset, opts
|
|||
// 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), &v1alpha2.Keyset{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(keysetsResource, c.ns, name, opts), &v1alpha2.Keyset{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeSSHCredentials) Update(ctx context.Context, sSHCredential *v1alpha2
|
|||
// 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), &v1alpha2.SSHCredential{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(sshcredentialsResource, c.ns, name, opts), &v1alpha2.SSHCredential{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ limitations under the License.
|
|||
package v1alpha2
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2"
|
||||
"k8s.io/kops/pkg/client/clientset_generated/clientset/scheme"
|
||||
|
@ -54,12 +56,28 @@ func (c *KopsV1alpha2Client) SSHCredentials(namespace string) SSHCredentialInter
|
|||
}
|
||||
|
||||
// NewForConfig creates a new KopsV1alpha2Client for the given config.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*KopsV1alpha2Client, 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 KopsV1alpha2Client 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) (*KopsV1alpha2Client, 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 *FakeClusters) Update(ctx context.Context, cluster *v1alpha3.Cluster, op
|
|||
// 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{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(clustersResource, c.ns, name, opts), &v1alpha3.Cluster{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeInstanceGroups) Update(ctx context.Context, instanceGroup *v1alpha3
|
|||
// 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{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(instancegroupsResource, c.ns, name, opts), &v1alpha3.InstanceGroup{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeKeysets) Update(ctx context.Context, keyset *v1alpha3.Keyset, opts
|
|||
// 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{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(keysetsResource, c.ns, name, opts), &v1alpha3.Keyset{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeSSHCredentials) Update(ctx context.Context, sSHCredential *v1alpha3
|
|||
// 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{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(sshcredentialsResource, c.ns, name, opts), &v1alpha3.SSHCredential{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ limitations under the License.
|
|||
package v1alpha3
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
"k8s.io/kops/pkg/client/clientset_generated/clientset/scheme"
|
||||
|
@ -54,12 +56,28 @@ func (c *KopsV1alpha3Client) SSHCredentials(namespace string) SSHCredentialInter
|
|||
}
|
||||
|
||||
// NewForConfig creates a new KopsV1alpha3Client for the given config.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*KopsV1alpha3Client, 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 KopsV1alpha3Client 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) (*KopsV1alpha3Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ package internalclientset
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
rest "k8s.io/client-go/rest"
|
||||
|
@ -71,30 +72,53 @@ 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
|
||||
|
||||
if configShallowCopy.UserAgent == "" {
|
||||
configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
// 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.kops, err = kopsinternalversion.NewForConfig(&configShallowCopy)
|
||||
cs.kops, err = kopsinternalversion.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.kopsV1alpha2, err = kopsv1alpha2.NewForConfig(&configShallowCopy)
|
||||
cs.kopsV1alpha2, err = kopsv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.kopsV1alpha3, err = kopsv1alpha3.NewForConfig(&configShallowCopy)
|
||||
cs.kopsV1alpha3, err = kopsv1alpha3.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
|
||||
}
|
||||
|
@ -104,13 +128,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.kops = kopsinternalversion.NewForConfigOrDie(c)
|
||||
cs.kopsV1alpha2 = kopsv1alpha2.NewForConfigOrDie(c)
|
||||
cs.kopsV1alpha3 = kopsv1alpha3.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.
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeClusters) Update(ctx context.Context, cluster *kops.Cluster, opts v
|
|||
// 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), &kops.Cluster{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(clustersResource, c.ns, name, opts), &kops.Cluster{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeInstanceGroups) Update(ctx context.Context, instanceGroup *kops.Ins
|
|||
// 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), &kops.InstanceGroup{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(instancegroupsResource, c.ns, name, opts), &kops.InstanceGroup{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeKeysets) Update(ctx context.Context, keyset *kops.Keyset, opts v1.U
|
|||
// 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), &kops.Keyset{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(keysetsResource, c.ns, name, opts), &kops.Keyset{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeSSHCredentials) Update(ctx context.Context, sSHCredential *kops.SSH
|
|||
// 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), &kops.SSHCredential{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(sshcredentialsResource, c.ns, name, opts), &kops.SSHCredential{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ limitations under the License.
|
|||
package internalversion
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
rest "k8s.io/client-go/rest"
|
||||
"k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme"
|
||||
)
|
||||
|
@ -53,12 +55,28 @@ func (c *KopsClient) SSHCredentials(namespace string) SSHCredentialInterface {
|
|||
}
|
||||
|
||||
// NewForConfig creates a new KopsClient for the given config.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*KopsClient, 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 KopsClient 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) (*KopsClient, 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 *FakeClusters) Update(ctx context.Context, cluster *v1alpha2.Cluster, op
|
|||
// 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), &v1alpha2.Cluster{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(clustersResource, c.ns, name, opts), &v1alpha2.Cluster{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeInstanceGroups) Update(ctx context.Context, instanceGroup *v1alpha2
|
|||
// 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), &v1alpha2.InstanceGroup{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(instancegroupsResource, c.ns, name, opts), &v1alpha2.InstanceGroup{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeKeysets) Update(ctx context.Context, keyset *v1alpha2.Keyset, opts
|
|||
// 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), &v1alpha2.Keyset{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(keysetsResource, c.ns, name, opts), &v1alpha2.Keyset{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeSSHCredentials) Update(ctx context.Context, sSHCredential *v1alpha2
|
|||
// 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), &v1alpha2.SSHCredential{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(sshcredentialsResource, c.ns, name, opts), &v1alpha2.SSHCredential{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ limitations under the License.
|
|||
package v1alpha2
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2"
|
||||
"k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme"
|
||||
|
@ -54,12 +56,28 @@ func (c *KopsV1alpha2Client) SSHCredentials(namespace string) SSHCredentialInter
|
|||
}
|
||||
|
||||
// NewForConfig creates a new KopsV1alpha2Client for the given config.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*KopsV1alpha2Client, 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 KopsV1alpha2Client 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) (*KopsV1alpha2Client, 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 *FakeClusters) Update(ctx context.Context, cluster *v1alpha3.Cluster, op
|
|||
// 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{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(clustersResource, c.ns, name, opts), &v1alpha3.Cluster{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeInstanceGroups) Update(ctx context.Context, instanceGroup *v1alpha3
|
|||
// 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{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(instancegroupsResource, c.ns, name, opts), &v1alpha3.InstanceGroup{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeKeysets) Update(ctx context.Context, keyset *v1alpha3.Keyset, opts
|
|||
// 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{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(keysetsResource, c.ns, name, opts), &v1alpha3.Keyset{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ func (c *FakeSSHCredentials) Update(ctx context.Context, sSHCredential *v1alpha3
|
|||
// 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{})
|
||||
Invokes(testing.NewDeleteActionWithOptions(sshcredentialsResource, c.ns, name, opts), &v1alpha3.SSHCredential{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ limitations under the License.
|
|||
package v1alpha3
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1alpha3 "k8s.io/kops/pkg/apis/kops/v1alpha3"
|
||||
"k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme"
|
||||
|
@ -54,12 +56,28 @@ func (c *KopsV1alpha3Client) SSHCredentials(namespace string) SSHCredentialInter
|
|||
}
|
||||
|
||||
// NewForConfig creates a new KopsV1alpha3Client for the given config.
|
||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||
func NewForConfig(c *rest.Config) (*KopsV1alpha3Client, 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 KopsV1alpha3Client 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) (*KopsV1alpha3Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientForConfigAndClient(&config, h)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue