mirror of https://github.com/kubernetes/kops.git
Merge pull request #14168 from hakman/ssh-key_trim_space
Trim space around SSH public key
This commit is contained in:
commit
50e61eeeef
|
|
@ -1403,7 +1403,6 @@ func (i *integrationTest) runTestTerraformGCE(t *testing.T) {
|
||||||
|
|
||||||
expectedFilenames = append(expectedFilenames,
|
expectedFilenames = append(expectedFilenames,
|
||||||
"google_compute_instance_template_nodes-"+gce.SafeClusterName(i.clusterName)+"_metadata_startup-script",
|
"google_compute_instance_template_nodes-"+gce.SafeClusterName(i.clusterName)+"_metadata_startup-script",
|
||||||
"google_compute_instance_template_nodes-"+gce.SafeClusterName(i.clusterName)+"_metadata_ssh-keys",
|
|
||||||
"aws_s3_object_cluster-completed.spec_content",
|
"aws_s3_object_cluster-completed.spec_content",
|
||||||
"aws_s3_object_etcd-cluster-spec-events_content",
|
"aws_s3_object_etcd-cluster-spec-events_content",
|
||||||
"aws_s3_object_etcd-cluster-spec-main_content",
|
"aws_s3_object_etcd-cluster-spec-main_content",
|
||||||
|
|
@ -1426,7 +1425,6 @@ func (i *integrationTest) runTestTerraformGCE(t *testing.T) {
|
||||||
expectedFilenames = append(expectedFilenames, "aws_s3_object_manifests-etcdmanager-main-master-"+zone+"_content")
|
expectedFilenames = append(expectedFilenames, "aws_s3_object_manifests-etcdmanager-main-master-"+zone+"_content")
|
||||||
expectedFilenames = append(expectedFilenames, "aws_s3_object_nodeupconfig-master-"+zone+"_content")
|
expectedFilenames = append(expectedFilenames, "aws_s3_object_nodeupconfig-master-"+zone+"_content")
|
||||||
expectedFilenames = append(expectedFilenames, prefix+"startup-script")
|
expectedFilenames = append(expectedFilenames, prefix+"startup-script")
|
||||||
expectedFilenames = append(expectedFilenames, prefix+"ssh-keys")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i.runTest(t, h, expectedFilenames, "", "", nil)
|
i.runTest(t, h, expectedFilenames, "", "", nil)
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -572,7 +572,7 @@ resource "google_compute_instance_template" "master-us-test1-a-ha-gce-example-co
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "ha-gce.example.com"
|
"cluster-name" = "ha-gce.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "master-us-test1-a"
|
"kops-k8s-io-instance-group-name" = "master-us-test1-a"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-ha-gce-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-ha-gce-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-ha-gce-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "master-us-test1-a-ha-gce--ke5ah6-"
|
name_prefix = "master-us-test1-a-ha-gce--ke5ah6-"
|
||||||
|
|
@ -619,7 +619,7 @@ resource "google_compute_instance_template" "master-us-test1-b-ha-gce-example-co
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "ha-gce.example.com"
|
"cluster-name" = "ha-gce.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "master-us-test1-b"
|
"kops-k8s-io-instance-group-name" = "master-us-test1-b"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_master-us-test1-b-ha-gce-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-b-ha-gce-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-b-ha-gce-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "master-us-test1-b-ha-gce--c8u7qq-"
|
name_prefix = "master-us-test1-b-ha-gce--c8u7qq-"
|
||||||
|
|
@ -666,7 +666,7 @@ resource "google_compute_instance_template" "master-us-test1-c-ha-gce-example-co
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "ha-gce.example.com"
|
"cluster-name" = "ha-gce.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "master-us-test1-c"
|
"kops-k8s-io-instance-group-name" = "master-us-test1-c"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_master-us-test1-c-ha-gce-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-c-ha-gce-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-c-ha-gce-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "master-us-test1-c-ha-gce--3unp7l-"
|
name_prefix = "master-us-test1-c-ha-gce--3unp7l-"
|
||||||
|
|
@ -713,7 +713,7 @@ resource "google_compute_instance_template" "nodes-ha-gce-example-com" {
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "ha-gce.example.com"
|
"cluster-name" = "ha-gce.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "nodes"
|
"kops-k8s-io-instance-group-name" = "nodes"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_nodes-ha-gce-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_nodes-ha-gce-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_nodes-ha-gce-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "nodes-ha-gce-example-com-"
|
name_prefix = "nodes-ha-gce-example-com-"
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -444,7 +444,7 @@ resource "google_compute_instance_template" "master-us-test1-a-minimal-gce-examp
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "minimal-gce.example.com"
|
"cluster-name" = "minimal-gce.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "master-us-test1-a"
|
"kops-k8s-io-instance-group-name" = "master-us-test1-a"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "master-us-test1-a-minimal-do16cp-"
|
name_prefix = "master-us-test1-a-minimal-do16cp-"
|
||||||
|
|
@ -491,7 +491,7 @@ resource "google_compute_instance_template" "nodes-minimal-gce-example-com" {
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "minimal-gce.example.com"
|
"cluster-name" = "minimal-gce.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "nodes"
|
"kops-k8s-io-instance-group-name" = "nodes"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "nodes-minimal-gce-example-com-"
|
name_prefix = "nodes-minimal-gce-example-com-"
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -439,7 +439,7 @@ resource "google_compute_instance_template" "master-us-test1-a-minimal-gce-ilb-e
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "minimal-gce-ilb.example.com"
|
"cluster-name" = "minimal-gce-ilb.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "master-us-test1-a"
|
"kops-k8s-io-instance-group-name" = "master-us-test1-a"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-ilb-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-ilb-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-ilb-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "master-us-test1-a-minimal-k0i8ah-"
|
name_prefix = "master-us-test1-a-minimal-k0i8ah-"
|
||||||
|
|
@ -484,7 +484,7 @@ resource "google_compute_instance_template" "nodes-minimal-gce-ilb-example-com"
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "minimal-gce-ilb.example.com"
|
"cluster-name" = "minimal-gce-ilb.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "nodes"
|
"kops-k8s-io-instance-group-name" = "nodes"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-ilb-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-ilb-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-ilb-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "nodes-minimal-gce-ilb-exa-mk47iu-"
|
name_prefix = "nodes-minimal-gce-ilb-exa-mk47iu-"
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -447,7 +447,7 @@ resource "google_compute_instance_template" "master-us-test1-a-minimal-gce-with-
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "minimal-gce-with-a-very-very-very-very-very-long-name.example.com"
|
"cluster-name" = "minimal-gce-with-a-very-very-very-very-very-long-name.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "master-us-test1-a"
|
"kops-k8s-io-instance-group-name" = "master-us-test1-a"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-with-a-very-very-very-very-very-long-name-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-with-a-very-very-very-very-very-long-name-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-with-a-very-very-very-very-very-long-name-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "master-us-test1-a-minimal-ivl9ll-"
|
name_prefix = "master-us-test1-a-minimal-ivl9ll-"
|
||||||
|
|
@ -492,7 +492,7 @@ resource "google_compute_instance_template" "nodes-minimal-gce-with-a-very-very-
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "minimal-gce-with-a-very-very-very-very-very-long-name.example.com"
|
"cluster-name" = "minimal-gce-with-a-very-very-very-very-very-long-name.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "nodes"
|
"kops-k8s-io-instance-group-name" = "nodes"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-with-a-very-very-very-very-very-long-name-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-with-a-very-very-very-very-very-long-name-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-with-a-very-very-very-very-very-long-name-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "nodes-minimal-gce-with-a--k0ql96-"
|
name_prefix = "nodes-minimal-gce-with-a--k0ql96-"
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -444,7 +444,7 @@ resource "google_compute_instance_template" "master-us-test1-a-minimal-gce-with-
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "minimal-gce-with-a-very-very-very-very-very-long-name.example.com"
|
"cluster-name" = "minimal-gce-with-a-very-very-very-very-very-long-name.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "master-us-test1-a"
|
"kops-k8s-io-instance-group-name" = "master-us-test1-a"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-with-a-very-very-very-very-very-long-name-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-with-a-very-very-very-very-very-long-name-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-with-a-very-very-very-very-very-long-name-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "master-us-test1-a-minimal-ivl9ll-"
|
name_prefix = "master-us-test1-a-minimal-ivl9ll-"
|
||||||
|
|
@ -491,7 +491,7 @@ resource "google_compute_instance_template" "nodes-minimal-gce-with-a-very-very-
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "minimal-gce-with-a-very-very-very-very-very-long-name.example.com"
|
"cluster-name" = "minimal-gce-with-a-very-very-very-very-very-long-name.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "nodes"
|
"kops-k8s-io-instance-group-name" = "nodes"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-with-a-very-very-very-very-very-long-name-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-with-a-very-very-very-very-very-long-name-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-with-a-very-very-very-very-very-long-name-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "nodes-minimal-gce-with-a--k0ql96-"
|
name_prefix = "nodes-minimal-gce-with-a--k0ql96-"
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ==
|
|
||||||
|
|
@ -436,7 +436,7 @@ resource "google_compute_instance_template" "master-us-test1-a-minimal-gce-priva
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "minimal-gce-private.example.com"
|
"cluster-name" = "minimal-gce-private.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "master-us-test1-a"
|
"kops-k8s-io-instance-group-name" = "master-us-test1-a"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-private-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-private-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_master-us-test1-a-minimal-gce-private-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "master-us-test1-a-minimal-asf34c-"
|
name_prefix = "master-us-test1-a-minimal-asf34c-"
|
||||||
|
|
@ -481,7 +481,7 @@ resource "google_compute_instance_template" "nodes-minimal-gce-private-example-c
|
||||||
metadata = {
|
metadata = {
|
||||||
"cluster-name" = "minimal-gce-private.example.com"
|
"cluster-name" = "minimal-gce-private.example.com"
|
||||||
"kops-k8s-io-instance-group-name" = "nodes"
|
"kops-k8s-io-instance-group-name" = "nodes"
|
||||||
"ssh-keys" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-private-example-com_metadata_ssh-keys")
|
"ssh-keys" = "admin: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCtWu40XQo8dczLsCq0OWV+hxm9uV3WxeH9Kgh4sMzQxNtoU1pvW0XdjpkBesRKGoolfWeCLXWxpyQb1IaiMkKoz7MdhQ/6UKjMjP66aFWWp3pwD0uj0HuJ7tq4gKHKRYGTaZIRWpzUiANBrjugVgA+Sd7E/mYwc/DMXkIyRZbvhQ=="
|
||||||
"startup-script" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-private-example-com_metadata_startup-script")
|
"startup-script" = file("${path.module}/data/google_compute_instance_template_nodes-minimal-gce-private-example-com_metadata_startup-script")
|
||||||
}
|
}
|
||||||
name_prefix = "nodes-minimal-gce-private-4aopo5-"
|
name_prefix = "nodes-minimal-gce-private-4aopo5-"
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
|
|
@ -290,7 +291,7 @@ func (c *ClientsetCAStore) AddSSHPublicKey(pubkey []byte) error {
|
||||||
return fmt.Errorf("error parsing SSH public key: %v", err)
|
return fmt.Errorf("error parsing SSH public key: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return c.addSSHCredential(ctx, string(pubkey))
|
return c.addSSHCredential(ctx, strings.TrimSpace(string(pubkey)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// FindSSHPublicKeys implements CAStore::FindSSHPublicKeys
|
// FindSSHPublicKeys implements CAStore::FindSSHPublicKeys
|
||||||
|
|
@ -304,6 +305,7 @@ func (c *ClientsetCAStore) FindSSHPublicKeys() ([]*kops.SSHCredential, error) {
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("error reading SSHCredential: %v", err)
|
return nil, fmt.Errorf("error reading SSHCredential: %v", err)
|
||||||
}
|
}
|
||||||
|
o.Spec.PublicKey = strings.TrimSpace(o.Spec.PublicKey)
|
||||||
|
|
||||||
items := []*kops.SSHCredential{o}
|
items := []*kops.SSHCredential{o}
|
||||||
return items, nil
|
return items, nil
|
||||||
|
|
|
||||||
|
|
@ -394,7 +394,7 @@ func (c *VFSCAStore) findPrivateKeyset(id string) (*Keyset, error) {
|
||||||
|
|
||||||
// AddSSHPublicKey stores an SSH public key
|
// AddSSHPublicKey stores an SSH public key
|
||||||
func (c *VFSCAStore) AddSSHPublicKey(pubkey []byte) error {
|
func (c *VFSCAStore) AddSSHPublicKey(pubkey []byte) error {
|
||||||
id, err := sshcredentials.Fingerprint(string(pubkey))
|
id, err := sshcredentials.Fingerprint(strings.TrimSpace(string(pubkey)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error fingerprinting SSH public key: %v", err)
|
return fmt.Errorf("error fingerprinting SSH public key: %v", err)
|
||||||
}
|
}
|
||||||
|
|
@ -440,7 +440,7 @@ func (c *VFSCAStore) FindSSHPublicKeys() ([]*kops.SSHCredential, error) {
|
||||||
|
|
||||||
item := &kops.SSHCredential{}
|
item := &kops.SSHCredential{}
|
||||||
item.Name = "admin"
|
item.Name = "admin"
|
||||||
item.Spec.PublicKey = string(data)
|
item.Spec.PublicKey = strings.TrimSpace(string(data))
|
||||||
items = append(items, item)
|
items = append(items, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue