From 1eceb788e6970d2d4fb389d2498475bd09d4977c Mon Sep 17 00:00:00 2001 From: Alexander Brandstedt Date: Mon, 21 Aug 2017 17:18:00 +0200 Subject: [PATCH 1/5] implementation of adding ssh public key using sshsecret spec --- cmd/kops/create.go | 34 +++++++++++++++++++++++ docs/cli/kops_create.md | 3 ++ docs/secrets.md | 12 ++++++++ pkg/apis/kops/register.go | 5 ++++ pkg/apis/kops/sshsecret.go | 43 +++++++++++++++++++++++++++++ pkg/apis/kops/v1alpha1/register.go | 5 ++++ pkg/apis/kops/v1alpha1/sshsecret.go | 43 +++++++++++++++++++++++++++++ pkg/apis/kops/v1alpha2/register.go | 5 ++++ pkg/apis/kops/v1alpha2/sshsecret.go | 43 +++++++++++++++++++++++++++++ 9 files changed, 193 insertions(+) create mode 100644 pkg/apis/kops/sshsecret.go create mode 100644 pkg/apis/kops/v1alpha1/sshsecret.go create mode 100644 pkg/apis/kops/v1alpha2/sshsecret.go diff --git a/cmd/kops/create.go b/cmd/kops/create.go index 75eb15147e..85d025ffd1 100644 --- a/cmd/kops/create.go +++ b/cmd/kops/create.go @@ -27,6 +27,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/kops/cmd/kops/util" kopsapi "k8s.io/kops/pkg/apis/kops" + "k8s.io/kops/pkg/apis/kops/registry" "k8s.io/kops/pkg/apis/kops/v1alpha1" "k8s.io/kops/upup/pkg/fi/cloudup" "k8s.io/kops/util/pkg/vfs" @@ -54,6 +55,9 @@ var ( # Create a cluster from the configuration specification in a YAML file kops create -f my-cluster.yaml + # Create secret from secret spec file + kops create -f secret.yaml + # Create a cluster in AWS kops create cluster --name=kubernetes-cluster.example.com \ --state=s3://kops-state-1234 --zones=eu-west-1a \ @@ -190,6 +194,36 @@ func RunCreate(f *util.Factory, out io.Writer, c *CreateOptions) error { fmt.Fprintf(&sb, "Created instancegroup/%s\n", v.ObjectMeta.Name) } + case *kopsapi.SSHSecret: + clusterName = v.ObjectMeta.Labels[kopsapi.LabelClusterName] + if clusterName == "" { + return fmt.Errorf("must specify %q label with cluster name to create instanceGroup", kopsapi.LabelClusterName) + } + if v.Spec.Username == "" { + return fmt.Errorf("spec.username is required") + } + if v.Spec.SshPublicKey == "" { + return fmt.Errorf("spec.sshPublicKey is required") + } + + cluster, err := clientset.GetCluster(clusterName) + if err != nil { + return err + } + + keyStore, err := registry.KeyStore(cluster) + if err != nil { + return err + } + + sshKeyArr := []byte(v.Spec.SshPublicKey) + err = keyStore.AddSSHPublicKey(v.Spec.Username, sshKeyArr) + if err != nil { + return err + } else { + fmt.Fprintf(&sb, "Added SSHSecret ssh key\n") + } + default: glog.V(2).Infof("Type of object was %T", v) return fmt.Errorf("Unhandled kind %q in %s", gvk, f) diff --git a/docs/cli/kops_create.md b/docs/cli/kops_create.md index c900770382..84cc1f7434 100644 --- a/docs/cli/kops_create.md +++ b/docs/cli/kops_create.md @@ -27,6 +27,9 @@ kops create -f FILENAME # Create a cluster from the configuration specification in a YAML file kops create -f my-cluster.yaml + # Create secret from secret spec file + kops create -f secret.yaml + # Create a cluster in AWS kops create cluster --name=kubernetes-cluster.example.com \ --state=s3://kops-state-1234 --zones=eu-west-1a \ diff --git a/docs/secrets.md b/docs/secrets.md index 8c6755492e..df58bf69d4 100644 --- a/docs/secrets.md +++ b/docs/secrets.md @@ -24,3 +24,15 @@ The ID form can be used when there are multiple matching keys. example: `kops delete secret sshpublickey admin` + +### adding secret from spec file +```bash +apiVersion: kops/v1alpha2 +kind: SSHSecret +metadata: + labels: + kops.k8s.io/cluster: dev.k8s.example.com +spec: + username: "admin" + sshPublicKey: "ssh-rsa AAAAB3NzaC1 dev@devbox" +``` diff --git a/pkg/apis/kops/register.go b/pkg/apis/kops/register.go index 43ce1a5e3e..cf53435237 100644 --- a/pkg/apis/kops/register.go +++ b/pkg/apis/kops/register.go @@ -65,6 +65,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &InstanceGroupList{}, &Federation{}, &FederationList{}, + &SSHSecret{}, + &SSHSecretList{}, ) //metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil @@ -79,3 +81,6 @@ func (obj *InstanceGroup) GetObjectKind() schema.ObjectKind { func (obj *Federation) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } +func (obj *SSHSecret) GetObjectKind() schema.ObjectKind { + return &obj.TypeMeta +} \ No newline at end of file diff --git a/pkg/apis/kops/sshsecret.go b/pkg/apis/kops/sshsecret.go new file mode 100644 index 0000000000..44fa9ea03c --- /dev/null +++ b/pkg/apis/kops/sshsecret.go @@ -0,0 +1,43 @@ +/* +Copyright 2016 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. +*/ + +package kops + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient=true + +// SSHSecret represent a set of kops secrets +type SSHSecret struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec SSHSecretSpec `json:"spec,omitempty"` +} + +type SSHSecretSpec struct { + SshPublicKey string `json:"sshPublicKey,omitempty"` + Username string `json:"username,omitempty"` +} + +type SSHSecretList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []SSHSecret `json:"items"` +} diff --git a/pkg/apis/kops/v1alpha1/register.go b/pkg/apis/kops/v1alpha1/register.go index a5deefefde..8454e7449e 100644 --- a/pkg/apis/kops/v1alpha1/register.go +++ b/pkg/apis/kops/v1alpha1/register.go @@ -52,6 +52,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &InstanceGroupList{}, &Federation{}, &FederationList{}, + &SSHSecret{}, + &SSHSecretList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) @@ -68,6 +70,9 @@ func (obj *InstanceGroup) GetObjectKind() schema.ObjectKind { func (obj *Federation) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } +func (obj *SSHSecret) GetObjectKind() schema.ObjectKind { + return &obj.TypeMeta +} func addConversionFuncs(scheme *runtime.Scheme) error { // Add non-generated conversion functions diff --git a/pkg/apis/kops/v1alpha1/sshsecret.go b/pkg/apis/kops/v1alpha1/sshsecret.go new file mode 100644 index 0000000000..22266196f4 --- /dev/null +++ b/pkg/apis/kops/v1alpha1/sshsecret.go @@ -0,0 +1,43 @@ +/* +Copyright 2016 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. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient=true + +// SSHSecret represent a set of kops secrets +type SSHSecret struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec SSHSecretSpec `json:"spec,omitempty"` +} + +type SSHSecretSpec struct { + SshPublicKey string `json:"sshPublicKey,omitempty"` + Username string `json:"username,omitempty"` +} + +type SSHSecretList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []SSHSecret `json:"items"` +} diff --git a/pkg/apis/kops/v1alpha2/register.go b/pkg/apis/kops/v1alpha2/register.go index b09059bb23..b86adbbb55 100644 --- a/pkg/apis/kops/v1alpha2/register.go +++ b/pkg/apis/kops/v1alpha2/register.go @@ -53,6 +53,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &InstanceGroupList{}, &Federation{}, &FederationList{}, + &SSHSecret{}, + &SSHSecretList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) @@ -69,6 +71,9 @@ func (obj *InstanceGroup) GetObjectKind() schema.ObjectKind { func (obj *Federation) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } +func (obj *SSHSecret) GetObjectKind() schema.ObjectKind { + return &obj.TypeMeta +} func addConversionFuncs(scheme *runtime.Scheme) error { return nil diff --git a/pkg/apis/kops/v1alpha2/sshsecret.go b/pkg/apis/kops/v1alpha2/sshsecret.go new file mode 100644 index 0000000000..5653716afe --- /dev/null +++ b/pkg/apis/kops/v1alpha2/sshsecret.go @@ -0,0 +1,43 @@ +/* +Copyright 2016 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. +*/ + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient=true + +// SSHSecret represent a set of kops secrets +type SSHSecret struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec SSHSecretSpec `json:"spec,omitempty"` +} + +type SSHSecretSpec struct { + SshPublicKey string `json:"sshPublicKey,omitempty"` + Username string `json:"username,omitempty"` +} + +type SSHSecretList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []SSHSecret `json:"items"` +} From 7bfb7c25abf9b10ae2df2ae4137a9464da9d982a Mon Sep 17 00:00:00 2001 From: Alexander Brandstedt Date: Mon, 21 Aug 2017 17:18:14 +0200 Subject: [PATCH 2/5] adding generated core --- pkg/apis/kops/register.go | 2 +- .../kops/v1alpha1/zz_generated.conversion.go | 96 +++++++++++ .../kops/v1alpha2/zz_generated.conversion.go | 96 +++++++++++ .../internalversion/fake/fake_kops_client.go | 4 + .../internalversion/fake/fake_sshsecret.go | 120 ++++++++++++++ .../internalversion/generated_expansion.go | 2 + .../typed/kops/internalversion/kops_client.go | 5 + .../typed/kops/internalversion/sshsecret.go | 155 ++++++++++++++++++ .../kops/v1alpha1/fake/fake_kops_client.go | 4 + .../kops/v1alpha1/fake/fake_sshsecret.go | 120 ++++++++++++++ .../kops/v1alpha1/generated_expansion.go | 2 + .../typed/kops/v1alpha1/kops_client.go | 5 + .../typed/kops/v1alpha1/sshsecret.go | 155 ++++++++++++++++++ .../kops/v1alpha2/fake/fake_kops_client.go | 4 + .../kops/v1alpha2/fake/fake_sshsecret.go | 120 ++++++++++++++ .../kops/v1alpha2/generated_expansion.go | 2 + .../typed/kops/v1alpha2/kops_client.go | 5 + .../typed/kops/v1alpha2/sshsecret.go | 155 ++++++++++++++++++ .../internalversion/fake/fake_kops_client.go | 4 + .../internalversion/fake/fake_sshsecret.go | 120 ++++++++++++++ .../internalversion/generated_expansion.go | 2 + .../typed/kops/internalversion/kops_client.go | 5 + .../typed/kops/internalversion/sshsecret.go | 155 ++++++++++++++++++ .../kops/v1alpha1/fake/fake_kops_client.go | 4 + .../kops/v1alpha1/fake/fake_sshsecret.go | 120 ++++++++++++++ .../kops/v1alpha1/generated_expansion.go | 2 + .../typed/kops/v1alpha1/kops_client.go | 5 + .../typed/kops/v1alpha1/sshsecret.go | 155 ++++++++++++++++++ .../kops/v1alpha2/fake/fake_kops_client.go | 4 + .../kops/v1alpha2/fake/fake_sshsecret.go | 120 ++++++++++++++ .../kops/v1alpha2/generated_expansion.go | 2 + .../typed/kops/v1alpha2/kops_client.go | 5 + .../typed/kops/v1alpha2/sshsecret.go | 155 ++++++++++++++++++ 33 files changed, 1909 insertions(+), 1 deletion(-) create mode 100644 pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_sshsecret.go create mode 100644 pkg/client/clientset_generated/clientset/typed/kops/internalversion/sshsecret.go create mode 100644 pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_sshsecret.go create mode 100644 pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/sshsecret.go create mode 100644 pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_sshsecret.go create mode 100644 pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/sshsecret.go create mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_sshsecret.go create mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/sshsecret.go create mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_sshsecret.go create mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/sshsecret.go create mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_sshsecret.go create mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/sshsecret.go diff --git a/pkg/apis/kops/register.go b/pkg/apis/kops/register.go index cf53435237..58b81f1eec 100644 --- a/pkg/apis/kops/register.go +++ b/pkg/apis/kops/register.go @@ -83,4 +83,4 @@ func (obj *Federation) GetObjectKind() schema.ObjectKind { } func (obj *SSHSecret) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta -} \ No newline at end of file +} diff --git a/pkg/apis/kops/v1alpha1/zz_generated.conversion.go b/pkg/apis/kops/v1alpha1/zz_generated.conversion.go index 68f24372f5..d942666bb6 100644 --- a/pkg/apis/kops/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha1/zz_generated.conversion.go @@ -123,6 +123,12 @@ func RegisterConversions(scheme *runtime.Scheme) error { Convert_kops_NetworkingSpec_To_v1alpha1_NetworkingSpec, Convert_v1alpha1_RBACAuthorizationSpec_To_kops_RBACAuthorizationSpec, Convert_kops_RBACAuthorizationSpec_To_v1alpha1_RBACAuthorizationSpec, + Convert_v1alpha1_SSHSecret_To_kops_SSHSecret, + Convert_kops_SSHSecret_To_v1alpha1_SSHSecret, + Convert_v1alpha1_SSHSecretList_To_kops_SSHSecretList, + Convert_kops_SSHSecretList_To_v1alpha1_SSHSecretList, + Convert_v1alpha1_SSHSecretSpec_To_kops_SSHSecretSpec, + Convert_kops_SSHSecretSpec_To_v1alpha1_SSHSecretSpec, Convert_v1alpha1_WeaveNetworkingSpec_To_kops_WeaveNetworkingSpec, Convert_kops_WeaveNetworkingSpec_To_v1alpha1_WeaveNetworkingSpec, ) @@ -2158,6 +2164,96 @@ func Convert_kops_RBACAuthorizationSpec_To_v1alpha1_RBACAuthorizationSpec(in *ko return autoConvert_kops_RBACAuthorizationSpec_To_v1alpha1_RBACAuthorizationSpec(in, out, s) } +func autoConvert_v1alpha1_SSHSecret_To_kops_SSHSecret(in *SSHSecret, out *kops.SSHSecret, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha1_SSHSecretSpec_To_kops_SSHSecretSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha1_SSHSecret_To_kops_SSHSecret is an autogenerated conversion function. +func Convert_v1alpha1_SSHSecret_To_kops_SSHSecret(in *SSHSecret, out *kops.SSHSecret, s conversion.Scope) error { + return autoConvert_v1alpha1_SSHSecret_To_kops_SSHSecret(in, out, s) +} + +func autoConvert_kops_SSHSecret_To_v1alpha1_SSHSecret(in *kops.SSHSecret, out *SSHSecret, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_kops_SSHSecretSpec_To_v1alpha1_SSHSecretSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_kops_SSHSecret_To_v1alpha1_SSHSecret is an autogenerated conversion function. +func Convert_kops_SSHSecret_To_v1alpha1_SSHSecret(in *kops.SSHSecret, out *SSHSecret, s conversion.Scope) error { + return autoConvert_kops_SSHSecret_To_v1alpha1_SSHSecret(in, out, s) +} + +func autoConvert_v1alpha1_SSHSecretList_To_kops_SSHSecretList(in *SSHSecretList, out *kops.SSHSecretList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]kops.SSHSecret, len(*in)) + for i := range *in { + if err := Convert_v1alpha1_SSHSecret_To_kops_SSHSecret(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = make([]kops.SSHSecret, 0) + } + return nil +} + +// Convert_v1alpha1_SSHSecretList_To_kops_SSHSecretList is an autogenerated conversion function. +func Convert_v1alpha1_SSHSecretList_To_kops_SSHSecretList(in *SSHSecretList, out *kops.SSHSecretList, s conversion.Scope) error { + return autoConvert_v1alpha1_SSHSecretList_To_kops_SSHSecretList(in, out, s) +} + +func autoConvert_kops_SSHSecretList_To_v1alpha1_SSHSecretList(in *kops.SSHSecretList, out *SSHSecretList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SSHSecret, len(*in)) + for i := range *in { + if err := Convert_kops_SSHSecret_To_v1alpha1_SSHSecret(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = make([]SSHSecret, 0) + } + return nil +} + +// Convert_kops_SSHSecretList_To_v1alpha1_SSHSecretList is an autogenerated conversion function. +func Convert_kops_SSHSecretList_To_v1alpha1_SSHSecretList(in *kops.SSHSecretList, out *SSHSecretList, s conversion.Scope) error { + return autoConvert_kops_SSHSecretList_To_v1alpha1_SSHSecretList(in, out, s) +} + +func autoConvert_v1alpha1_SSHSecretSpec_To_kops_SSHSecretSpec(in *SSHSecretSpec, out *kops.SSHSecretSpec, s conversion.Scope) error { + out.SshPublicKey = in.SshPublicKey + out.Username = in.Username + return nil +} + +// Convert_v1alpha1_SSHSecretSpec_To_kops_SSHSecretSpec is an autogenerated conversion function. +func Convert_v1alpha1_SSHSecretSpec_To_kops_SSHSecretSpec(in *SSHSecretSpec, out *kops.SSHSecretSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_SSHSecretSpec_To_kops_SSHSecretSpec(in, out, s) +} + +func autoConvert_kops_SSHSecretSpec_To_v1alpha1_SSHSecretSpec(in *kops.SSHSecretSpec, out *SSHSecretSpec, s conversion.Scope) error { + out.SshPublicKey = in.SshPublicKey + out.Username = in.Username + return nil +} + +// Convert_kops_SSHSecretSpec_To_v1alpha1_SSHSecretSpec is an autogenerated conversion function. +func Convert_kops_SSHSecretSpec_To_v1alpha1_SSHSecretSpec(in *kops.SSHSecretSpec, out *SSHSecretSpec, s conversion.Scope) error { + return autoConvert_kops_SSHSecretSpec_To_v1alpha1_SSHSecretSpec(in, out, s) +} + func autoConvert_v1alpha1_WeaveNetworkingSpec_To_kops_WeaveNetworkingSpec(in *WeaveNetworkingSpec, out *kops.WeaveNetworkingSpec, s conversion.Scope) error { out.MTU = in.MTU return nil diff --git a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go index 234e91e252..6c0a90ecda 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go @@ -127,6 +127,12 @@ func RegisterConversions(scheme *runtime.Scheme) error { Convert_kops_NetworkingSpec_To_v1alpha2_NetworkingSpec, Convert_v1alpha2_RBACAuthorizationSpec_To_kops_RBACAuthorizationSpec, Convert_kops_RBACAuthorizationSpec_To_v1alpha2_RBACAuthorizationSpec, + Convert_v1alpha2_SSHSecret_To_kops_SSHSecret, + Convert_kops_SSHSecret_To_v1alpha2_SSHSecret, + Convert_v1alpha2_SSHSecretList_To_kops_SSHSecretList, + Convert_kops_SSHSecretList_To_v1alpha2_SSHSecretList, + Convert_v1alpha2_SSHSecretSpec_To_kops_SSHSecretSpec, + Convert_kops_SSHSecretSpec_To_v1alpha2_SSHSecretSpec, Convert_v1alpha2_TopologySpec_To_kops_TopologySpec, Convert_kops_TopologySpec_To_v1alpha2_TopologySpec, Convert_v1alpha2_WeaveNetworkingSpec_To_kops_WeaveNetworkingSpec, @@ -2266,6 +2272,96 @@ func Convert_kops_RBACAuthorizationSpec_To_v1alpha2_RBACAuthorizationSpec(in *ko return autoConvert_kops_RBACAuthorizationSpec_To_v1alpha2_RBACAuthorizationSpec(in, out, s) } +func autoConvert_v1alpha2_SSHSecret_To_kops_SSHSecret(in *SSHSecret, out *kops.SSHSecret, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha2_SSHSecretSpec_To_kops_SSHSecretSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha2_SSHSecret_To_kops_SSHSecret is an autogenerated conversion function. +func Convert_v1alpha2_SSHSecret_To_kops_SSHSecret(in *SSHSecret, out *kops.SSHSecret, s conversion.Scope) error { + return autoConvert_v1alpha2_SSHSecret_To_kops_SSHSecret(in, out, s) +} + +func autoConvert_kops_SSHSecret_To_v1alpha2_SSHSecret(in *kops.SSHSecret, out *SSHSecret, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_kops_SSHSecretSpec_To_v1alpha2_SSHSecretSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_kops_SSHSecret_To_v1alpha2_SSHSecret is an autogenerated conversion function. +func Convert_kops_SSHSecret_To_v1alpha2_SSHSecret(in *kops.SSHSecret, out *SSHSecret, s conversion.Scope) error { + return autoConvert_kops_SSHSecret_To_v1alpha2_SSHSecret(in, out, s) +} + +func autoConvert_v1alpha2_SSHSecretList_To_kops_SSHSecretList(in *SSHSecretList, out *kops.SSHSecretList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]kops.SSHSecret, len(*in)) + for i := range *in { + if err := Convert_v1alpha2_SSHSecret_To_kops_SSHSecret(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = make([]kops.SSHSecret, 0) + } + return nil +} + +// Convert_v1alpha2_SSHSecretList_To_kops_SSHSecretList is an autogenerated conversion function. +func Convert_v1alpha2_SSHSecretList_To_kops_SSHSecretList(in *SSHSecretList, out *kops.SSHSecretList, s conversion.Scope) error { + return autoConvert_v1alpha2_SSHSecretList_To_kops_SSHSecretList(in, out, s) +} + +func autoConvert_kops_SSHSecretList_To_v1alpha2_SSHSecretList(in *kops.SSHSecretList, out *SSHSecretList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SSHSecret, len(*in)) + for i := range *in { + if err := Convert_kops_SSHSecret_To_v1alpha2_SSHSecret(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = make([]SSHSecret, 0) + } + return nil +} + +// Convert_kops_SSHSecretList_To_v1alpha2_SSHSecretList is an autogenerated conversion function. +func Convert_kops_SSHSecretList_To_v1alpha2_SSHSecretList(in *kops.SSHSecretList, out *SSHSecretList, s conversion.Scope) error { + return autoConvert_kops_SSHSecretList_To_v1alpha2_SSHSecretList(in, out, s) +} + +func autoConvert_v1alpha2_SSHSecretSpec_To_kops_SSHSecretSpec(in *SSHSecretSpec, out *kops.SSHSecretSpec, s conversion.Scope) error { + out.SshPublicKey = in.SshPublicKey + out.Username = in.Username + return nil +} + +// Convert_v1alpha2_SSHSecretSpec_To_kops_SSHSecretSpec is an autogenerated conversion function. +func Convert_v1alpha2_SSHSecretSpec_To_kops_SSHSecretSpec(in *SSHSecretSpec, out *kops.SSHSecretSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_SSHSecretSpec_To_kops_SSHSecretSpec(in, out, s) +} + +func autoConvert_kops_SSHSecretSpec_To_v1alpha2_SSHSecretSpec(in *kops.SSHSecretSpec, out *SSHSecretSpec, s conversion.Scope) error { + out.SshPublicKey = in.SshPublicKey + out.Username = in.Username + return nil +} + +// Convert_kops_SSHSecretSpec_To_v1alpha2_SSHSecretSpec is an autogenerated conversion function. +func Convert_kops_SSHSecretSpec_To_v1alpha2_SSHSecretSpec(in *kops.SSHSecretSpec, out *SSHSecretSpec, s conversion.Scope) error { + return autoConvert_kops_SSHSecretSpec_To_v1alpha2_SSHSecretSpec(in, out, s) +} + func autoConvert_v1alpha2_TopologySpec_To_kops_TopologySpec(in *TopologySpec, out *kops.TopologySpec, s conversion.Scope) error { out.Masters = in.Masters out.Nodes = in.Nodes diff --git a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_kops_client.go b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_kops_client.go index ab3b8bada0..fd427a507c 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_kops_client.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_kops_client.go @@ -38,6 +38,10 @@ func (c *FakeKops) InstanceGroups(namespace string) internalversion.InstanceGrou return &FakeInstanceGroups{c, namespace} } +func (c *FakeKops) SSHSecrets(namespace string) internalversion.SSHSecretInterface { + return &FakeSSHSecrets{c, namespace} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeKops) RESTClient() rest.Interface { diff --git a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_sshsecret.go b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_sshsecret.go new file mode 100644 index 0000000000..ecd577c9f5 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_sshsecret.go @@ -0,0 +1,120 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + kops "k8s.io/kops/pkg/apis/kops" +) + +// FakeSSHSecrets implements SSHSecretInterface +type FakeSSHSecrets struct { + Fake *FakeKops + ns string +} + +var sshsecretsResource = schema.GroupVersionResource{Group: "kops", Version: "", Resource: "sshsecrets"} + +var sshsecretsKind = schema.GroupVersionKind{Group: "kops", Version: "", Kind: "SSHSecret"} + +func (c *FakeSSHSecrets) Create(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sshsecretsResource, c.ns, sSHSecret), &kops.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHSecret), err +} + +func (c *FakeSSHSecrets) Update(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sshsecretsResource, c.ns, sSHSecret), &kops.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHSecret), err +} + +func (c *FakeSSHSecrets) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(sshsecretsResource, c.ns, name), &kops.SSHSecret{}) + + return err +} + +func (c *FakeSSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sshsecretsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &kops.SSHSecretList{}) + return err +} + +func (c *FakeSSHSecrets) Get(name string, options v1.GetOptions) (result *kops.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sshsecretsResource, c.ns, name), &kops.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHSecret), err +} + +func (c *FakeSSHSecrets) List(opts v1.ListOptions) (result *kops.SSHSecretList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sshsecretsResource, sshsecretsKind, c.ns, opts), &kops.SSHSecretList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kops.SSHSecretList{} + for _, item := range obj.(*kops.SSHSecretList).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 sSHSecrets. +func (c *FakeSSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sshsecretsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched sSHSecret. +func (c *FakeSSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sshsecretsResource, c.ns, name, data, subresources...), &kops.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHSecret), err +} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/generated_expansion.go b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/generated_expansion.go index 68f36300eb..8885bd5db7 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/generated_expansion.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/generated_expansion.go @@ -21,3 +21,5 @@ type ClusterExpansion interface{} type FederationExpansion interface{} type InstanceGroupExpansion interface{} + +type SSHSecretExpansion interface{} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/kops_client.go b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/kops_client.go index ddc9226f26..87b8047eab 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/kops_client.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/kops_client.go @@ -26,6 +26,7 @@ type KopsInterface interface { ClustersGetter FederationsGetter InstanceGroupsGetter + SSHSecretsGetter } // KopsClient is used to interact with features provided by the kops group. @@ -45,6 +46,10 @@ func (c *KopsClient) InstanceGroups(namespace string) InstanceGroupInterface { return newInstanceGroups(c, namespace) } +func (c *KopsClient) SSHSecrets(namespace string) SSHSecretInterface { + return newSSHSecrets(c, namespace) +} + // NewForConfig creates a new KopsClient for the given config. func NewForConfig(c *rest.Config) (*KopsClient, error) { config := *c diff --git a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/sshsecret.go b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/sshsecret.go new file mode 100644 index 0000000000..c8867a2433 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/sshsecret.go @@ -0,0 +1,155 @@ +/* +Copyright 2017 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. +*/ + +package internalversion + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + kops "k8s.io/kops/pkg/apis/kops" + scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme" +) + +// SSHSecretsGetter has a method to return a SSHSecretInterface. +// A group's client should implement this interface. +type SSHSecretsGetter interface { + SSHSecrets(namespace string) SSHSecretInterface +} + +// SSHSecretInterface has methods to work with SSHSecret resources. +type SSHSecretInterface interface { + Create(*kops.SSHSecret) (*kops.SSHSecret, error) + Update(*kops.SSHSecret) (*kops.SSHSecret, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*kops.SSHSecret, error) + List(opts v1.ListOptions) (*kops.SSHSecretList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHSecret, err error) + SSHSecretExpansion +} + +// sSHSecrets implements SSHSecretInterface +type sSHSecrets struct { + client rest.Interface + ns string +} + +// newSSHSecrets returns a SSHSecrets +func newSSHSecrets(c *KopsClient, namespace string) *sSHSecrets { + return &sSHSecrets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a sSHSecret and creates it. Returns the server's representation of the sSHSecret, and an error, if there is any. +func (c *sSHSecrets) Create(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { + result = &kops.SSHSecret{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sshsecrets"). + Body(sSHSecret). + Do(). + Into(result) + return +} + +// Update takes the representation of a sSHSecret and updates it. Returns the server's representation of the sSHSecret, and an error, if there is any. +func (c *sSHSecrets) Update(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { + result = &kops.SSHSecret{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(sSHSecret.Name). + Body(sSHSecret). + Do(). + Into(result) + return +} + +// Delete takes name of the sSHSecret and deletes it. Returns an error if one occurs. +func (c *sSHSecrets) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the sSHSecret, and returns the corresponding sSHSecret object, and an error if there is any. +func (c *sSHSecrets) Get(name string, options v1.GetOptions) (result *kops.SSHSecret, err error) { + result = &kops.SSHSecret{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SSHSecrets that match those selectors. +func (c *sSHSecrets) List(opts v1.ListOptions) (result *kops.SSHSecretList, err error) { + result = &kops.SSHSecretList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sSHSecrets. +func (c *sSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched sSHSecret. +func (c *sSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHSecret, err error) { + result = &kops.SSHSecret{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sshsecrets"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_kops_client.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_kops_client.go index faa73c6652..bc8aaa5a0f 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_kops_client.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_kops_client.go @@ -38,6 +38,10 @@ func (c *FakeKopsV1alpha1) InstanceGroups(namespace string) v1alpha1.InstanceGro return &FakeInstanceGroups{c, namespace} } +func (c *FakeKopsV1alpha1) SSHSecrets(namespace string) v1alpha1.SSHSecretInterface { + return &FakeSSHSecrets{c, namespace} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeKopsV1alpha1) RESTClient() rest.Interface { diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_sshsecret.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_sshsecret.go new file mode 100644 index 0000000000..4e42ea4768 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_sshsecret.go @@ -0,0 +1,120 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1" +) + +// FakeSSHSecrets implements SSHSecretInterface +type FakeSSHSecrets struct { + Fake *FakeKopsV1alpha1 + ns string +} + +var sshsecretsResource = schema.GroupVersionResource{Group: "kops", Version: "v1alpha1", Resource: "sshsecrets"} + +var sshsecretsKind = schema.GroupVersionKind{Group: "kops", Version: "v1alpha1", Kind: "SSHSecret"} + +func (c *FakeSSHSecrets) Create(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha1.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHSecret), err +} + +func (c *FakeSSHSecrets) Update(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha1.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHSecret), err +} + +func (c *FakeSSHSecrets) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(sshsecretsResource, c.ns, name), &v1alpha1.SSHSecret{}) + + return err +} + +func (c *FakeSSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sshsecretsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.SSHSecretList{}) + return err +} + +func (c *FakeSSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sshsecretsResource, c.ns, name), &v1alpha1.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHSecret), err +} + +func (c *FakeSSHSecrets) List(opts v1.ListOptions) (result *v1alpha1.SSHSecretList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sshsecretsResource, sshsecretsKind, c.ns, opts), &v1alpha1.SSHSecretList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.SSHSecretList{} + for _, item := range obj.(*v1alpha1.SSHSecretList).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 sSHSecrets. +func (c *FakeSSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sshsecretsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched sSHSecret. +func (c *FakeSSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sshsecretsResource, c.ns, name, data, subresources...), &v1alpha1.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHSecret), err +} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/generated_expansion.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/generated_expansion.go index 0b0957675c..b9ab3b64c3 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/generated_expansion.go @@ -21,3 +21,5 @@ type ClusterExpansion interface{} type FederationExpansion interface{} type InstanceGroupExpansion interface{} + +type SSHSecretExpansion interface{} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/kops_client.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/kops_client.go index 7ba76332f4..42b0901151 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/kops_client.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/kops_client.go @@ -28,6 +28,7 @@ type KopsV1alpha1Interface interface { ClustersGetter FederationsGetter InstanceGroupsGetter + SSHSecretsGetter } // KopsV1alpha1Client is used to interact with features provided by the kops group. @@ -47,6 +48,10 @@ func (c *KopsV1alpha1Client) InstanceGroups(namespace string) InstanceGroupInter return newInstanceGroups(c, namespace) } +func (c *KopsV1alpha1Client) SSHSecrets(namespace string) SSHSecretInterface { + return newSSHSecrets(c, namespace) +} + // NewForConfig creates a new KopsV1alpha1Client for the given config. func NewForConfig(c *rest.Config) (*KopsV1alpha1Client, error) { config := *c diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/sshsecret.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/sshsecret.go new file mode 100644 index 0000000000..58d1ffa725 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/sshsecret.go @@ -0,0 +1,155 @@ +/* +Copyright 2017 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. +*/ + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1" + scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme" +) + +// SSHSecretsGetter has a method to return a SSHSecretInterface. +// A group's client should implement this interface. +type SSHSecretsGetter interface { + SSHSecrets(namespace string) SSHSecretInterface +} + +// SSHSecretInterface has methods to work with SSHSecret resources. +type SSHSecretInterface interface { + Create(*v1alpha1.SSHSecret) (*v1alpha1.SSHSecret, error) + Update(*v1alpha1.SSHSecret) (*v1alpha1.SSHSecret, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.SSHSecret, error) + List(opts v1.ListOptions) (*v1alpha1.SSHSecretList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHSecret, err error) + SSHSecretExpansion +} + +// sSHSecrets implements SSHSecretInterface +type sSHSecrets struct { + client rest.Interface + ns string +} + +// newSSHSecrets returns a SSHSecrets +func newSSHSecrets(c *KopsV1alpha1Client, namespace string) *sSHSecrets { + return &sSHSecrets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a sSHSecret and creates it. Returns the server's representation of the sSHSecret, and an error, if there is any. +func (c *sSHSecrets) Create(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { + result = &v1alpha1.SSHSecret{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sshsecrets"). + Body(sSHSecret). + Do(). + Into(result) + return +} + +// Update takes the representation of a sSHSecret and updates it. Returns the server's representation of the sSHSecret, and an error, if there is any. +func (c *sSHSecrets) Update(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { + result = &v1alpha1.SSHSecret{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(sSHSecret.Name). + Body(sSHSecret). + Do(). + Into(result) + return +} + +// Delete takes name of the sSHSecret and deletes it. Returns an error if one occurs. +func (c *sSHSecrets) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the sSHSecret, and returns the corresponding sSHSecret object, and an error if there is any. +func (c *sSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHSecret, err error) { + result = &v1alpha1.SSHSecret{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SSHSecrets that match those selectors. +func (c *sSHSecrets) List(opts v1.ListOptions) (result *v1alpha1.SSHSecretList, err error) { + result = &v1alpha1.SSHSecretList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sSHSecrets. +func (c *sSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched sSHSecret. +func (c *sSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHSecret, err error) { + result = &v1alpha1.SSHSecret{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sshsecrets"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_kops_client.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_kops_client.go index d1f22a742f..e8f6660e6b 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_kops_client.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_kops_client.go @@ -38,6 +38,10 @@ func (c *FakeKopsV1alpha2) InstanceGroups(namespace string) v1alpha2.InstanceGro return &FakeInstanceGroups{c, namespace} } +func (c *FakeKopsV1alpha2) SSHSecrets(namespace string) v1alpha2.SSHSecretInterface { + return &FakeSSHSecrets{c, namespace} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeKopsV1alpha2) RESTClient() rest.Interface { diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_sshsecret.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_sshsecret.go new file mode 100644 index 0000000000..998ff2ad31 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_sshsecret.go @@ -0,0 +1,120 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2" +) + +// FakeSSHSecrets implements SSHSecretInterface +type FakeSSHSecrets struct { + Fake *FakeKopsV1alpha2 + ns string +} + +var sshsecretsResource = schema.GroupVersionResource{Group: "kops", Version: "v1alpha2", Resource: "sshsecrets"} + +var sshsecretsKind = schema.GroupVersionKind{Group: "kops", Version: "v1alpha2", Kind: "SSHSecret"} + +func (c *FakeSSHSecrets) Create(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha2.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHSecret), err +} + +func (c *FakeSSHSecrets) Update(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha2.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHSecret), err +} + +func (c *FakeSSHSecrets) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(sshsecretsResource, c.ns, name), &v1alpha2.SSHSecret{}) + + return err +} + +func (c *FakeSSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sshsecretsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha2.SSHSecretList{}) + return err +} + +func (c *FakeSSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha2.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sshsecretsResource, c.ns, name), &v1alpha2.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHSecret), err +} + +func (c *FakeSSHSecrets) List(opts v1.ListOptions) (result *v1alpha2.SSHSecretList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sshsecretsResource, sshsecretsKind, c.ns, opts), &v1alpha2.SSHSecretList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha2.SSHSecretList{} + for _, item := range obj.(*v1alpha2.SSHSecretList).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 sSHSecrets. +func (c *FakeSSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sshsecretsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched sSHSecret. +func (c *FakeSSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sshsecretsResource, c.ns, name, data, subresources...), &v1alpha2.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHSecret), err +} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/generated_expansion.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/generated_expansion.go index 80306d321d..dcd702a99b 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/generated_expansion.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/generated_expansion.go @@ -21,3 +21,5 @@ type ClusterExpansion interface{} type FederationExpansion interface{} type InstanceGroupExpansion interface{} + +type SSHSecretExpansion interface{} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/kops_client.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/kops_client.go index 9247671ac3..07a4a1ce16 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/kops_client.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/kops_client.go @@ -28,6 +28,7 @@ type KopsV1alpha2Interface interface { ClustersGetter FederationsGetter InstanceGroupsGetter + SSHSecretsGetter } // KopsV1alpha2Client is used to interact with features provided by the kops group. @@ -47,6 +48,10 @@ func (c *KopsV1alpha2Client) InstanceGroups(namespace string) InstanceGroupInter return newInstanceGroups(c, namespace) } +func (c *KopsV1alpha2Client) SSHSecrets(namespace string) SSHSecretInterface { + return newSSHSecrets(c, namespace) +} + // NewForConfig creates a new KopsV1alpha2Client for the given config. func NewForConfig(c *rest.Config) (*KopsV1alpha2Client, error) { config := *c diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/sshsecret.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/sshsecret.go new file mode 100644 index 0000000000..d10aaa7818 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/sshsecret.go @@ -0,0 +1,155 @@ +/* +Copyright 2017 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. +*/ + +package v1alpha2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2" + scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme" +) + +// SSHSecretsGetter has a method to return a SSHSecretInterface. +// A group's client should implement this interface. +type SSHSecretsGetter interface { + SSHSecrets(namespace string) SSHSecretInterface +} + +// SSHSecretInterface has methods to work with SSHSecret resources. +type SSHSecretInterface interface { + Create(*v1alpha2.SSHSecret) (*v1alpha2.SSHSecret, error) + Update(*v1alpha2.SSHSecret) (*v1alpha2.SSHSecret, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha2.SSHSecret, error) + List(opts v1.ListOptions) (*v1alpha2.SSHSecretList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHSecret, err error) + SSHSecretExpansion +} + +// sSHSecrets implements SSHSecretInterface +type sSHSecrets struct { + client rest.Interface + ns string +} + +// newSSHSecrets returns a SSHSecrets +func newSSHSecrets(c *KopsV1alpha2Client, namespace string) *sSHSecrets { + return &sSHSecrets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a sSHSecret and creates it. Returns the server's representation of the sSHSecret, and an error, if there is any. +func (c *sSHSecrets) Create(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { + result = &v1alpha2.SSHSecret{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sshsecrets"). + Body(sSHSecret). + Do(). + Into(result) + return +} + +// Update takes the representation of a sSHSecret and updates it. Returns the server's representation of the sSHSecret, and an error, if there is any. +func (c *sSHSecrets) Update(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { + result = &v1alpha2.SSHSecret{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(sSHSecret.Name). + Body(sSHSecret). + Do(). + Into(result) + return +} + +// Delete takes name of the sSHSecret and deletes it. Returns an error if one occurs. +func (c *sSHSecrets) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the sSHSecret, and returns the corresponding sSHSecret object, and an error if there is any. +func (c *sSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha2.SSHSecret, err error) { + result = &v1alpha2.SSHSecret{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SSHSecrets that match those selectors. +func (c *sSHSecrets) List(opts v1.ListOptions) (result *v1alpha2.SSHSecretList, err error) { + result = &v1alpha2.SSHSecretList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sSHSecrets. +func (c *sSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched sSHSecret. +func (c *sSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHSecret, err error) { + result = &v1alpha2.SSHSecret{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sshsecrets"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_kops_client.go b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_kops_client.go index ae7c091585..d7cde6f8e3 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_kops_client.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_kops_client.go @@ -38,6 +38,10 @@ func (c *FakeKops) InstanceGroups(namespace string) internalversion.InstanceGrou return &FakeInstanceGroups{c, namespace} } +func (c *FakeKops) SSHSecrets(namespace string) internalversion.SSHSecretInterface { + return &FakeSSHSecrets{c, namespace} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeKops) RESTClient() rest.Interface { diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_sshsecret.go b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_sshsecret.go new file mode 100644 index 0000000000..ecd577c9f5 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_sshsecret.go @@ -0,0 +1,120 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + kops "k8s.io/kops/pkg/apis/kops" +) + +// FakeSSHSecrets implements SSHSecretInterface +type FakeSSHSecrets struct { + Fake *FakeKops + ns string +} + +var sshsecretsResource = schema.GroupVersionResource{Group: "kops", Version: "", Resource: "sshsecrets"} + +var sshsecretsKind = schema.GroupVersionKind{Group: "kops", Version: "", Kind: "SSHSecret"} + +func (c *FakeSSHSecrets) Create(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sshsecretsResource, c.ns, sSHSecret), &kops.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHSecret), err +} + +func (c *FakeSSHSecrets) Update(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sshsecretsResource, c.ns, sSHSecret), &kops.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHSecret), err +} + +func (c *FakeSSHSecrets) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(sshsecretsResource, c.ns, name), &kops.SSHSecret{}) + + return err +} + +func (c *FakeSSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sshsecretsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &kops.SSHSecretList{}) + return err +} + +func (c *FakeSSHSecrets) Get(name string, options v1.GetOptions) (result *kops.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sshsecretsResource, c.ns, name), &kops.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHSecret), err +} + +func (c *FakeSSHSecrets) List(opts v1.ListOptions) (result *kops.SSHSecretList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sshsecretsResource, sshsecretsKind, c.ns, opts), &kops.SSHSecretList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kops.SSHSecretList{} + for _, item := range obj.(*kops.SSHSecretList).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 sSHSecrets. +func (c *FakeSSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sshsecretsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched sSHSecret. +func (c *FakeSSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sshsecretsResource, c.ns, name, data, subresources...), &kops.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHSecret), err +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/generated_expansion.go b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/generated_expansion.go index 68f36300eb..8885bd5db7 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/generated_expansion.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/generated_expansion.go @@ -21,3 +21,5 @@ type ClusterExpansion interface{} type FederationExpansion interface{} type InstanceGroupExpansion interface{} + +type SSHSecretExpansion interface{} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/kops_client.go b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/kops_client.go index 3a3015447d..fcd0607dda 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/kops_client.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/kops_client.go @@ -26,6 +26,7 @@ type KopsInterface interface { ClustersGetter FederationsGetter InstanceGroupsGetter + SSHSecretsGetter } // KopsClient is used to interact with features provided by the kops group. @@ -45,6 +46,10 @@ func (c *KopsClient) InstanceGroups(namespace string) InstanceGroupInterface { return newInstanceGroups(c, namespace) } +func (c *KopsClient) SSHSecrets(namespace string) SSHSecretInterface { + return newSSHSecrets(c, namespace) +} + // NewForConfig creates a new KopsClient for the given config. func NewForConfig(c *rest.Config) (*KopsClient, error) { config := *c diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/sshsecret.go b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/sshsecret.go new file mode 100644 index 0000000000..90c9e0565b --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/sshsecret.go @@ -0,0 +1,155 @@ +/* +Copyright 2017 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. +*/ + +package internalversion + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + kops "k8s.io/kops/pkg/apis/kops" + scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme" +) + +// SSHSecretsGetter has a method to return a SSHSecretInterface. +// A group's client should implement this interface. +type SSHSecretsGetter interface { + SSHSecrets(namespace string) SSHSecretInterface +} + +// SSHSecretInterface has methods to work with SSHSecret resources. +type SSHSecretInterface interface { + Create(*kops.SSHSecret) (*kops.SSHSecret, error) + Update(*kops.SSHSecret) (*kops.SSHSecret, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*kops.SSHSecret, error) + List(opts v1.ListOptions) (*kops.SSHSecretList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHSecret, err error) + SSHSecretExpansion +} + +// sSHSecrets implements SSHSecretInterface +type sSHSecrets struct { + client rest.Interface + ns string +} + +// newSSHSecrets returns a SSHSecrets +func newSSHSecrets(c *KopsClient, namespace string) *sSHSecrets { + return &sSHSecrets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a sSHSecret and creates it. Returns the server's representation of the sSHSecret, and an error, if there is any. +func (c *sSHSecrets) Create(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { + result = &kops.SSHSecret{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sshsecrets"). + Body(sSHSecret). + Do(). + Into(result) + return +} + +// Update takes the representation of a sSHSecret and updates it. Returns the server's representation of the sSHSecret, and an error, if there is any. +func (c *sSHSecrets) Update(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { + result = &kops.SSHSecret{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(sSHSecret.Name). + Body(sSHSecret). + Do(). + Into(result) + return +} + +// Delete takes name of the sSHSecret and deletes it. Returns an error if one occurs. +func (c *sSHSecrets) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the sSHSecret, and returns the corresponding sSHSecret object, and an error if there is any. +func (c *sSHSecrets) Get(name string, options v1.GetOptions) (result *kops.SSHSecret, err error) { + result = &kops.SSHSecret{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SSHSecrets that match those selectors. +func (c *sSHSecrets) List(opts v1.ListOptions) (result *kops.SSHSecretList, err error) { + result = &kops.SSHSecretList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sSHSecrets. +func (c *sSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched sSHSecret. +func (c *sSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHSecret, err error) { + result = &kops.SSHSecret{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sshsecrets"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_kops_client.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_kops_client.go index 7d6f95e651..c14f7422f9 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_kops_client.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_kops_client.go @@ -38,6 +38,10 @@ func (c *FakeKopsV1alpha1) InstanceGroups(namespace string) v1alpha1.InstanceGro return &FakeInstanceGroups{c, namespace} } +func (c *FakeKopsV1alpha1) SSHSecrets(namespace string) v1alpha1.SSHSecretInterface { + return &FakeSSHSecrets{c, namespace} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeKopsV1alpha1) RESTClient() rest.Interface { diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_sshsecret.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_sshsecret.go new file mode 100644 index 0000000000..4e42ea4768 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_sshsecret.go @@ -0,0 +1,120 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1" +) + +// FakeSSHSecrets implements SSHSecretInterface +type FakeSSHSecrets struct { + Fake *FakeKopsV1alpha1 + ns string +} + +var sshsecretsResource = schema.GroupVersionResource{Group: "kops", Version: "v1alpha1", Resource: "sshsecrets"} + +var sshsecretsKind = schema.GroupVersionKind{Group: "kops", Version: "v1alpha1", Kind: "SSHSecret"} + +func (c *FakeSSHSecrets) Create(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha1.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHSecret), err +} + +func (c *FakeSSHSecrets) Update(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha1.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHSecret), err +} + +func (c *FakeSSHSecrets) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(sshsecretsResource, c.ns, name), &v1alpha1.SSHSecret{}) + + return err +} + +func (c *FakeSSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sshsecretsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.SSHSecretList{}) + return err +} + +func (c *FakeSSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sshsecretsResource, c.ns, name), &v1alpha1.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHSecret), err +} + +func (c *FakeSSHSecrets) List(opts v1.ListOptions) (result *v1alpha1.SSHSecretList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sshsecretsResource, sshsecretsKind, c.ns, opts), &v1alpha1.SSHSecretList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.SSHSecretList{} + for _, item := range obj.(*v1alpha1.SSHSecretList).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 sSHSecrets. +func (c *FakeSSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sshsecretsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched sSHSecret. +func (c *FakeSSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sshsecretsResource, c.ns, name, data, subresources...), &v1alpha1.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHSecret), err +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/generated_expansion.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/generated_expansion.go index 0b0957675c..b9ab3b64c3 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/generated_expansion.go @@ -21,3 +21,5 @@ type ClusterExpansion interface{} type FederationExpansion interface{} type InstanceGroupExpansion interface{} + +type SSHSecretExpansion interface{} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/kops_client.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/kops_client.go index 35dfeb36e4..663c47aea8 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/kops_client.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/kops_client.go @@ -28,6 +28,7 @@ type KopsV1alpha1Interface interface { ClustersGetter FederationsGetter InstanceGroupsGetter + SSHSecretsGetter } // KopsV1alpha1Client is used to interact with features provided by the kops group. @@ -47,6 +48,10 @@ func (c *KopsV1alpha1Client) InstanceGroups(namespace string) InstanceGroupInter return newInstanceGroups(c, namespace) } +func (c *KopsV1alpha1Client) SSHSecrets(namespace string) SSHSecretInterface { + return newSSHSecrets(c, namespace) +} + // NewForConfig creates a new KopsV1alpha1Client for the given config. func NewForConfig(c *rest.Config) (*KopsV1alpha1Client, error) { config := *c diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/sshsecret.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/sshsecret.go new file mode 100644 index 0000000000..a39991e398 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/sshsecret.go @@ -0,0 +1,155 @@ +/* +Copyright 2017 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. +*/ + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1" + scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme" +) + +// SSHSecretsGetter has a method to return a SSHSecretInterface. +// A group's client should implement this interface. +type SSHSecretsGetter interface { + SSHSecrets(namespace string) SSHSecretInterface +} + +// SSHSecretInterface has methods to work with SSHSecret resources. +type SSHSecretInterface interface { + Create(*v1alpha1.SSHSecret) (*v1alpha1.SSHSecret, error) + Update(*v1alpha1.SSHSecret) (*v1alpha1.SSHSecret, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.SSHSecret, error) + List(opts v1.ListOptions) (*v1alpha1.SSHSecretList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHSecret, err error) + SSHSecretExpansion +} + +// sSHSecrets implements SSHSecretInterface +type sSHSecrets struct { + client rest.Interface + ns string +} + +// newSSHSecrets returns a SSHSecrets +func newSSHSecrets(c *KopsV1alpha1Client, namespace string) *sSHSecrets { + return &sSHSecrets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a sSHSecret and creates it. Returns the server's representation of the sSHSecret, and an error, if there is any. +func (c *sSHSecrets) Create(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { + result = &v1alpha1.SSHSecret{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sshsecrets"). + Body(sSHSecret). + Do(). + Into(result) + return +} + +// Update takes the representation of a sSHSecret and updates it. Returns the server's representation of the sSHSecret, and an error, if there is any. +func (c *sSHSecrets) Update(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { + result = &v1alpha1.SSHSecret{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(sSHSecret.Name). + Body(sSHSecret). + Do(). + Into(result) + return +} + +// Delete takes name of the sSHSecret and deletes it. Returns an error if one occurs. +func (c *sSHSecrets) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the sSHSecret, and returns the corresponding sSHSecret object, and an error if there is any. +func (c *sSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHSecret, err error) { + result = &v1alpha1.SSHSecret{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SSHSecrets that match those selectors. +func (c *sSHSecrets) List(opts v1.ListOptions) (result *v1alpha1.SSHSecretList, err error) { + result = &v1alpha1.SSHSecretList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sSHSecrets. +func (c *sSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched sSHSecret. +func (c *sSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHSecret, err error) { + result = &v1alpha1.SSHSecret{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sshsecrets"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_kops_client.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_kops_client.go index 11403dc601..7b468b4b07 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_kops_client.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_kops_client.go @@ -38,6 +38,10 @@ func (c *FakeKopsV1alpha2) InstanceGroups(namespace string) v1alpha2.InstanceGro return &FakeInstanceGroups{c, namespace} } +func (c *FakeKopsV1alpha2) SSHSecrets(namespace string) v1alpha2.SSHSecretInterface { + return &FakeSSHSecrets{c, namespace} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeKopsV1alpha2) RESTClient() rest.Interface { diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_sshsecret.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_sshsecret.go new file mode 100644 index 0000000000..998ff2ad31 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_sshsecret.go @@ -0,0 +1,120 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2" +) + +// FakeSSHSecrets implements SSHSecretInterface +type FakeSSHSecrets struct { + Fake *FakeKopsV1alpha2 + ns string +} + +var sshsecretsResource = schema.GroupVersionResource{Group: "kops", Version: "v1alpha2", Resource: "sshsecrets"} + +var sshsecretsKind = schema.GroupVersionKind{Group: "kops", Version: "v1alpha2", Kind: "SSHSecret"} + +func (c *FakeSSHSecrets) Create(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha2.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHSecret), err +} + +func (c *FakeSSHSecrets) Update(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha2.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHSecret), err +} + +func (c *FakeSSHSecrets) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(sshsecretsResource, c.ns, name), &v1alpha2.SSHSecret{}) + + return err +} + +func (c *FakeSSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sshsecretsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha2.SSHSecretList{}) + return err +} + +func (c *FakeSSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha2.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sshsecretsResource, c.ns, name), &v1alpha2.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHSecret), err +} + +func (c *FakeSSHSecrets) List(opts v1.ListOptions) (result *v1alpha2.SSHSecretList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sshsecretsResource, sshsecretsKind, c.ns, opts), &v1alpha2.SSHSecretList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha2.SSHSecretList{} + for _, item := range obj.(*v1alpha2.SSHSecretList).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 sSHSecrets. +func (c *FakeSSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sshsecretsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched sSHSecret. +func (c *FakeSSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHSecret, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sshsecretsResource, c.ns, name, data, subresources...), &v1alpha2.SSHSecret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHSecret), err +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/generated_expansion.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/generated_expansion.go index 80306d321d..dcd702a99b 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/generated_expansion.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/generated_expansion.go @@ -21,3 +21,5 @@ type ClusterExpansion interface{} type FederationExpansion interface{} type InstanceGroupExpansion interface{} + +type SSHSecretExpansion interface{} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/kops_client.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/kops_client.go index fcc8a37f41..87d2670ca2 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/kops_client.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/kops_client.go @@ -28,6 +28,7 @@ type KopsV1alpha2Interface interface { ClustersGetter FederationsGetter InstanceGroupsGetter + SSHSecretsGetter } // KopsV1alpha2Client is used to interact with features provided by the kops group. @@ -47,6 +48,10 @@ func (c *KopsV1alpha2Client) InstanceGroups(namespace string) InstanceGroupInter return newInstanceGroups(c, namespace) } +func (c *KopsV1alpha2Client) SSHSecrets(namespace string) SSHSecretInterface { + return newSSHSecrets(c, namespace) +} + // NewForConfig creates a new KopsV1alpha2Client for the given config. func NewForConfig(c *rest.Config) (*KopsV1alpha2Client, error) { config := *c diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/sshsecret.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/sshsecret.go new file mode 100644 index 0000000000..caee5796a0 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/sshsecret.go @@ -0,0 +1,155 @@ +/* +Copyright 2017 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. +*/ + +package v1alpha2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2" + scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme" +) + +// SSHSecretsGetter has a method to return a SSHSecretInterface. +// A group's client should implement this interface. +type SSHSecretsGetter interface { + SSHSecrets(namespace string) SSHSecretInterface +} + +// SSHSecretInterface has methods to work with SSHSecret resources. +type SSHSecretInterface interface { + Create(*v1alpha2.SSHSecret) (*v1alpha2.SSHSecret, error) + Update(*v1alpha2.SSHSecret) (*v1alpha2.SSHSecret, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha2.SSHSecret, error) + List(opts v1.ListOptions) (*v1alpha2.SSHSecretList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHSecret, err error) + SSHSecretExpansion +} + +// sSHSecrets implements SSHSecretInterface +type sSHSecrets struct { + client rest.Interface + ns string +} + +// newSSHSecrets returns a SSHSecrets +func newSSHSecrets(c *KopsV1alpha2Client, namespace string) *sSHSecrets { + return &sSHSecrets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a sSHSecret and creates it. Returns the server's representation of the sSHSecret, and an error, if there is any. +func (c *sSHSecrets) Create(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { + result = &v1alpha2.SSHSecret{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sshsecrets"). + Body(sSHSecret). + Do(). + Into(result) + return +} + +// Update takes the representation of a sSHSecret and updates it. Returns the server's representation of the sSHSecret, and an error, if there is any. +func (c *sSHSecrets) Update(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { + result = &v1alpha2.SSHSecret{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(sSHSecret.Name). + Body(sSHSecret). + Do(). + Into(result) + return +} + +// Delete takes name of the sSHSecret and deletes it. Returns an error if one occurs. +func (c *sSHSecrets) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the sSHSecret, and returns the corresponding sSHSecret object, and an error if there is any. +func (c *sSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha2.SSHSecret, err error) { + result = &v1alpha2.SSHSecret{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SSHSecrets that match those selectors. +func (c *sSHSecrets) List(opts v1.ListOptions) (result *v1alpha2.SSHSecretList, err error) { + result = &v1alpha2.SSHSecretList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sSHSecrets. +func (c *sSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sshsecrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched sSHSecret. +func (c *sSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHSecret, err error) { + result = &v1alpha2.SSHSecret{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sshsecrets"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} From 5705885d026673c23335904f4052a5e5250bf271 Mon Sep 17 00:00:00 2001 From: Alexander Brandstedt Date: Wed, 23 Aug 2017 12:18:10 +0200 Subject: [PATCH 3/5] rename sshsecret to sshcredential and update files to reflect change. --- cmd/kops/create.go | 15 ++++++--------- docs/secrets.md | 7 +++---- pkg/apis/kops/register.go | 9 +++++---- pkg/apis/kops/{sshsecret.go => sshcredential.go} | 15 +++++++-------- pkg/apis/kops/v1alpha1/register.go | 6 +++--- .../v1alpha1/{sshsecret.go => sshcredential.go} | 15 +++++++-------- pkg/apis/kops/v1alpha2/register.go | 6 +++--- .../v1alpha2/{sshsecret.go => sshcredential.go} | 15 +++++++-------- 8 files changed, 41 insertions(+), 47 deletions(-) rename pkg/apis/kops/{sshsecret.go => sshcredential.go} (73%) rename pkg/apis/kops/v1alpha1/{sshsecret.go => sshcredential.go} (73%) rename pkg/apis/kops/v1alpha2/{sshsecret.go => sshcredential.go} (73%) diff --git a/cmd/kops/create.go b/cmd/kops/create.go index 85d025ffd1..fcf110bfa9 100644 --- a/cmd/kops/create.go +++ b/cmd/kops/create.go @@ -194,16 +194,13 @@ func RunCreate(f *util.Factory, out io.Writer, c *CreateOptions) error { fmt.Fprintf(&sb, "Created instancegroup/%s\n", v.ObjectMeta.Name) } - case *kopsapi.SSHSecret: + case *kopsapi.SSHCredential: clusterName = v.ObjectMeta.Labels[kopsapi.LabelClusterName] if clusterName == "" { return fmt.Errorf("must specify %q label with cluster name to create instanceGroup", kopsapi.LabelClusterName) } - if v.Spec.Username == "" { - return fmt.Errorf("spec.username is required") - } - if v.Spec.SshPublicKey == "" { - return fmt.Errorf("spec.sshPublicKey is required") + if v.Spec.PublicKey == "" { + return fmt.Errorf("spec.PublicKey is required") } cluster, err := clientset.GetCluster(clusterName) @@ -216,12 +213,12 @@ func RunCreate(f *util.Factory, out io.Writer, c *CreateOptions) error { return err } - sshKeyArr := []byte(v.Spec.SshPublicKey) - err = keyStore.AddSSHPublicKey(v.Spec.Username, sshKeyArr) + sshKeyArr := []byte(v.Spec.PublicKey) + err = keyStore.AddSSHPublicKey("admin", sshKeyArr) if err != nil { return err } else { - fmt.Fprintf(&sb, "Added SSHSecret ssh key\n") + fmt.Fprintf(&sb, "Added ssh creadential\n") } default: diff --git a/docs/secrets.md b/docs/secrets.md index df58bf69d4..2c5140611c 100644 --- a/docs/secrets.md +++ b/docs/secrets.md @@ -25,14 +25,13 @@ example: `kops delete secret sshpublickey admin` -### adding secret from spec file +### adding ssh credential from spec file ```bash apiVersion: kops/v1alpha2 -kind: SSHSecret +kind: SSHCredential metadata: labels: kops.k8s.io/cluster: dev.k8s.example.com spec: - username: "admin" - sshPublicKey: "ssh-rsa AAAAB3NzaC1 dev@devbox" + PublicKey: "ssh-rsa AAAAB3NzaC1 dev@devbox" ``` diff --git a/pkg/apis/kops/register.go b/pkg/apis/kops/register.go index 58b81f1eec..67eb2d361b 100644 --- a/pkg/apis/kops/register.go +++ b/pkg/apis/kops/register.go @@ -17,12 +17,13 @@ limitations under the License. package kops import ( + "os" + "k8s.io/apimachinery/pkg/apimachinery/announced" "k8s.io/apimachinery/pkg/apimachinery/registered" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" - "os" ) var ( @@ -65,8 +66,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &InstanceGroupList{}, &Federation{}, &FederationList{}, - &SSHSecret{}, - &SSHSecretList{}, + &SSHCredential{}, + &SSHCredentialList{}, ) //metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil @@ -81,6 +82,6 @@ func (obj *InstanceGroup) GetObjectKind() schema.ObjectKind { func (obj *Federation) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } -func (obj *SSHSecret) GetObjectKind() schema.ObjectKind { +func (obj *SSHCredential) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } diff --git a/pkg/apis/kops/sshsecret.go b/pkg/apis/kops/sshcredential.go similarity index 73% rename from pkg/apis/kops/sshsecret.go rename to pkg/apis/kops/sshcredential.go index 44fa9ea03c..f397a5e447 100644 --- a/pkg/apis/kops/sshsecret.go +++ b/pkg/apis/kops/sshcredential.go @@ -22,22 +22,21 @@ import ( // +genclient=true -// SSHSecret represent a set of kops secrets -type SSHSecret struct { +// SSHCredential represent a set of kops secrets +type SSHCredential struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec SSHSecretSpec `json:"spec,omitempty"` + Spec SSHCredentialSpec `json:"spec,omitempty"` } -type SSHSecretSpec struct { - SshPublicKey string `json:"sshPublicKey,omitempty"` - Username string `json:"username,omitempty"` +type SSHCredentialSpec struct { + PublicKey string `json:"PublicKey,omitempty"` } -type SSHSecretList struct { +type SSHCredentialList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []SSHSecret `json:"items"` + Items []SSHCredential `json:"items"` } diff --git a/pkg/apis/kops/v1alpha1/register.go b/pkg/apis/kops/v1alpha1/register.go index 8454e7449e..bd14d4d569 100644 --- a/pkg/apis/kops/v1alpha1/register.go +++ b/pkg/apis/kops/v1alpha1/register.go @@ -52,8 +52,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &InstanceGroupList{}, &Federation{}, &FederationList{}, - &SSHSecret{}, - &SSHSecretList{}, + &SSHCredential{}, + &SSHCredentialList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) @@ -70,7 +70,7 @@ func (obj *InstanceGroup) GetObjectKind() schema.ObjectKind { func (obj *Federation) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } -func (obj *SSHSecret) GetObjectKind() schema.ObjectKind { +func (obj *SSHCredential) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } diff --git a/pkg/apis/kops/v1alpha1/sshsecret.go b/pkg/apis/kops/v1alpha1/sshcredential.go similarity index 73% rename from pkg/apis/kops/v1alpha1/sshsecret.go rename to pkg/apis/kops/v1alpha1/sshcredential.go index 22266196f4..2d02486883 100644 --- a/pkg/apis/kops/v1alpha1/sshsecret.go +++ b/pkg/apis/kops/v1alpha1/sshcredential.go @@ -22,22 +22,21 @@ import ( // +genclient=true -// SSHSecret represent a set of kops secrets -type SSHSecret struct { +// SSHCredential represent a set of kops secrets +type SSHCredential struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec SSHSecretSpec `json:"spec,omitempty"` + Spec SSHCredentialSpec `json:"spec,omitempty"` } -type SSHSecretSpec struct { - SshPublicKey string `json:"sshPublicKey,omitempty"` - Username string `json:"username,omitempty"` +type SSHCredentialSpec struct { + PublicKey string `json:"PublicKey,omitempty"` } -type SSHSecretList struct { +type SSHCredentialList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []SSHSecret `json:"items"` + Items []SSHCredential `json:"items"` } diff --git a/pkg/apis/kops/v1alpha2/register.go b/pkg/apis/kops/v1alpha2/register.go index b86adbbb55..7dcd65c003 100644 --- a/pkg/apis/kops/v1alpha2/register.go +++ b/pkg/apis/kops/v1alpha2/register.go @@ -53,8 +53,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &InstanceGroupList{}, &Federation{}, &FederationList{}, - &SSHSecret{}, - &SSHSecretList{}, + &SSHCredential{}, + &SSHCredentialList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) @@ -71,7 +71,7 @@ func (obj *InstanceGroup) GetObjectKind() schema.ObjectKind { func (obj *Federation) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } -func (obj *SSHSecret) GetObjectKind() schema.ObjectKind { +func (obj *SSHCredential) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } diff --git a/pkg/apis/kops/v1alpha2/sshsecret.go b/pkg/apis/kops/v1alpha2/sshcredential.go similarity index 73% rename from pkg/apis/kops/v1alpha2/sshsecret.go rename to pkg/apis/kops/v1alpha2/sshcredential.go index 5653716afe..61e7b22198 100644 --- a/pkg/apis/kops/v1alpha2/sshsecret.go +++ b/pkg/apis/kops/v1alpha2/sshcredential.go @@ -22,22 +22,21 @@ import ( // +genclient=true -// SSHSecret represent a set of kops secrets -type SSHSecret struct { +// SSHCredential represent a set of kops secrets +type SSHCredential struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec SSHSecretSpec `json:"spec,omitempty"` + Spec SSHCredentialSpec `json:"spec,omitempty"` } -type SSHSecretSpec struct { - SshPublicKey string `json:"sshPublicKey,omitempty"` - Username string `json:"username,omitempty"` +type SSHCredentialSpec struct { + PublicKey string `json:"PublicKey,omitempty"` } -type SSHSecretList struct { +type SSHCredentialList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []SSHSecret `json:"items"` + Items []SSHCredential `json:"items"` } From f9867302b023eeec330bfbfceca0ce1c2530542b Mon Sep 17 00:00:00 2001 From: Alexander Brandstedt Date: Wed, 23 Aug 2017 12:22:55 +0200 Subject: [PATCH 4/5] update api machinery --- .../kops/v1alpha1/zz_generated.conversion.go | 82 +++++---- .../kops/v1alpha2/zz_generated.conversion.go | 82 +++++---- .../internalversion/fake/fake_kops_client.go | 4 +- .../fake/fake_sshcredential.go | 120 ++++++++++++++ .../internalversion/fake/fake_sshsecret.go | 120 -------------- .../internalversion/generated_expansion.go | 2 +- .../typed/kops/internalversion/kops_client.go | 6 +- .../kops/internalversion/sshcredential.go | 155 ++++++++++++++++++ .../typed/kops/internalversion/sshsecret.go | 155 ------------------ .../kops/v1alpha1/fake/fake_kops_client.go | 4 +- .../kops/v1alpha1/fake/fake_sshcredential.go | 120 ++++++++++++++ .../kops/v1alpha1/fake/fake_sshsecret.go | 120 -------------- .../kops/v1alpha1/generated_expansion.go | 2 +- .../typed/kops/v1alpha1/kops_client.go | 6 +- .../typed/kops/v1alpha1/sshcredential.go | 155 ++++++++++++++++++ .../typed/kops/v1alpha1/sshsecret.go | 155 ------------------ .../kops/v1alpha2/fake/fake_kops_client.go | 4 +- .../kops/v1alpha2/fake/fake_sshcredential.go | 120 ++++++++++++++ .../kops/v1alpha2/fake/fake_sshsecret.go | 120 -------------- .../kops/v1alpha2/generated_expansion.go | 2 +- .../typed/kops/v1alpha2/kops_client.go | 6 +- .../typed/kops/v1alpha2/sshcredential.go | 155 ++++++++++++++++++ .../typed/kops/v1alpha2/sshsecret.go | 155 ------------------ .../internalversion/fake/fake_kops_client.go | 4 +- .../fake/fake_sshcredential.go | 120 ++++++++++++++ .../internalversion/fake/fake_sshsecret.go | 120 -------------- .../internalversion/generated_expansion.go | 2 +- .../typed/kops/internalversion/kops_client.go | 6 +- .../kops/internalversion/sshcredential.go | 155 ++++++++++++++++++ .../typed/kops/internalversion/sshsecret.go | 155 ------------------ .../kops/v1alpha1/fake/fake_kops_client.go | 4 +- .../kops/v1alpha1/fake/fake_sshcredential.go | 120 ++++++++++++++ .../kops/v1alpha1/fake/fake_sshsecret.go | 120 -------------- .../kops/v1alpha1/generated_expansion.go | 2 +- .../typed/kops/v1alpha1/kops_client.go | 6 +- .../typed/kops/v1alpha1/sshcredential.go | 155 ++++++++++++++++++ .../typed/kops/v1alpha1/sshsecret.go | 155 ------------------ .../kops/v1alpha2/fake/fake_kops_client.go | 4 +- .../kops/v1alpha2/fake/fake_sshcredential.go | 120 ++++++++++++++ .../kops/v1alpha2/fake/fake_sshsecret.go | 120 -------------- .../kops/v1alpha2/generated_expansion.go | 2 +- .../typed/kops/v1alpha2/kops_client.go | 6 +- .../typed/kops/v1alpha2/sshcredential.go | 155 ++++++++++++++++++ .../typed/kops/v1alpha2/sshsecret.go | 155 ------------------ 44 files changed, 1766 insertions(+), 1770 deletions(-) create mode 100644 pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_sshcredential.go delete mode 100644 pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_sshsecret.go create mode 100644 pkg/client/clientset_generated/clientset/typed/kops/internalversion/sshcredential.go delete mode 100644 pkg/client/clientset_generated/clientset/typed/kops/internalversion/sshsecret.go create mode 100644 pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_sshcredential.go delete mode 100644 pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_sshsecret.go create mode 100644 pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/sshcredential.go delete mode 100644 pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/sshsecret.go create mode 100644 pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_sshcredential.go delete mode 100644 pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_sshsecret.go create mode 100644 pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/sshcredential.go delete mode 100644 pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/sshsecret.go create mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_sshcredential.go delete mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_sshsecret.go create mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/sshcredential.go delete mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/sshsecret.go create mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_sshcredential.go delete mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_sshsecret.go create mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/sshcredential.go delete mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/sshsecret.go create mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_sshcredential.go delete mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_sshsecret.go create mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/sshcredential.go delete mode 100644 pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/sshsecret.go diff --git a/pkg/apis/kops/v1alpha1/zz_generated.conversion.go b/pkg/apis/kops/v1alpha1/zz_generated.conversion.go index d942666bb6..37cf87bc40 100644 --- a/pkg/apis/kops/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha1/zz_generated.conversion.go @@ -123,12 +123,12 @@ func RegisterConversions(scheme *runtime.Scheme) error { Convert_kops_NetworkingSpec_To_v1alpha1_NetworkingSpec, Convert_v1alpha1_RBACAuthorizationSpec_To_kops_RBACAuthorizationSpec, Convert_kops_RBACAuthorizationSpec_To_v1alpha1_RBACAuthorizationSpec, - Convert_v1alpha1_SSHSecret_To_kops_SSHSecret, - Convert_kops_SSHSecret_To_v1alpha1_SSHSecret, - Convert_v1alpha1_SSHSecretList_To_kops_SSHSecretList, - Convert_kops_SSHSecretList_To_v1alpha1_SSHSecretList, - Convert_v1alpha1_SSHSecretSpec_To_kops_SSHSecretSpec, - Convert_kops_SSHSecretSpec_To_v1alpha1_SSHSecretSpec, + Convert_v1alpha1_SSHCredential_To_kops_SSHCredential, + Convert_kops_SSHCredential_To_v1alpha1_SSHCredential, + Convert_v1alpha1_SSHCredentialList_To_kops_SSHCredentialList, + Convert_kops_SSHCredentialList_To_v1alpha1_SSHCredentialList, + Convert_v1alpha1_SSHCredentialSpec_To_kops_SSHCredentialSpec, + Convert_kops_SSHCredentialSpec_To_v1alpha1_SSHCredentialSpec, Convert_v1alpha1_WeaveNetworkingSpec_To_kops_WeaveNetworkingSpec, Convert_kops_WeaveNetworkingSpec_To_v1alpha1_WeaveNetworkingSpec, ) @@ -2164,94 +2164,92 @@ func Convert_kops_RBACAuthorizationSpec_To_v1alpha1_RBACAuthorizationSpec(in *ko return autoConvert_kops_RBACAuthorizationSpec_To_v1alpha1_RBACAuthorizationSpec(in, out, s) } -func autoConvert_v1alpha1_SSHSecret_To_kops_SSHSecret(in *SSHSecret, out *kops.SSHSecret, s conversion.Scope) error { +func autoConvert_v1alpha1_SSHCredential_To_kops_SSHCredential(in *SSHCredential, out *kops.SSHCredential, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_SSHSecretSpec_To_kops_SSHSecretSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha1_SSHCredentialSpec_To_kops_SSHCredentialSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha1_SSHSecret_To_kops_SSHSecret is an autogenerated conversion function. -func Convert_v1alpha1_SSHSecret_To_kops_SSHSecret(in *SSHSecret, out *kops.SSHSecret, s conversion.Scope) error { - return autoConvert_v1alpha1_SSHSecret_To_kops_SSHSecret(in, out, s) +// Convert_v1alpha1_SSHCredential_To_kops_SSHCredential is an autogenerated conversion function. +func Convert_v1alpha1_SSHCredential_To_kops_SSHCredential(in *SSHCredential, out *kops.SSHCredential, s conversion.Scope) error { + return autoConvert_v1alpha1_SSHCredential_To_kops_SSHCredential(in, out, s) } -func autoConvert_kops_SSHSecret_To_v1alpha1_SSHSecret(in *kops.SSHSecret, out *SSHSecret, s conversion.Scope) error { +func autoConvert_kops_SSHCredential_To_v1alpha1_SSHCredential(in *kops.SSHCredential, out *SSHCredential, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_kops_SSHSecretSpec_To_v1alpha1_SSHSecretSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_kops_SSHCredentialSpec_To_v1alpha1_SSHCredentialSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_kops_SSHSecret_To_v1alpha1_SSHSecret is an autogenerated conversion function. -func Convert_kops_SSHSecret_To_v1alpha1_SSHSecret(in *kops.SSHSecret, out *SSHSecret, s conversion.Scope) error { - return autoConvert_kops_SSHSecret_To_v1alpha1_SSHSecret(in, out, s) +// Convert_kops_SSHCredential_To_v1alpha1_SSHCredential is an autogenerated conversion function. +func Convert_kops_SSHCredential_To_v1alpha1_SSHCredential(in *kops.SSHCredential, out *SSHCredential, s conversion.Scope) error { + return autoConvert_kops_SSHCredential_To_v1alpha1_SSHCredential(in, out, s) } -func autoConvert_v1alpha1_SSHSecretList_To_kops_SSHSecretList(in *SSHSecretList, out *kops.SSHSecretList, s conversion.Scope) error { +func autoConvert_v1alpha1_SSHCredentialList_To_kops_SSHCredentialList(in *SSHCredentialList, out *kops.SSHCredentialList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]kops.SSHSecret, len(*in)) + *out = make([]kops.SSHCredential, len(*in)) for i := range *in { - if err := Convert_v1alpha1_SSHSecret_To_kops_SSHSecret(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha1_SSHCredential_To_kops_SSHCredential(&(*in)[i], &(*out)[i], s); err != nil { return err } } } else { - out.Items = make([]kops.SSHSecret, 0) + out.Items = make([]kops.SSHCredential, 0) } return nil } -// Convert_v1alpha1_SSHSecretList_To_kops_SSHSecretList is an autogenerated conversion function. -func Convert_v1alpha1_SSHSecretList_To_kops_SSHSecretList(in *SSHSecretList, out *kops.SSHSecretList, s conversion.Scope) error { - return autoConvert_v1alpha1_SSHSecretList_To_kops_SSHSecretList(in, out, s) +// Convert_v1alpha1_SSHCredentialList_To_kops_SSHCredentialList is an autogenerated conversion function. +func Convert_v1alpha1_SSHCredentialList_To_kops_SSHCredentialList(in *SSHCredentialList, out *kops.SSHCredentialList, s conversion.Scope) error { + return autoConvert_v1alpha1_SSHCredentialList_To_kops_SSHCredentialList(in, out, s) } -func autoConvert_kops_SSHSecretList_To_v1alpha1_SSHSecretList(in *kops.SSHSecretList, out *SSHSecretList, s conversion.Scope) error { +func autoConvert_kops_SSHCredentialList_To_v1alpha1_SSHCredentialList(in *kops.SSHCredentialList, out *SSHCredentialList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]SSHSecret, len(*in)) + *out = make([]SSHCredential, len(*in)) for i := range *in { - if err := Convert_kops_SSHSecret_To_v1alpha1_SSHSecret(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_kops_SSHCredential_To_v1alpha1_SSHCredential(&(*in)[i], &(*out)[i], s); err != nil { return err } } } else { - out.Items = make([]SSHSecret, 0) + out.Items = make([]SSHCredential, 0) } return nil } -// Convert_kops_SSHSecretList_To_v1alpha1_SSHSecretList is an autogenerated conversion function. -func Convert_kops_SSHSecretList_To_v1alpha1_SSHSecretList(in *kops.SSHSecretList, out *SSHSecretList, s conversion.Scope) error { - return autoConvert_kops_SSHSecretList_To_v1alpha1_SSHSecretList(in, out, s) +// Convert_kops_SSHCredentialList_To_v1alpha1_SSHCredentialList is an autogenerated conversion function. +func Convert_kops_SSHCredentialList_To_v1alpha1_SSHCredentialList(in *kops.SSHCredentialList, out *SSHCredentialList, s conversion.Scope) error { + return autoConvert_kops_SSHCredentialList_To_v1alpha1_SSHCredentialList(in, out, s) } -func autoConvert_v1alpha1_SSHSecretSpec_To_kops_SSHSecretSpec(in *SSHSecretSpec, out *kops.SSHSecretSpec, s conversion.Scope) error { - out.SshPublicKey = in.SshPublicKey - out.Username = in.Username +func autoConvert_v1alpha1_SSHCredentialSpec_To_kops_SSHCredentialSpec(in *SSHCredentialSpec, out *kops.SSHCredentialSpec, s conversion.Scope) error { + out.PublicKey = in.PublicKey return nil } -// Convert_v1alpha1_SSHSecretSpec_To_kops_SSHSecretSpec is an autogenerated conversion function. -func Convert_v1alpha1_SSHSecretSpec_To_kops_SSHSecretSpec(in *SSHSecretSpec, out *kops.SSHSecretSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_SSHSecretSpec_To_kops_SSHSecretSpec(in, out, s) +// Convert_v1alpha1_SSHCredentialSpec_To_kops_SSHCredentialSpec is an autogenerated conversion function. +func Convert_v1alpha1_SSHCredentialSpec_To_kops_SSHCredentialSpec(in *SSHCredentialSpec, out *kops.SSHCredentialSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_SSHCredentialSpec_To_kops_SSHCredentialSpec(in, out, s) } -func autoConvert_kops_SSHSecretSpec_To_v1alpha1_SSHSecretSpec(in *kops.SSHSecretSpec, out *SSHSecretSpec, s conversion.Scope) error { - out.SshPublicKey = in.SshPublicKey - out.Username = in.Username +func autoConvert_kops_SSHCredentialSpec_To_v1alpha1_SSHCredentialSpec(in *kops.SSHCredentialSpec, out *SSHCredentialSpec, s conversion.Scope) error { + out.PublicKey = in.PublicKey return nil } -// Convert_kops_SSHSecretSpec_To_v1alpha1_SSHSecretSpec is an autogenerated conversion function. -func Convert_kops_SSHSecretSpec_To_v1alpha1_SSHSecretSpec(in *kops.SSHSecretSpec, out *SSHSecretSpec, s conversion.Scope) error { - return autoConvert_kops_SSHSecretSpec_To_v1alpha1_SSHSecretSpec(in, out, s) +// Convert_kops_SSHCredentialSpec_To_v1alpha1_SSHCredentialSpec is an autogenerated conversion function. +func Convert_kops_SSHCredentialSpec_To_v1alpha1_SSHCredentialSpec(in *kops.SSHCredentialSpec, out *SSHCredentialSpec, s conversion.Scope) error { + return autoConvert_kops_SSHCredentialSpec_To_v1alpha1_SSHCredentialSpec(in, out, s) } func autoConvert_v1alpha1_WeaveNetworkingSpec_To_kops_WeaveNetworkingSpec(in *WeaveNetworkingSpec, out *kops.WeaveNetworkingSpec, s conversion.Scope) error { diff --git a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go index 6c0a90ecda..1bfc05b0c7 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go @@ -127,12 +127,12 @@ func RegisterConversions(scheme *runtime.Scheme) error { Convert_kops_NetworkingSpec_To_v1alpha2_NetworkingSpec, Convert_v1alpha2_RBACAuthorizationSpec_To_kops_RBACAuthorizationSpec, Convert_kops_RBACAuthorizationSpec_To_v1alpha2_RBACAuthorizationSpec, - Convert_v1alpha2_SSHSecret_To_kops_SSHSecret, - Convert_kops_SSHSecret_To_v1alpha2_SSHSecret, - Convert_v1alpha2_SSHSecretList_To_kops_SSHSecretList, - Convert_kops_SSHSecretList_To_v1alpha2_SSHSecretList, - Convert_v1alpha2_SSHSecretSpec_To_kops_SSHSecretSpec, - Convert_kops_SSHSecretSpec_To_v1alpha2_SSHSecretSpec, + Convert_v1alpha2_SSHCredential_To_kops_SSHCredential, + Convert_kops_SSHCredential_To_v1alpha2_SSHCredential, + Convert_v1alpha2_SSHCredentialList_To_kops_SSHCredentialList, + Convert_kops_SSHCredentialList_To_v1alpha2_SSHCredentialList, + Convert_v1alpha2_SSHCredentialSpec_To_kops_SSHCredentialSpec, + Convert_kops_SSHCredentialSpec_To_v1alpha2_SSHCredentialSpec, Convert_v1alpha2_TopologySpec_To_kops_TopologySpec, Convert_kops_TopologySpec_To_v1alpha2_TopologySpec, Convert_v1alpha2_WeaveNetworkingSpec_To_kops_WeaveNetworkingSpec, @@ -2272,94 +2272,92 @@ func Convert_kops_RBACAuthorizationSpec_To_v1alpha2_RBACAuthorizationSpec(in *ko return autoConvert_kops_RBACAuthorizationSpec_To_v1alpha2_RBACAuthorizationSpec(in, out, s) } -func autoConvert_v1alpha2_SSHSecret_To_kops_SSHSecret(in *SSHSecret, out *kops.SSHSecret, s conversion.Scope) error { +func autoConvert_v1alpha2_SSHCredential_To_kops_SSHCredential(in *SSHCredential, out *kops.SSHCredential, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha2_SSHSecretSpec_To_kops_SSHSecretSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha2_SSHCredentialSpec_To_kops_SSHCredentialSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha2_SSHSecret_To_kops_SSHSecret is an autogenerated conversion function. -func Convert_v1alpha2_SSHSecret_To_kops_SSHSecret(in *SSHSecret, out *kops.SSHSecret, s conversion.Scope) error { - return autoConvert_v1alpha2_SSHSecret_To_kops_SSHSecret(in, out, s) +// Convert_v1alpha2_SSHCredential_To_kops_SSHCredential is an autogenerated conversion function. +func Convert_v1alpha2_SSHCredential_To_kops_SSHCredential(in *SSHCredential, out *kops.SSHCredential, s conversion.Scope) error { + return autoConvert_v1alpha2_SSHCredential_To_kops_SSHCredential(in, out, s) } -func autoConvert_kops_SSHSecret_To_v1alpha2_SSHSecret(in *kops.SSHSecret, out *SSHSecret, s conversion.Scope) error { +func autoConvert_kops_SSHCredential_To_v1alpha2_SSHCredential(in *kops.SSHCredential, out *SSHCredential, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_kops_SSHSecretSpec_To_v1alpha2_SSHSecretSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_kops_SSHCredentialSpec_To_v1alpha2_SSHCredentialSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_kops_SSHSecret_To_v1alpha2_SSHSecret is an autogenerated conversion function. -func Convert_kops_SSHSecret_To_v1alpha2_SSHSecret(in *kops.SSHSecret, out *SSHSecret, s conversion.Scope) error { - return autoConvert_kops_SSHSecret_To_v1alpha2_SSHSecret(in, out, s) +// Convert_kops_SSHCredential_To_v1alpha2_SSHCredential is an autogenerated conversion function. +func Convert_kops_SSHCredential_To_v1alpha2_SSHCredential(in *kops.SSHCredential, out *SSHCredential, s conversion.Scope) error { + return autoConvert_kops_SSHCredential_To_v1alpha2_SSHCredential(in, out, s) } -func autoConvert_v1alpha2_SSHSecretList_To_kops_SSHSecretList(in *SSHSecretList, out *kops.SSHSecretList, s conversion.Scope) error { +func autoConvert_v1alpha2_SSHCredentialList_To_kops_SSHCredentialList(in *SSHCredentialList, out *kops.SSHCredentialList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]kops.SSHSecret, len(*in)) + *out = make([]kops.SSHCredential, len(*in)) for i := range *in { - if err := Convert_v1alpha2_SSHSecret_To_kops_SSHSecret(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha2_SSHCredential_To_kops_SSHCredential(&(*in)[i], &(*out)[i], s); err != nil { return err } } } else { - out.Items = make([]kops.SSHSecret, 0) + out.Items = make([]kops.SSHCredential, 0) } return nil } -// Convert_v1alpha2_SSHSecretList_To_kops_SSHSecretList is an autogenerated conversion function. -func Convert_v1alpha2_SSHSecretList_To_kops_SSHSecretList(in *SSHSecretList, out *kops.SSHSecretList, s conversion.Scope) error { - return autoConvert_v1alpha2_SSHSecretList_To_kops_SSHSecretList(in, out, s) +// Convert_v1alpha2_SSHCredentialList_To_kops_SSHCredentialList is an autogenerated conversion function. +func Convert_v1alpha2_SSHCredentialList_To_kops_SSHCredentialList(in *SSHCredentialList, out *kops.SSHCredentialList, s conversion.Scope) error { + return autoConvert_v1alpha2_SSHCredentialList_To_kops_SSHCredentialList(in, out, s) } -func autoConvert_kops_SSHSecretList_To_v1alpha2_SSHSecretList(in *kops.SSHSecretList, out *SSHSecretList, s conversion.Scope) error { +func autoConvert_kops_SSHCredentialList_To_v1alpha2_SSHCredentialList(in *kops.SSHCredentialList, out *SSHCredentialList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]SSHSecret, len(*in)) + *out = make([]SSHCredential, len(*in)) for i := range *in { - if err := Convert_kops_SSHSecret_To_v1alpha2_SSHSecret(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_kops_SSHCredential_To_v1alpha2_SSHCredential(&(*in)[i], &(*out)[i], s); err != nil { return err } } } else { - out.Items = make([]SSHSecret, 0) + out.Items = make([]SSHCredential, 0) } return nil } -// Convert_kops_SSHSecretList_To_v1alpha2_SSHSecretList is an autogenerated conversion function. -func Convert_kops_SSHSecretList_To_v1alpha2_SSHSecretList(in *kops.SSHSecretList, out *SSHSecretList, s conversion.Scope) error { - return autoConvert_kops_SSHSecretList_To_v1alpha2_SSHSecretList(in, out, s) +// Convert_kops_SSHCredentialList_To_v1alpha2_SSHCredentialList is an autogenerated conversion function. +func Convert_kops_SSHCredentialList_To_v1alpha2_SSHCredentialList(in *kops.SSHCredentialList, out *SSHCredentialList, s conversion.Scope) error { + return autoConvert_kops_SSHCredentialList_To_v1alpha2_SSHCredentialList(in, out, s) } -func autoConvert_v1alpha2_SSHSecretSpec_To_kops_SSHSecretSpec(in *SSHSecretSpec, out *kops.SSHSecretSpec, s conversion.Scope) error { - out.SshPublicKey = in.SshPublicKey - out.Username = in.Username +func autoConvert_v1alpha2_SSHCredentialSpec_To_kops_SSHCredentialSpec(in *SSHCredentialSpec, out *kops.SSHCredentialSpec, s conversion.Scope) error { + out.PublicKey = in.PublicKey return nil } -// Convert_v1alpha2_SSHSecretSpec_To_kops_SSHSecretSpec is an autogenerated conversion function. -func Convert_v1alpha2_SSHSecretSpec_To_kops_SSHSecretSpec(in *SSHSecretSpec, out *kops.SSHSecretSpec, s conversion.Scope) error { - return autoConvert_v1alpha2_SSHSecretSpec_To_kops_SSHSecretSpec(in, out, s) +// Convert_v1alpha2_SSHCredentialSpec_To_kops_SSHCredentialSpec is an autogenerated conversion function. +func Convert_v1alpha2_SSHCredentialSpec_To_kops_SSHCredentialSpec(in *SSHCredentialSpec, out *kops.SSHCredentialSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_SSHCredentialSpec_To_kops_SSHCredentialSpec(in, out, s) } -func autoConvert_kops_SSHSecretSpec_To_v1alpha2_SSHSecretSpec(in *kops.SSHSecretSpec, out *SSHSecretSpec, s conversion.Scope) error { - out.SshPublicKey = in.SshPublicKey - out.Username = in.Username +func autoConvert_kops_SSHCredentialSpec_To_v1alpha2_SSHCredentialSpec(in *kops.SSHCredentialSpec, out *SSHCredentialSpec, s conversion.Scope) error { + out.PublicKey = in.PublicKey return nil } -// Convert_kops_SSHSecretSpec_To_v1alpha2_SSHSecretSpec is an autogenerated conversion function. -func Convert_kops_SSHSecretSpec_To_v1alpha2_SSHSecretSpec(in *kops.SSHSecretSpec, out *SSHSecretSpec, s conversion.Scope) error { - return autoConvert_kops_SSHSecretSpec_To_v1alpha2_SSHSecretSpec(in, out, s) +// Convert_kops_SSHCredentialSpec_To_v1alpha2_SSHCredentialSpec is an autogenerated conversion function. +func Convert_kops_SSHCredentialSpec_To_v1alpha2_SSHCredentialSpec(in *kops.SSHCredentialSpec, out *SSHCredentialSpec, s conversion.Scope) error { + return autoConvert_kops_SSHCredentialSpec_To_v1alpha2_SSHCredentialSpec(in, out, s) } func autoConvert_v1alpha2_TopologySpec_To_kops_TopologySpec(in *TopologySpec, out *kops.TopologySpec, s conversion.Scope) error { diff --git a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_kops_client.go b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_kops_client.go index fd427a507c..37b869af5e 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_kops_client.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_kops_client.go @@ -38,8 +38,8 @@ func (c *FakeKops) InstanceGroups(namespace string) internalversion.InstanceGrou return &FakeInstanceGroups{c, namespace} } -func (c *FakeKops) SSHSecrets(namespace string) internalversion.SSHSecretInterface { - return &FakeSSHSecrets{c, namespace} +func (c *FakeKops) SSHCredentials(namespace string) internalversion.SSHCredentialInterface { + return &FakeSSHCredentials{c, namespace} } // RESTClient returns a RESTClient that is used to communicate diff --git a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_sshcredential.go b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_sshcredential.go new file mode 100644 index 0000000000..2cba670923 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_sshcredential.go @@ -0,0 +1,120 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + kops "k8s.io/kops/pkg/apis/kops" +) + +// FakeSSHCredentials implements SSHCredentialInterface +type FakeSSHCredentials struct { + Fake *FakeKops + ns string +} + +var sshcredentialsResource = schema.GroupVersionResource{Group: "kops", Version: "", Resource: "sshcredentials"} + +var sshcredentialsKind = schema.GroupVersionKind{Group: "kops", Version: "", Kind: "SSHCredential"} + +func (c *FakeSSHCredentials) Create(sSHCredential *kops.SSHCredential) (result *kops.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sshcredentialsResource, c.ns, sSHCredential), &kops.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHCredential), err +} + +func (c *FakeSSHCredentials) Update(sSHCredential *kops.SSHCredential) (result *kops.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sshcredentialsResource, c.ns, sSHCredential), &kops.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHCredential), err +} + +func (c *FakeSSHCredentials) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(sshcredentialsResource, c.ns, name), &kops.SSHCredential{}) + + return err +} + +func (c *FakeSSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sshcredentialsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &kops.SSHCredentialList{}) + return err +} + +func (c *FakeSSHCredentials) Get(name string, options v1.GetOptions) (result *kops.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sshcredentialsResource, c.ns, name), &kops.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHCredential), err +} + +func (c *FakeSSHCredentials) List(opts v1.ListOptions) (result *kops.SSHCredentialList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sshcredentialsResource, sshcredentialsKind, c.ns, opts), &kops.SSHCredentialList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kops.SSHCredentialList{} + for _, item := range obj.(*kops.SSHCredentialList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested sSHCredentials. +func (c *FakeSSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sshcredentialsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched sSHCredential. +func (c *FakeSSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sshcredentialsResource, c.ns, name, data, subresources...), &kops.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHCredential), err +} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_sshsecret.go b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_sshsecret.go deleted file mode 100644 index ecd577c9f5..0000000000 --- a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/fake/fake_sshsecret.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2017 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. -*/ - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - kops "k8s.io/kops/pkg/apis/kops" -) - -// FakeSSHSecrets implements SSHSecretInterface -type FakeSSHSecrets struct { - Fake *FakeKops - ns string -} - -var sshsecretsResource = schema.GroupVersionResource{Group: "kops", Version: "", Resource: "sshsecrets"} - -var sshsecretsKind = schema.GroupVersionKind{Group: "kops", Version: "", Kind: "SSHSecret"} - -func (c *FakeSSHSecrets) Create(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(sshsecretsResource, c.ns, sSHSecret), &kops.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*kops.SSHSecret), err -} - -func (c *FakeSSHSecrets) Update(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(sshsecretsResource, c.ns, sSHSecret), &kops.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*kops.SSHSecret), err -} - -func (c *FakeSSHSecrets) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(sshsecretsResource, c.ns, name), &kops.SSHSecret{}) - - return err -} - -func (c *FakeSSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(sshsecretsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &kops.SSHSecretList{}) - return err -} - -func (c *FakeSSHSecrets) Get(name string, options v1.GetOptions) (result *kops.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(sshsecretsResource, c.ns, name), &kops.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*kops.SSHSecret), err -} - -func (c *FakeSSHSecrets) List(opts v1.ListOptions) (result *kops.SSHSecretList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(sshsecretsResource, sshsecretsKind, c.ns, opts), &kops.SSHSecretList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &kops.SSHSecretList{} - for _, item := range obj.(*kops.SSHSecretList).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 sSHSecrets. -func (c *FakeSSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(sshsecretsResource, c.ns, opts)) - -} - -// Patch applies the patch and returns the patched sSHSecret. -func (c *FakeSSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(sshsecretsResource, c.ns, name, data, subresources...), &kops.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*kops.SSHSecret), err -} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/generated_expansion.go b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/generated_expansion.go index 8885bd5db7..89a0ca3dc8 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/generated_expansion.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/generated_expansion.go @@ -22,4 +22,4 @@ type FederationExpansion interface{} type InstanceGroupExpansion interface{} -type SSHSecretExpansion interface{} +type SSHCredentialExpansion interface{} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/kops_client.go b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/kops_client.go index 87b8047eab..2fe9c035b5 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/kops_client.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/kops_client.go @@ -26,7 +26,7 @@ type KopsInterface interface { ClustersGetter FederationsGetter InstanceGroupsGetter - SSHSecretsGetter + SSHCredentialsGetter } // KopsClient is used to interact with features provided by the kops group. @@ -46,8 +46,8 @@ func (c *KopsClient) InstanceGroups(namespace string) InstanceGroupInterface { return newInstanceGroups(c, namespace) } -func (c *KopsClient) SSHSecrets(namespace string) SSHSecretInterface { - return newSSHSecrets(c, namespace) +func (c *KopsClient) SSHCredentials(namespace string) SSHCredentialInterface { + return newSSHCredentials(c, namespace) } // NewForConfig creates a new KopsClient for the given config. diff --git a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/sshcredential.go b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/sshcredential.go new file mode 100644 index 0000000000..0477a26970 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/sshcredential.go @@ -0,0 +1,155 @@ +/* +Copyright 2017 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. +*/ + +package internalversion + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + kops "k8s.io/kops/pkg/apis/kops" + scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme" +) + +// SSHCredentialsGetter has a method to return a SSHCredentialInterface. +// A group's client should implement this interface. +type SSHCredentialsGetter interface { + SSHCredentials(namespace string) SSHCredentialInterface +} + +// SSHCredentialInterface has methods to work with SSHCredential resources. +type SSHCredentialInterface interface { + Create(*kops.SSHCredential) (*kops.SSHCredential, error) + Update(*kops.SSHCredential) (*kops.SSHCredential, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*kops.SSHCredential, error) + List(opts v1.ListOptions) (*kops.SSHCredentialList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHCredential, err error) + SSHCredentialExpansion +} + +// sSHCredentials implements SSHCredentialInterface +type sSHCredentials struct { + client rest.Interface + ns string +} + +// newSSHCredentials returns a SSHCredentials +func newSSHCredentials(c *KopsClient, namespace string) *sSHCredentials { + return &sSHCredentials{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any. +func (c *sSHCredentials) Create(sSHCredential *kops.SSHCredential) (result *kops.SSHCredential, err error) { + result = &kops.SSHCredential{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sshcredentials"). + Body(sSHCredential). + Do(). + Into(result) + return +} + +// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any. +func (c *sSHCredentials) Update(sSHCredential *kops.SSHCredential) (result *kops.SSHCredential, err error) { + result = &kops.SSHCredential{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(sSHCredential.Name). + Body(sSHCredential). + Do(). + Into(result) + return +} + +// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs. +func (c *sSHCredentials) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any. +func (c *sSHCredentials) Get(name string, options v1.GetOptions) (result *kops.SSHCredential, err error) { + result = &kops.SSHCredential{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors. +func (c *sSHCredentials) List(opts v1.ListOptions) (result *kops.SSHCredentialList, err error) { + result = &kops.SSHCredentialList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sSHCredentials. +func (c *sSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched sSHCredential. +func (c *sSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHCredential, err error) { + result = &kops.SSHCredential{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sshcredentials"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/sshsecret.go b/pkg/client/clientset_generated/clientset/typed/kops/internalversion/sshsecret.go deleted file mode 100644 index c8867a2433..0000000000 --- a/pkg/client/clientset_generated/clientset/typed/kops/internalversion/sshsecret.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2017 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. -*/ - -package internalversion - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - kops "k8s.io/kops/pkg/apis/kops" - scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme" -) - -// SSHSecretsGetter has a method to return a SSHSecretInterface. -// A group's client should implement this interface. -type SSHSecretsGetter interface { - SSHSecrets(namespace string) SSHSecretInterface -} - -// SSHSecretInterface has methods to work with SSHSecret resources. -type SSHSecretInterface interface { - Create(*kops.SSHSecret) (*kops.SSHSecret, error) - Update(*kops.SSHSecret) (*kops.SSHSecret, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*kops.SSHSecret, error) - List(opts v1.ListOptions) (*kops.SSHSecretList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHSecret, err error) - SSHSecretExpansion -} - -// sSHSecrets implements SSHSecretInterface -type sSHSecrets struct { - client rest.Interface - ns string -} - -// newSSHSecrets returns a SSHSecrets -func newSSHSecrets(c *KopsClient, namespace string) *sSHSecrets { - return &sSHSecrets{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Create takes the representation of a sSHSecret and creates it. Returns the server's representation of the sSHSecret, and an error, if there is any. -func (c *sSHSecrets) Create(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { - result = &kops.SSHSecret{} - err = c.client.Post(). - Namespace(c.ns). - Resource("sshsecrets"). - Body(sSHSecret). - Do(). - Into(result) - return -} - -// Update takes the representation of a sSHSecret and updates it. Returns the server's representation of the sSHSecret, and an error, if there is any. -func (c *sSHSecrets) Update(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { - result = &kops.SSHSecret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(sSHSecret.Name). - Body(sSHSecret). - Do(). - Into(result) - return -} - -// Delete takes name of the sSHSecret and deletes it. Returns an error if one occurs. -func (c *sSHSecrets) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *sSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Get takes name of the sSHSecret, and returns the corresponding sSHSecret object, and an error if there is any. -func (c *sSHSecrets) Get(name string, options v1.GetOptions) (result *kops.SSHSecret, err error) { - result = &kops.SSHSecret{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SSHSecrets that match those selectors. -func (c *sSHSecrets) List(opts v1.ListOptions) (result *kops.SSHSecretList, err error) { - result = &kops.SSHSecretList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested sSHSecrets. -func (c *sSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Patch applies the patch and returns the patched sSHSecret. -func (c *sSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHSecret, err error) { - result = &kops.SSHSecret{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("sshsecrets"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_kops_client.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_kops_client.go index bc8aaa5a0f..ffab877f59 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_kops_client.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_kops_client.go @@ -38,8 +38,8 @@ func (c *FakeKopsV1alpha1) InstanceGroups(namespace string) v1alpha1.InstanceGro return &FakeInstanceGroups{c, namespace} } -func (c *FakeKopsV1alpha1) SSHSecrets(namespace string) v1alpha1.SSHSecretInterface { - return &FakeSSHSecrets{c, namespace} +func (c *FakeKopsV1alpha1) SSHCredentials(namespace string) v1alpha1.SSHCredentialInterface { + return &FakeSSHCredentials{c, namespace} } // RESTClient returns a RESTClient that is used to communicate diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_sshcredential.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_sshcredential.go new file mode 100644 index 0000000000..0e738ba23c --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_sshcredential.go @@ -0,0 +1,120 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1" +) + +// FakeSSHCredentials implements SSHCredentialInterface +type FakeSSHCredentials struct { + Fake *FakeKopsV1alpha1 + ns string +} + +var sshcredentialsResource = schema.GroupVersionResource{Group: "kops", Version: "v1alpha1", Resource: "sshcredentials"} + +var sshcredentialsKind = schema.GroupVersionKind{Group: "kops", Version: "v1alpha1", Kind: "SSHCredential"} + +func (c *FakeSSHCredentials) Create(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha1.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHCredential), err +} + +func (c *FakeSSHCredentials) Update(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha1.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHCredential), err +} + +func (c *FakeSSHCredentials) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(sshcredentialsResource, c.ns, name), &v1alpha1.SSHCredential{}) + + return err +} + +func (c *FakeSSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sshcredentialsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.SSHCredentialList{}) + return err +} + +func (c *FakeSSHCredentials) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sshcredentialsResource, c.ns, name), &v1alpha1.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHCredential), err +} + +func (c *FakeSSHCredentials) List(opts v1.ListOptions) (result *v1alpha1.SSHCredentialList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sshcredentialsResource, sshcredentialsKind, c.ns, opts), &v1alpha1.SSHCredentialList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.SSHCredentialList{} + for _, item := range obj.(*v1alpha1.SSHCredentialList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested sSHCredentials. +func (c *FakeSSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sshcredentialsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched sSHCredential. +func (c *FakeSSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sshcredentialsResource, c.ns, name, data, subresources...), &v1alpha1.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHCredential), err +} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_sshsecret.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_sshsecret.go deleted file mode 100644 index 4e42ea4768..0000000000 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/fake/fake_sshsecret.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2017 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. -*/ - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1" -) - -// FakeSSHSecrets implements SSHSecretInterface -type FakeSSHSecrets struct { - Fake *FakeKopsV1alpha1 - ns string -} - -var sshsecretsResource = schema.GroupVersionResource{Group: "kops", Version: "v1alpha1", Resource: "sshsecrets"} - -var sshsecretsKind = schema.GroupVersionKind{Group: "kops", Version: "v1alpha1", Kind: "SSHSecret"} - -func (c *FakeSSHSecrets) Create(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha1.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.SSHSecret), err -} - -func (c *FakeSSHSecrets) Update(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha1.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.SSHSecret), err -} - -func (c *FakeSSHSecrets) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(sshsecretsResource, c.ns, name), &v1alpha1.SSHSecret{}) - - return err -} - -func (c *FakeSSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(sshsecretsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha1.SSHSecretList{}) - return err -} - -func (c *FakeSSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(sshsecretsResource, c.ns, name), &v1alpha1.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.SSHSecret), err -} - -func (c *FakeSSHSecrets) List(opts v1.ListOptions) (result *v1alpha1.SSHSecretList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(sshsecretsResource, sshsecretsKind, c.ns, opts), &v1alpha1.SSHSecretList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.SSHSecretList{} - for _, item := range obj.(*v1alpha1.SSHSecretList).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 sSHSecrets. -func (c *FakeSSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(sshsecretsResource, c.ns, opts)) - -} - -// Patch applies the patch and returns the patched sSHSecret. -func (c *FakeSSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(sshsecretsResource, c.ns, name, data, subresources...), &v1alpha1.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.SSHSecret), err -} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/generated_expansion.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/generated_expansion.go index b9ab3b64c3..c807571f8a 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/generated_expansion.go @@ -22,4 +22,4 @@ type FederationExpansion interface{} type InstanceGroupExpansion interface{} -type SSHSecretExpansion interface{} +type SSHCredentialExpansion interface{} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/kops_client.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/kops_client.go index 42b0901151..5ea0f35d92 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/kops_client.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/kops_client.go @@ -28,7 +28,7 @@ type KopsV1alpha1Interface interface { ClustersGetter FederationsGetter InstanceGroupsGetter - SSHSecretsGetter + SSHCredentialsGetter } // KopsV1alpha1Client is used to interact with features provided by the kops group. @@ -48,8 +48,8 @@ func (c *KopsV1alpha1Client) InstanceGroups(namespace string) InstanceGroupInter return newInstanceGroups(c, namespace) } -func (c *KopsV1alpha1Client) SSHSecrets(namespace string) SSHSecretInterface { - return newSSHSecrets(c, namespace) +func (c *KopsV1alpha1Client) SSHCredentials(namespace string) SSHCredentialInterface { + return newSSHCredentials(c, namespace) } // NewForConfig creates a new KopsV1alpha1Client for the given config. diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/sshcredential.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/sshcredential.go new file mode 100644 index 0000000000..711bef0dbf --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/sshcredential.go @@ -0,0 +1,155 @@ +/* +Copyright 2017 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. +*/ + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1" + scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme" +) + +// SSHCredentialsGetter has a method to return a SSHCredentialInterface. +// A group's client should implement this interface. +type SSHCredentialsGetter interface { + SSHCredentials(namespace string) SSHCredentialInterface +} + +// SSHCredentialInterface has methods to work with SSHCredential resources. +type SSHCredentialInterface interface { + Create(*v1alpha1.SSHCredential) (*v1alpha1.SSHCredential, error) + Update(*v1alpha1.SSHCredential) (*v1alpha1.SSHCredential, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.SSHCredential, error) + List(opts v1.ListOptions) (*v1alpha1.SSHCredentialList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error) + SSHCredentialExpansion +} + +// sSHCredentials implements SSHCredentialInterface +type sSHCredentials struct { + client rest.Interface + ns string +} + +// newSSHCredentials returns a SSHCredentials +func newSSHCredentials(c *KopsV1alpha1Client, namespace string) *sSHCredentials { + return &sSHCredentials{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any. +func (c *sSHCredentials) Create(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) { + result = &v1alpha1.SSHCredential{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sshcredentials"). + Body(sSHCredential). + Do(). + Into(result) + return +} + +// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any. +func (c *sSHCredentials) Update(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) { + result = &v1alpha1.SSHCredential{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(sSHCredential.Name). + Body(sSHCredential). + Do(). + Into(result) + return +} + +// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs. +func (c *sSHCredentials) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any. +func (c *sSHCredentials) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHCredential, err error) { + result = &v1alpha1.SSHCredential{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors. +func (c *sSHCredentials) List(opts v1.ListOptions) (result *v1alpha1.SSHCredentialList, err error) { + result = &v1alpha1.SSHCredentialList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sSHCredentials. +func (c *sSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched sSHCredential. +func (c *sSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error) { + result = &v1alpha1.SSHCredential{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sshcredentials"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/sshsecret.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/sshsecret.go deleted file mode 100644 index 58d1ffa725..0000000000 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha1/sshsecret.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2017 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. -*/ - -package v1alpha1 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1" - scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme" -) - -// SSHSecretsGetter has a method to return a SSHSecretInterface. -// A group's client should implement this interface. -type SSHSecretsGetter interface { - SSHSecrets(namespace string) SSHSecretInterface -} - -// SSHSecretInterface has methods to work with SSHSecret resources. -type SSHSecretInterface interface { - Create(*v1alpha1.SSHSecret) (*v1alpha1.SSHSecret, error) - Update(*v1alpha1.SSHSecret) (*v1alpha1.SSHSecret, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.SSHSecret, error) - List(opts v1.ListOptions) (*v1alpha1.SSHSecretList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHSecret, err error) - SSHSecretExpansion -} - -// sSHSecrets implements SSHSecretInterface -type sSHSecrets struct { - client rest.Interface - ns string -} - -// newSSHSecrets returns a SSHSecrets -func newSSHSecrets(c *KopsV1alpha1Client, namespace string) *sSHSecrets { - return &sSHSecrets{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Create takes the representation of a sSHSecret and creates it. Returns the server's representation of the sSHSecret, and an error, if there is any. -func (c *sSHSecrets) Create(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { - result = &v1alpha1.SSHSecret{} - err = c.client.Post(). - Namespace(c.ns). - Resource("sshsecrets"). - Body(sSHSecret). - Do(). - Into(result) - return -} - -// Update takes the representation of a sSHSecret and updates it. Returns the server's representation of the sSHSecret, and an error, if there is any. -func (c *sSHSecrets) Update(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { - result = &v1alpha1.SSHSecret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(sSHSecret.Name). - Body(sSHSecret). - Do(). - Into(result) - return -} - -// Delete takes name of the sSHSecret and deletes it. Returns an error if one occurs. -func (c *sSHSecrets) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *sSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Get takes name of the sSHSecret, and returns the corresponding sSHSecret object, and an error if there is any. -func (c *sSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHSecret, err error) { - result = &v1alpha1.SSHSecret{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SSHSecrets that match those selectors. -func (c *sSHSecrets) List(opts v1.ListOptions) (result *v1alpha1.SSHSecretList, err error) { - result = &v1alpha1.SSHSecretList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested sSHSecrets. -func (c *sSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Patch applies the patch and returns the patched sSHSecret. -func (c *sSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHSecret, err error) { - result = &v1alpha1.SSHSecret{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("sshsecrets"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_kops_client.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_kops_client.go index e8f6660e6b..8fd075daa4 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_kops_client.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_kops_client.go @@ -38,8 +38,8 @@ func (c *FakeKopsV1alpha2) InstanceGroups(namespace string) v1alpha2.InstanceGro return &FakeInstanceGroups{c, namespace} } -func (c *FakeKopsV1alpha2) SSHSecrets(namespace string) v1alpha2.SSHSecretInterface { - return &FakeSSHSecrets{c, namespace} +func (c *FakeKopsV1alpha2) SSHCredentials(namespace string) v1alpha2.SSHCredentialInterface { + return &FakeSSHCredentials{c, namespace} } // RESTClient returns a RESTClient that is used to communicate diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_sshcredential.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_sshcredential.go new file mode 100644 index 0000000000..41ec3d89f9 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_sshcredential.go @@ -0,0 +1,120 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2" +) + +// FakeSSHCredentials implements SSHCredentialInterface +type FakeSSHCredentials struct { + Fake *FakeKopsV1alpha2 + ns string +} + +var sshcredentialsResource = schema.GroupVersionResource{Group: "kops", Version: "v1alpha2", Resource: "sshcredentials"} + +var sshcredentialsKind = schema.GroupVersionKind{Group: "kops", Version: "v1alpha2", Kind: "SSHCredential"} + +func (c *FakeSSHCredentials) Create(sSHCredential *v1alpha2.SSHCredential) (result *v1alpha2.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha2.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHCredential), err +} + +func (c *FakeSSHCredentials) Update(sSHCredential *v1alpha2.SSHCredential) (result *v1alpha2.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha2.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHCredential), err +} + +func (c *FakeSSHCredentials) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(sshcredentialsResource, c.ns, name), &v1alpha2.SSHCredential{}) + + return err +} + +func (c *FakeSSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sshcredentialsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha2.SSHCredentialList{}) + return err +} + +func (c *FakeSSHCredentials) Get(name string, options v1.GetOptions) (result *v1alpha2.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sshcredentialsResource, c.ns, name), &v1alpha2.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHCredential), err +} + +func (c *FakeSSHCredentials) List(opts v1.ListOptions) (result *v1alpha2.SSHCredentialList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sshcredentialsResource, sshcredentialsKind, c.ns, opts), &v1alpha2.SSHCredentialList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha2.SSHCredentialList{} + for _, item := range obj.(*v1alpha2.SSHCredentialList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested sSHCredentials. +func (c *FakeSSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sshcredentialsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched sSHCredential. +func (c *FakeSSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sshcredentialsResource, c.ns, name, data, subresources...), &v1alpha2.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHCredential), err +} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_sshsecret.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_sshsecret.go deleted file mode 100644 index 998ff2ad31..0000000000 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/fake/fake_sshsecret.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2017 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. -*/ - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2" -) - -// FakeSSHSecrets implements SSHSecretInterface -type FakeSSHSecrets struct { - Fake *FakeKopsV1alpha2 - ns string -} - -var sshsecretsResource = schema.GroupVersionResource{Group: "kops", Version: "v1alpha2", Resource: "sshsecrets"} - -var sshsecretsKind = schema.GroupVersionKind{Group: "kops", Version: "v1alpha2", Kind: "SSHSecret"} - -func (c *FakeSSHSecrets) Create(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha2.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.SSHSecret), err -} - -func (c *FakeSSHSecrets) Update(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha2.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.SSHSecret), err -} - -func (c *FakeSSHSecrets) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(sshsecretsResource, c.ns, name), &v1alpha2.SSHSecret{}) - - return err -} - -func (c *FakeSSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(sshsecretsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha2.SSHSecretList{}) - return err -} - -func (c *FakeSSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha2.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(sshsecretsResource, c.ns, name), &v1alpha2.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.SSHSecret), err -} - -func (c *FakeSSHSecrets) List(opts v1.ListOptions) (result *v1alpha2.SSHSecretList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(sshsecretsResource, sshsecretsKind, c.ns, opts), &v1alpha2.SSHSecretList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.SSHSecretList{} - for _, item := range obj.(*v1alpha2.SSHSecretList).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 sSHSecrets. -func (c *FakeSSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(sshsecretsResource, c.ns, opts)) - -} - -// Patch applies the patch and returns the patched sSHSecret. -func (c *FakeSSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(sshsecretsResource, c.ns, name, data, subresources...), &v1alpha2.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.SSHSecret), err -} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/generated_expansion.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/generated_expansion.go index dcd702a99b..95e346c38e 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/generated_expansion.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/generated_expansion.go @@ -22,4 +22,4 @@ type FederationExpansion interface{} type InstanceGroupExpansion interface{} -type SSHSecretExpansion interface{} +type SSHCredentialExpansion interface{} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/kops_client.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/kops_client.go index 07a4a1ce16..48e776a37c 100644 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/kops_client.go +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/kops_client.go @@ -28,7 +28,7 @@ type KopsV1alpha2Interface interface { ClustersGetter FederationsGetter InstanceGroupsGetter - SSHSecretsGetter + SSHCredentialsGetter } // KopsV1alpha2Client is used to interact with features provided by the kops group. @@ -48,8 +48,8 @@ func (c *KopsV1alpha2Client) InstanceGroups(namespace string) InstanceGroupInter return newInstanceGroups(c, namespace) } -func (c *KopsV1alpha2Client) SSHSecrets(namespace string) SSHSecretInterface { - return newSSHSecrets(c, namespace) +func (c *KopsV1alpha2Client) SSHCredentials(namespace string) SSHCredentialInterface { + return newSSHCredentials(c, namespace) } // NewForConfig creates a new KopsV1alpha2Client for the given config. diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/sshcredential.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/sshcredential.go new file mode 100644 index 0000000000..93df824ab2 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/sshcredential.go @@ -0,0 +1,155 @@ +/* +Copyright 2017 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. +*/ + +package v1alpha2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2" + scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme" +) + +// SSHCredentialsGetter has a method to return a SSHCredentialInterface. +// A group's client should implement this interface. +type SSHCredentialsGetter interface { + SSHCredentials(namespace string) SSHCredentialInterface +} + +// SSHCredentialInterface has methods to work with SSHCredential resources. +type SSHCredentialInterface interface { + Create(*v1alpha2.SSHCredential) (*v1alpha2.SSHCredential, error) + Update(*v1alpha2.SSHCredential) (*v1alpha2.SSHCredential, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha2.SSHCredential, error) + List(opts v1.ListOptions) (*v1alpha2.SSHCredentialList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHCredential, err error) + SSHCredentialExpansion +} + +// sSHCredentials implements SSHCredentialInterface +type sSHCredentials struct { + client rest.Interface + ns string +} + +// newSSHCredentials returns a SSHCredentials +func newSSHCredentials(c *KopsV1alpha2Client, namespace string) *sSHCredentials { + return &sSHCredentials{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any. +func (c *sSHCredentials) Create(sSHCredential *v1alpha2.SSHCredential) (result *v1alpha2.SSHCredential, err error) { + result = &v1alpha2.SSHCredential{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sshcredentials"). + Body(sSHCredential). + Do(). + Into(result) + return +} + +// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any. +func (c *sSHCredentials) Update(sSHCredential *v1alpha2.SSHCredential) (result *v1alpha2.SSHCredential, err error) { + result = &v1alpha2.SSHCredential{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(sSHCredential.Name). + Body(sSHCredential). + Do(). + Into(result) + return +} + +// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs. +func (c *sSHCredentials) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any. +func (c *sSHCredentials) Get(name string, options v1.GetOptions) (result *v1alpha2.SSHCredential, err error) { + result = &v1alpha2.SSHCredential{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors. +func (c *sSHCredentials) List(opts v1.ListOptions) (result *v1alpha2.SSHCredentialList, err error) { + result = &v1alpha2.SSHCredentialList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sSHCredentials. +func (c *sSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched sSHCredential. +func (c *sSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHCredential, err error) { + result = &v1alpha2.SSHCredential{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sshcredentials"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/sshsecret.go b/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/sshsecret.go deleted file mode 100644 index d10aaa7818..0000000000 --- a/pkg/client/clientset_generated/clientset/typed/kops/v1alpha2/sshsecret.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2017 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. -*/ - -package v1alpha2 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2" - scheme "k8s.io/kops/pkg/client/clientset_generated/clientset/scheme" -) - -// SSHSecretsGetter has a method to return a SSHSecretInterface. -// A group's client should implement this interface. -type SSHSecretsGetter interface { - SSHSecrets(namespace string) SSHSecretInterface -} - -// SSHSecretInterface has methods to work with SSHSecret resources. -type SSHSecretInterface interface { - Create(*v1alpha2.SSHSecret) (*v1alpha2.SSHSecret, error) - Update(*v1alpha2.SSHSecret) (*v1alpha2.SSHSecret, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha2.SSHSecret, error) - List(opts v1.ListOptions) (*v1alpha2.SSHSecretList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHSecret, err error) - SSHSecretExpansion -} - -// sSHSecrets implements SSHSecretInterface -type sSHSecrets struct { - client rest.Interface - ns string -} - -// newSSHSecrets returns a SSHSecrets -func newSSHSecrets(c *KopsV1alpha2Client, namespace string) *sSHSecrets { - return &sSHSecrets{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Create takes the representation of a sSHSecret and creates it. Returns the server's representation of the sSHSecret, and an error, if there is any. -func (c *sSHSecrets) Create(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { - result = &v1alpha2.SSHSecret{} - err = c.client.Post(). - Namespace(c.ns). - Resource("sshsecrets"). - Body(sSHSecret). - Do(). - Into(result) - return -} - -// Update takes the representation of a sSHSecret and updates it. Returns the server's representation of the sSHSecret, and an error, if there is any. -func (c *sSHSecrets) Update(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { - result = &v1alpha2.SSHSecret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(sSHSecret.Name). - Body(sSHSecret). - Do(). - Into(result) - return -} - -// Delete takes name of the sSHSecret and deletes it. Returns an error if one occurs. -func (c *sSHSecrets) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *sSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Get takes name of the sSHSecret, and returns the corresponding sSHSecret object, and an error if there is any. -func (c *sSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha2.SSHSecret, err error) { - result = &v1alpha2.SSHSecret{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SSHSecrets that match those selectors. -func (c *sSHSecrets) List(opts v1.ListOptions) (result *v1alpha2.SSHSecretList, err error) { - result = &v1alpha2.SSHSecretList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested sSHSecrets. -func (c *sSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Patch applies the patch and returns the patched sSHSecret. -func (c *sSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHSecret, err error) { - result = &v1alpha2.SSHSecret{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("sshsecrets"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_kops_client.go b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_kops_client.go index d7cde6f8e3..d2e23ed4e9 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_kops_client.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_kops_client.go @@ -38,8 +38,8 @@ func (c *FakeKops) InstanceGroups(namespace string) internalversion.InstanceGrou return &FakeInstanceGroups{c, namespace} } -func (c *FakeKops) SSHSecrets(namespace string) internalversion.SSHSecretInterface { - return &FakeSSHSecrets{c, namespace} +func (c *FakeKops) SSHCredentials(namespace string) internalversion.SSHCredentialInterface { + return &FakeSSHCredentials{c, namespace} } // RESTClient returns a RESTClient that is used to communicate diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_sshcredential.go b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_sshcredential.go new file mode 100644 index 0000000000..2cba670923 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_sshcredential.go @@ -0,0 +1,120 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + kops "k8s.io/kops/pkg/apis/kops" +) + +// FakeSSHCredentials implements SSHCredentialInterface +type FakeSSHCredentials struct { + Fake *FakeKops + ns string +} + +var sshcredentialsResource = schema.GroupVersionResource{Group: "kops", Version: "", Resource: "sshcredentials"} + +var sshcredentialsKind = schema.GroupVersionKind{Group: "kops", Version: "", Kind: "SSHCredential"} + +func (c *FakeSSHCredentials) Create(sSHCredential *kops.SSHCredential) (result *kops.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sshcredentialsResource, c.ns, sSHCredential), &kops.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHCredential), err +} + +func (c *FakeSSHCredentials) Update(sSHCredential *kops.SSHCredential) (result *kops.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sshcredentialsResource, c.ns, sSHCredential), &kops.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHCredential), err +} + +func (c *FakeSSHCredentials) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(sshcredentialsResource, c.ns, name), &kops.SSHCredential{}) + + return err +} + +func (c *FakeSSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sshcredentialsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &kops.SSHCredentialList{}) + return err +} + +func (c *FakeSSHCredentials) Get(name string, options v1.GetOptions) (result *kops.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sshcredentialsResource, c.ns, name), &kops.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHCredential), err +} + +func (c *FakeSSHCredentials) List(opts v1.ListOptions) (result *kops.SSHCredentialList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sshcredentialsResource, sshcredentialsKind, c.ns, opts), &kops.SSHCredentialList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &kops.SSHCredentialList{} + for _, item := range obj.(*kops.SSHCredentialList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested sSHCredentials. +func (c *FakeSSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sshcredentialsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched sSHCredential. +func (c *FakeSSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sshcredentialsResource, c.ns, name, data, subresources...), &kops.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*kops.SSHCredential), err +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_sshsecret.go b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_sshsecret.go deleted file mode 100644 index ecd577c9f5..0000000000 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/fake/fake_sshsecret.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2017 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. -*/ - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - kops "k8s.io/kops/pkg/apis/kops" -) - -// FakeSSHSecrets implements SSHSecretInterface -type FakeSSHSecrets struct { - Fake *FakeKops - ns string -} - -var sshsecretsResource = schema.GroupVersionResource{Group: "kops", Version: "", Resource: "sshsecrets"} - -var sshsecretsKind = schema.GroupVersionKind{Group: "kops", Version: "", Kind: "SSHSecret"} - -func (c *FakeSSHSecrets) Create(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(sshsecretsResource, c.ns, sSHSecret), &kops.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*kops.SSHSecret), err -} - -func (c *FakeSSHSecrets) Update(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(sshsecretsResource, c.ns, sSHSecret), &kops.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*kops.SSHSecret), err -} - -func (c *FakeSSHSecrets) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(sshsecretsResource, c.ns, name), &kops.SSHSecret{}) - - return err -} - -func (c *FakeSSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(sshsecretsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &kops.SSHSecretList{}) - return err -} - -func (c *FakeSSHSecrets) Get(name string, options v1.GetOptions) (result *kops.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(sshsecretsResource, c.ns, name), &kops.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*kops.SSHSecret), err -} - -func (c *FakeSSHSecrets) List(opts v1.ListOptions) (result *kops.SSHSecretList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(sshsecretsResource, sshsecretsKind, c.ns, opts), &kops.SSHSecretList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &kops.SSHSecretList{} - for _, item := range obj.(*kops.SSHSecretList).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 sSHSecrets. -func (c *FakeSSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(sshsecretsResource, c.ns, opts)) - -} - -// Patch applies the patch and returns the patched sSHSecret. -func (c *FakeSSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(sshsecretsResource, c.ns, name, data, subresources...), &kops.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*kops.SSHSecret), err -} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/generated_expansion.go b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/generated_expansion.go index 8885bd5db7..89a0ca3dc8 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/generated_expansion.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/generated_expansion.go @@ -22,4 +22,4 @@ type FederationExpansion interface{} type InstanceGroupExpansion interface{} -type SSHSecretExpansion interface{} +type SSHCredentialExpansion interface{} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/kops_client.go b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/kops_client.go index fcd0607dda..e22a14e1da 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/kops_client.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/kops_client.go @@ -26,7 +26,7 @@ type KopsInterface interface { ClustersGetter FederationsGetter InstanceGroupsGetter - SSHSecretsGetter + SSHCredentialsGetter } // KopsClient is used to interact with features provided by the kops group. @@ -46,8 +46,8 @@ func (c *KopsClient) InstanceGroups(namespace string) InstanceGroupInterface { return newInstanceGroups(c, namespace) } -func (c *KopsClient) SSHSecrets(namespace string) SSHSecretInterface { - return newSSHSecrets(c, namespace) +func (c *KopsClient) SSHCredentials(namespace string) SSHCredentialInterface { + return newSSHCredentials(c, namespace) } // NewForConfig creates a new KopsClient for the given config. diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/sshcredential.go b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/sshcredential.go new file mode 100644 index 0000000000..baa4c95afc --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/sshcredential.go @@ -0,0 +1,155 @@ +/* +Copyright 2017 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. +*/ + +package internalversion + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + kops "k8s.io/kops/pkg/apis/kops" + scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme" +) + +// SSHCredentialsGetter has a method to return a SSHCredentialInterface. +// A group's client should implement this interface. +type SSHCredentialsGetter interface { + SSHCredentials(namespace string) SSHCredentialInterface +} + +// SSHCredentialInterface has methods to work with SSHCredential resources. +type SSHCredentialInterface interface { + Create(*kops.SSHCredential) (*kops.SSHCredential, error) + Update(*kops.SSHCredential) (*kops.SSHCredential, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*kops.SSHCredential, error) + List(opts v1.ListOptions) (*kops.SSHCredentialList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHCredential, err error) + SSHCredentialExpansion +} + +// sSHCredentials implements SSHCredentialInterface +type sSHCredentials struct { + client rest.Interface + ns string +} + +// newSSHCredentials returns a SSHCredentials +func newSSHCredentials(c *KopsClient, namespace string) *sSHCredentials { + return &sSHCredentials{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any. +func (c *sSHCredentials) Create(sSHCredential *kops.SSHCredential) (result *kops.SSHCredential, err error) { + result = &kops.SSHCredential{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sshcredentials"). + Body(sSHCredential). + Do(). + Into(result) + return +} + +// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any. +func (c *sSHCredentials) Update(sSHCredential *kops.SSHCredential) (result *kops.SSHCredential, err error) { + result = &kops.SSHCredential{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(sSHCredential.Name). + Body(sSHCredential). + Do(). + Into(result) + return +} + +// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs. +func (c *sSHCredentials) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any. +func (c *sSHCredentials) Get(name string, options v1.GetOptions) (result *kops.SSHCredential, err error) { + result = &kops.SSHCredential{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors. +func (c *sSHCredentials) List(opts v1.ListOptions) (result *kops.SSHCredentialList, err error) { + result = &kops.SSHCredentialList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sSHCredentials. +func (c *sSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched sSHCredential. +func (c *sSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHCredential, err error) { + result = &kops.SSHCredential{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sshcredentials"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/sshsecret.go b/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/sshsecret.go deleted file mode 100644 index 90c9e0565b..0000000000 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/internalversion/sshsecret.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2017 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. -*/ - -package internalversion - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - kops "k8s.io/kops/pkg/apis/kops" - scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme" -) - -// SSHSecretsGetter has a method to return a SSHSecretInterface. -// A group's client should implement this interface. -type SSHSecretsGetter interface { - SSHSecrets(namespace string) SSHSecretInterface -} - -// SSHSecretInterface has methods to work with SSHSecret resources. -type SSHSecretInterface interface { - Create(*kops.SSHSecret) (*kops.SSHSecret, error) - Update(*kops.SSHSecret) (*kops.SSHSecret, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*kops.SSHSecret, error) - List(opts v1.ListOptions) (*kops.SSHSecretList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHSecret, err error) - SSHSecretExpansion -} - -// sSHSecrets implements SSHSecretInterface -type sSHSecrets struct { - client rest.Interface - ns string -} - -// newSSHSecrets returns a SSHSecrets -func newSSHSecrets(c *KopsClient, namespace string) *sSHSecrets { - return &sSHSecrets{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Create takes the representation of a sSHSecret and creates it. Returns the server's representation of the sSHSecret, and an error, if there is any. -func (c *sSHSecrets) Create(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { - result = &kops.SSHSecret{} - err = c.client.Post(). - Namespace(c.ns). - Resource("sshsecrets"). - Body(sSHSecret). - Do(). - Into(result) - return -} - -// Update takes the representation of a sSHSecret and updates it. Returns the server's representation of the sSHSecret, and an error, if there is any. -func (c *sSHSecrets) Update(sSHSecret *kops.SSHSecret) (result *kops.SSHSecret, err error) { - result = &kops.SSHSecret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(sSHSecret.Name). - Body(sSHSecret). - Do(). - Into(result) - return -} - -// Delete takes name of the sSHSecret and deletes it. Returns an error if one occurs. -func (c *sSHSecrets) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *sSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Get takes name of the sSHSecret, and returns the corresponding sSHSecret object, and an error if there is any. -func (c *sSHSecrets) Get(name string, options v1.GetOptions) (result *kops.SSHSecret, err error) { - result = &kops.SSHSecret{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SSHSecrets that match those selectors. -func (c *sSHSecrets) List(opts v1.ListOptions) (result *kops.SSHSecretList, err error) { - result = &kops.SSHSecretList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested sSHSecrets. -func (c *sSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Patch applies the patch and returns the patched sSHSecret. -func (c *sSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *kops.SSHSecret, err error) { - result = &kops.SSHSecret{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("sshsecrets"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_kops_client.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_kops_client.go index c14f7422f9..5d23de2744 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_kops_client.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_kops_client.go @@ -38,8 +38,8 @@ func (c *FakeKopsV1alpha1) InstanceGroups(namespace string) v1alpha1.InstanceGro return &FakeInstanceGroups{c, namespace} } -func (c *FakeKopsV1alpha1) SSHSecrets(namespace string) v1alpha1.SSHSecretInterface { - return &FakeSSHSecrets{c, namespace} +func (c *FakeKopsV1alpha1) SSHCredentials(namespace string) v1alpha1.SSHCredentialInterface { + return &FakeSSHCredentials{c, namespace} } // RESTClient returns a RESTClient that is used to communicate diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_sshcredential.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_sshcredential.go new file mode 100644 index 0000000000..0e738ba23c --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_sshcredential.go @@ -0,0 +1,120 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1" +) + +// FakeSSHCredentials implements SSHCredentialInterface +type FakeSSHCredentials struct { + Fake *FakeKopsV1alpha1 + ns string +} + +var sshcredentialsResource = schema.GroupVersionResource{Group: "kops", Version: "v1alpha1", Resource: "sshcredentials"} + +var sshcredentialsKind = schema.GroupVersionKind{Group: "kops", Version: "v1alpha1", Kind: "SSHCredential"} + +func (c *FakeSSHCredentials) Create(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha1.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHCredential), err +} + +func (c *FakeSSHCredentials) Update(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha1.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHCredential), err +} + +func (c *FakeSSHCredentials) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(sshcredentialsResource, c.ns, name), &v1alpha1.SSHCredential{}) + + return err +} + +func (c *FakeSSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sshcredentialsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.SSHCredentialList{}) + return err +} + +func (c *FakeSSHCredentials) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sshcredentialsResource, c.ns, name), &v1alpha1.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHCredential), err +} + +func (c *FakeSSHCredentials) List(opts v1.ListOptions) (result *v1alpha1.SSHCredentialList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sshcredentialsResource, sshcredentialsKind, c.ns, opts), &v1alpha1.SSHCredentialList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.SSHCredentialList{} + for _, item := range obj.(*v1alpha1.SSHCredentialList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested sSHCredentials. +func (c *FakeSSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sshcredentialsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched sSHCredential. +func (c *FakeSSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sshcredentialsResource, c.ns, name, data, subresources...), &v1alpha1.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.SSHCredential), err +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_sshsecret.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_sshsecret.go deleted file mode 100644 index 4e42ea4768..0000000000 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/fake/fake_sshsecret.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2017 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. -*/ - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1" -) - -// FakeSSHSecrets implements SSHSecretInterface -type FakeSSHSecrets struct { - Fake *FakeKopsV1alpha1 - ns string -} - -var sshsecretsResource = schema.GroupVersionResource{Group: "kops", Version: "v1alpha1", Resource: "sshsecrets"} - -var sshsecretsKind = schema.GroupVersionKind{Group: "kops", Version: "v1alpha1", Kind: "SSHSecret"} - -func (c *FakeSSHSecrets) Create(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha1.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.SSHSecret), err -} - -func (c *FakeSSHSecrets) Update(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha1.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.SSHSecret), err -} - -func (c *FakeSSHSecrets) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(sshsecretsResource, c.ns, name), &v1alpha1.SSHSecret{}) - - return err -} - -func (c *FakeSSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(sshsecretsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha1.SSHSecretList{}) - return err -} - -func (c *FakeSSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(sshsecretsResource, c.ns, name), &v1alpha1.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.SSHSecret), err -} - -func (c *FakeSSHSecrets) List(opts v1.ListOptions) (result *v1alpha1.SSHSecretList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(sshsecretsResource, sshsecretsKind, c.ns, opts), &v1alpha1.SSHSecretList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.SSHSecretList{} - for _, item := range obj.(*v1alpha1.SSHSecretList).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 sSHSecrets. -func (c *FakeSSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(sshsecretsResource, c.ns, opts)) - -} - -// Patch applies the patch and returns the patched sSHSecret. -func (c *FakeSSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(sshsecretsResource, c.ns, name, data, subresources...), &v1alpha1.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.SSHSecret), err -} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/generated_expansion.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/generated_expansion.go index b9ab3b64c3..c807571f8a 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/generated_expansion.go @@ -22,4 +22,4 @@ type FederationExpansion interface{} type InstanceGroupExpansion interface{} -type SSHSecretExpansion interface{} +type SSHCredentialExpansion interface{} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/kops_client.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/kops_client.go index 663c47aea8..b0eae77d5a 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/kops_client.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/kops_client.go @@ -28,7 +28,7 @@ type KopsV1alpha1Interface interface { ClustersGetter FederationsGetter InstanceGroupsGetter - SSHSecretsGetter + SSHCredentialsGetter } // KopsV1alpha1Client is used to interact with features provided by the kops group. @@ -48,8 +48,8 @@ func (c *KopsV1alpha1Client) InstanceGroups(namespace string) InstanceGroupInter return newInstanceGroups(c, namespace) } -func (c *KopsV1alpha1Client) SSHSecrets(namespace string) SSHSecretInterface { - return newSSHSecrets(c, namespace) +func (c *KopsV1alpha1Client) SSHCredentials(namespace string) SSHCredentialInterface { + return newSSHCredentials(c, namespace) } // NewForConfig creates a new KopsV1alpha1Client for the given config. diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/sshcredential.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/sshcredential.go new file mode 100644 index 0000000000..e6ee8004ce --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/sshcredential.go @@ -0,0 +1,155 @@ +/* +Copyright 2017 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. +*/ + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1" + scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme" +) + +// SSHCredentialsGetter has a method to return a SSHCredentialInterface. +// A group's client should implement this interface. +type SSHCredentialsGetter interface { + SSHCredentials(namespace string) SSHCredentialInterface +} + +// SSHCredentialInterface has methods to work with SSHCredential resources. +type SSHCredentialInterface interface { + Create(*v1alpha1.SSHCredential) (*v1alpha1.SSHCredential, error) + Update(*v1alpha1.SSHCredential) (*v1alpha1.SSHCredential, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.SSHCredential, error) + List(opts v1.ListOptions) (*v1alpha1.SSHCredentialList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error) + SSHCredentialExpansion +} + +// sSHCredentials implements SSHCredentialInterface +type sSHCredentials struct { + client rest.Interface + ns string +} + +// newSSHCredentials returns a SSHCredentials +func newSSHCredentials(c *KopsV1alpha1Client, namespace string) *sSHCredentials { + return &sSHCredentials{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any. +func (c *sSHCredentials) Create(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) { + result = &v1alpha1.SSHCredential{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sshcredentials"). + Body(sSHCredential). + Do(). + Into(result) + return +} + +// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any. +func (c *sSHCredentials) Update(sSHCredential *v1alpha1.SSHCredential) (result *v1alpha1.SSHCredential, err error) { + result = &v1alpha1.SSHCredential{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(sSHCredential.Name). + Body(sSHCredential). + Do(). + Into(result) + return +} + +// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs. +func (c *sSHCredentials) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any. +func (c *sSHCredentials) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHCredential, err error) { + result = &v1alpha1.SSHCredential{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors. +func (c *sSHCredentials) List(opts v1.ListOptions) (result *v1alpha1.SSHCredentialList, err error) { + result = &v1alpha1.SSHCredentialList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sSHCredentials. +func (c *sSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched sSHCredential. +func (c *sSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHCredential, err error) { + result = &v1alpha1.SSHCredential{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sshcredentials"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/sshsecret.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/sshsecret.go deleted file mode 100644 index a39991e398..0000000000 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha1/sshsecret.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2017 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. -*/ - -package v1alpha1 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "k8s.io/kops/pkg/apis/kops/v1alpha1" - scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme" -) - -// SSHSecretsGetter has a method to return a SSHSecretInterface. -// A group's client should implement this interface. -type SSHSecretsGetter interface { - SSHSecrets(namespace string) SSHSecretInterface -} - -// SSHSecretInterface has methods to work with SSHSecret resources. -type SSHSecretInterface interface { - Create(*v1alpha1.SSHSecret) (*v1alpha1.SSHSecret, error) - Update(*v1alpha1.SSHSecret) (*v1alpha1.SSHSecret, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.SSHSecret, error) - List(opts v1.ListOptions) (*v1alpha1.SSHSecretList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHSecret, err error) - SSHSecretExpansion -} - -// sSHSecrets implements SSHSecretInterface -type sSHSecrets struct { - client rest.Interface - ns string -} - -// newSSHSecrets returns a SSHSecrets -func newSSHSecrets(c *KopsV1alpha1Client, namespace string) *sSHSecrets { - return &sSHSecrets{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Create takes the representation of a sSHSecret and creates it. Returns the server's representation of the sSHSecret, and an error, if there is any. -func (c *sSHSecrets) Create(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { - result = &v1alpha1.SSHSecret{} - err = c.client.Post(). - Namespace(c.ns). - Resource("sshsecrets"). - Body(sSHSecret). - Do(). - Into(result) - return -} - -// Update takes the representation of a sSHSecret and updates it. Returns the server's representation of the sSHSecret, and an error, if there is any. -func (c *sSHSecrets) Update(sSHSecret *v1alpha1.SSHSecret) (result *v1alpha1.SSHSecret, err error) { - result = &v1alpha1.SSHSecret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(sSHSecret.Name). - Body(sSHSecret). - Do(). - Into(result) - return -} - -// Delete takes name of the sSHSecret and deletes it. Returns an error if one occurs. -func (c *sSHSecrets) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *sSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Get takes name of the sSHSecret, and returns the corresponding sSHSecret object, and an error if there is any. -func (c *sSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha1.SSHSecret, err error) { - result = &v1alpha1.SSHSecret{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SSHSecrets that match those selectors. -func (c *sSHSecrets) List(opts v1.ListOptions) (result *v1alpha1.SSHSecretList, err error) { - result = &v1alpha1.SSHSecretList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested sSHSecrets. -func (c *sSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Patch applies the patch and returns the patched sSHSecret. -func (c *sSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.SSHSecret, err error) { - result = &v1alpha1.SSHSecret{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("sshsecrets"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_kops_client.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_kops_client.go index 7b468b4b07..52f23c30a7 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_kops_client.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_kops_client.go @@ -38,8 +38,8 @@ func (c *FakeKopsV1alpha2) InstanceGroups(namespace string) v1alpha2.InstanceGro return &FakeInstanceGroups{c, namespace} } -func (c *FakeKopsV1alpha2) SSHSecrets(namespace string) v1alpha2.SSHSecretInterface { - return &FakeSSHSecrets{c, namespace} +func (c *FakeKopsV1alpha2) SSHCredentials(namespace string) v1alpha2.SSHCredentialInterface { + return &FakeSSHCredentials{c, namespace} } // RESTClient returns a RESTClient that is used to communicate diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_sshcredential.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_sshcredential.go new file mode 100644 index 0000000000..41ec3d89f9 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_sshcredential.go @@ -0,0 +1,120 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2" +) + +// FakeSSHCredentials implements SSHCredentialInterface +type FakeSSHCredentials struct { + Fake *FakeKopsV1alpha2 + ns string +} + +var sshcredentialsResource = schema.GroupVersionResource{Group: "kops", Version: "v1alpha2", Resource: "sshcredentials"} + +var sshcredentialsKind = schema.GroupVersionKind{Group: "kops", Version: "v1alpha2", Kind: "SSHCredential"} + +func (c *FakeSSHCredentials) Create(sSHCredential *v1alpha2.SSHCredential) (result *v1alpha2.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha2.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHCredential), err +} + +func (c *FakeSSHCredentials) Update(sSHCredential *v1alpha2.SSHCredential) (result *v1alpha2.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sshcredentialsResource, c.ns, sSHCredential), &v1alpha2.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHCredential), err +} + +func (c *FakeSSHCredentials) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(sshcredentialsResource, c.ns, name), &v1alpha2.SSHCredential{}) + + return err +} + +func (c *FakeSSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sshcredentialsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha2.SSHCredentialList{}) + return err +} + +func (c *FakeSSHCredentials) Get(name string, options v1.GetOptions) (result *v1alpha2.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sshcredentialsResource, c.ns, name), &v1alpha2.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHCredential), err +} + +func (c *FakeSSHCredentials) List(opts v1.ListOptions) (result *v1alpha2.SSHCredentialList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sshcredentialsResource, sshcredentialsKind, c.ns, opts), &v1alpha2.SSHCredentialList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha2.SSHCredentialList{} + for _, item := range obj.(*v1alpha2.SSHCredentialList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested sSHCredentials. +func (c *FakeSSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sshcredentialsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched sSHCredential. +func (c *FakeSSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sshcredentialsResource, c.ns, name, data, subresources...), &v1alpha2.SSHCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.SSHCredential), err +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_sshsecret.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_sshsecret.go deleted file mode 100644 index 998ff2ad31..0000000000 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/fake/fake_sshsecret.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2017 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. -*/ - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2" -) - -// FakeSSHSecrets implements SSHSecretInterface -type FakeSSHSecrets struct { - Fake *FakeKopsV1alpha2 - ns string -} - -var sshsecretsResource = schema.GroupVersionResource{Group: "kops", Version: "v1alpha2", Resource: "sshsecrets"} - -var sshsecretsKind = schema.GroupVersionKind{Group: "kops", Version: "v1alpha2", Kind: "SSHSecret"} - -func (c *FakeSSHSecrets) Create(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha2.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.SSHSecret), err -} - -func (c *FakeSSHSecrets) Update(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(sshsecretsResource, c.ns, sSHSecret), &v1alpha2.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.SSHSecret), err -} - -func (c *FakeSSHSecrets) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(sshsecretsResource, c.ns, name), &v1alpha2.SSHSecret{}) - - return err -} - -func (c *FakeSSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(sshsecretsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha2.SSHSecretList{}) - return err -} - -func (c *FakeSSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha2.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(sshsecretsResource, c.ns, name), &v1alpha2.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.SSHSecret), err -} - -func (c *FakeSSHSecrets) List(opts v1.ListOptions) (result *v1alpha2.SSHSecretList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(sshsecretsResource, sshsecretsKind, c.ns, opts), &v1alpha2.SSHSecretList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.SSHSecretList{} - for _, item := range obj.(*v1alpha2.SSHSecretList).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 sSHSecrets. -func (c *FakeSSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(sshsecretsResource, c.ns, opts)) - -} - -// Patch applies the patch and returns the patched sSHSecret. -func (c *FakeSSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHSecret, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(sshsecretsResource, c.ns, name, data, subresources...), &v1alpha2.SSHSecret{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.SSHSecret), err -} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/generated_expansion.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/generated_expansion.go index dcd702a99b..95e346c38e 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/generated_expansion.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/generated_expansion.go @@ -22,4 +22,4 @@ type FederationExpansion interface{} type InstanceGroupExpansion interface{} -type SSHSecretExpansion interface{} +type SSHCredentialExpansion interface{} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/kops_client.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/kops_client.go index 87d2670ca2..4cf28db5f0 100644 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/kops_client.go +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/kops_client.go @@ -28,7 +28,7 @@ type KopsV1alpha2Interface interface { ClustersGetter FederationsGetter InstanceGroupsGetter - SSHSecretsGetter + SSHCredentialsGetter } // KopsV1alpha2Client is used to interact with features provided by the kops group. @@ -48,8 +48,8 @@ func (c *KopsV1alpha2Client) InstanceGroups(namespace string) InstanceGroupInter return newInstanceGroups(c, namespace) } -func (c *KopsV1alpha2Client) SSHSecrets(namespace string) SSHSecretInterface { - return newSSHSecrets(c, namespace) +func (c *KopsV1alpha2Client) SSHCredentials(namespace string) SSHCredentialInterface { + return newSSHCredentials(c, namespace) } // NewForConfig creates a new KopsV1alpha2Client for the given config. diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/sshcredential.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/sshcredential.go new file mode 100644 index 0000000000..621b7cdb50 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/sshcredential.go @@ -0,0 +1,155 @@ +/* +Copyright 2017 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. +*/ + +package v1alpha2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2" + scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme" +) + +// SSHCredentialsGetter has a method to return a SSHCredentialInterface. +// A group's client should implement this interface. +type SSHCredentialsGetter interface { + SSHCredentials(namespace string) SSHCredentialInterface +} + +// SSHCredentialInterface has methods to work with SSHCredential resources. +type SSHCredentialInterface interface { + Create(*v1alpha2.SSHCredential) (*v1alpha2.SSHCredential, error) + Update(*v1alpha2.SSHCredential) (*v1alpha2.SSHCredential, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha2.SSHCredential, error) + List(opts v1.ListOptions) (*v1alpha2.SSHCredentialList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHCredential, err error) + SSHCredentialExpansion +} + +// sSHCredentials implements SSHCredentialInterface +type sSHCredentials struct { + client rest.Interface + ns string +} + +// newSSHCredentials returns a SSHCredentials +func newSSHCredentials(c *KopsV1alpha2Client, namespace string) *sSHCredentials { + return &sSHCredentials{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a sSHCredential and creates it. Returns the server's representation of the sSHCredential, and an error, if there is any. +func (c *sSHCredentials) Create(sSHCredential *v1alpha2.SSHCredential) (result *v1alpha2.SSHCredential, err error) { + result = &v1alpha2.SSHCredential{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sshcredentials"). + Body(sSHCredential). + Do(). + Into(result) + return +} + +// Update takes the representation of a sSHCredential and updates it. Returns the server's representation of the sSHCredential, and an error, if there is any. +func (c *sSHCredentials) Update(sSHCredential *v1alpha2.SSHCredential) (result *v1alpha2.SSHCredential, err error) { + result = &v1alpha2.SSHCredential{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(sSHCredential.Name). + Body(sSHCredential). + Do(). + Into(result) + return +} + +// Delete takes name of the sSHCredential and deletes it. Returns an error if one occurs. +func (c *sSHCredentials) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *sSHCredentials) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the sSHCredential, and returns the corresponding sSHCredential object, and an error if there is any. +func (c *sSHCredentials) Get(name string, options v1.GetOptions) (result *v1alpha2.SSHCredential, err error) { + result = &v1alpha2.SSHCredential{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SSHCredentials that match those selectors. +func (c *sSHCredentials) List(opts v1.ListOptions) (result *v1alpha2.SSHCredentialList, err error) { + result = &v1alpha2.SSHCredentialList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested sSHCredentials. +func (c *sSHCredentials) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("sshcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched sSHCredential. +func (c *sSHCredentials) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHCredential, err error) { + result = &v1alpha2.SSHCredential{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sshcredentials"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/sshsecret.go b/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/sshsecret.go deleted file mode 100644 index caee5796a0..0000000000 --- a/pkg/client/clientset_generated/internalclientset/typed/kops/v1alpha2/sshsecret.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2017 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. -*/ - -package v1alpha2 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha2 "k8s.io/kops/pkg/apis/kops/v1alpha2" - scheme "k8s.io/kops/pkg/client/clientset_generated/internalclientset/scheme" -) - -// SSHSecretsGetter has a method to return a SSHSecretInterface. -// A group's client should implement this interface. -type SSHSecretsGetter interface { - SSHSecrets(namespace string) SSHSecretInterface -} - -// SSHSecretInterface has methods to work with SSHSecret resources. -type SSHSecretInterface interface { - Create(*v1alpha2.SSHSecret) (*v1alpha2.SSHSecret, error) - Update(*v1alpha2.SSHSecret) (*v1alpha2.SSHSecret, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha2.SSHSecret, error) - List(opts v1.ListOptions) (*v1alpha2.SSHSecretList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHSecret, err error) - SSHSecretExpansion -} - -// sSHSecrets implements SSHSecretInterface -type sSHSecrets struct { - client rest.Interface - ns string -} - -// newSSHSecrets returns a SSHSecrets -func newSSHSecrets(c *KopsV1alpha2Client, namespace string) *sSHSecrets { - return &sSHSecrets{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Create takes the representation of a sSHSecret and creates it. Returns the server's representation of the sSHSecret, and an error, if there is any. -func (c *sSHSecrets) Create(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { - result = &v1alpha2.SSHSecret{} - err = c.client.Post(). - Namespace(c.ns). - Resource("sshsecrets"). - Body(sSHSecret). - Do(). - Into(result) - return -} - -// Update takes the representation of a sSHSecret and updates it. Returns the server's representation of the sSHSecret, and an error, if there is any. -func (c *sSHSecrets) Update(sSHSecret *v1alpha2.SSHSecret) (result *v1alpha2.SSHSecret, err error) { - result = &v1alpha2.SSHSecret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(sSHSecret.Name). - Body(sSHSecret). - Do(). - Into(result) - return -} - -// Delete takes name of the sSHSecret and deletes it. Returns an error if one occurs. -func (c *sSHSecrets) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *sSHSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Get takes name of the sSHSecret, and returns the corresponding sSHSecret object, and an error if there is any. -func (c *sSHSecrets) Get(name string, options v1.GetOptions) (result *v1alpha2.SSHSecret, err error) { - result = &v1alpha2.SSHSecret{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SSHSecrets that match those selectors. -func (c *sSHSecrets) List(opts v1.ListOptions) (result *v1alpha2.SSHSecretList, err error) { - result = &v1alpha2.SSHSecretList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested sSHSecrets. -func (c *sSHSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("sshsecrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Patch applies the patch and returns the patched sSHSecret. -func (c *sSHSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.SSHSecret, err error) { - result = &v1alpha2.SSHSecret{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("sshsecrets"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} From 66d4c4ed675a9c67d07fd5acf776b103bb82998d Mon Sep 17 00:00:00 2001 From: Alexander Brandstedt Date: Wed, 23 Aug 2017 12:38:27 +0200 Subject: [PATCH 5/5] change PulicKey to lower p as in publicKey in json --- docs/secrets.md | 2 +- pkg/apis/kops/sshcredential.go | 2 +- pkg/apis/kops/v1alpha1/sshcredential.go | 2 +- pkg/apis/kops/v1alpha2/sshcredential.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/secrets.md b/docs/secrets.md index 2c5140611c..d526d5b9fa 100644 --- a/docs/secrets.md +++ b/docs/secrets.md @@ -33,5 +33,5 @@ metadata: labels: kops.k8s.io/cluster: dev.k8s.example.com spec: - PublicKey: "ssh-rsa AAAAB3NzaC1 dev@devbox" + publicKey: "ssh-rsa AAAAB3NzaC1 dev@devbox" ``` diff --git a/pkg/apis/kops/sshcredential.go b/pkg/apis/kops/sshcredential.go index f397a5e447..a3bc3fff9e 100644 --- a/pkg/apis/kops/sshcredential.go +++ b/pkg/apis/kops/sshcredential.go @@ -31,7 +31,7 @@ type SSHCredential struct { } type SSHCredentialSpec struct { - PublicKey string `json:"PublicKey,omitempty"` + PublicKey string `json:"publicKey,omitempty"` } type SSHCredentialList struct { diff --git a/pkg/apis/kops/v1alpha1/sshcredential.go b/pkg/apis/kops/v1alpha1/sshcredential.go index 2d02486883..b95f1c61a8 100644 --- a/pkg/apis/kops/v1alpha1/sshcredential.go +++ b/pkg/apis/kops/v1alpha1/sshcredential.go @@ -31,7 +31,7 @@ type SSHCredential struct { } type SSHCredentialSpec struct { - PublicKey string `json:"PublicKey,omitempty"` + PublicKey string `json:"publicKey,omitempty"` } type SSHCredentialList struct { diff --git a/pkg/apis/kops/v1alpha2/sshcredential.go b/pkg/apis/kops/v1alpha2/sshcredential.go index 61e7b22198..dd5a4c1ab5 100644 --- a/pkg/apis/kops/v1alpha2/sshcredential.go +++ b/pkg/apis/kops/v1alpha2/sshcredential.go @@ -31,7 +31,7 @@ type SSHCredential struct { } type SSHCredentialSpec struct { - PublicKey string `json:"PublicKey,omitempty"` + PublicKey string `json:"publicKey,omitempty"` } type SSHCredentialList struct {