mirror of https://github.com/kubernetes/kops.git
Merge pull request #14897 from johngmyers/cluster-ssh
Include SSHCredentials in create cluster dryrun output
This commit is contained in:
commit
b47289178d
|
|
@ -33,6 +33,7 @@ import (
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
"go.uber.org/multierr"
|
"go.uber.org/multierr"
|
||||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
|
|
@ -700,6 +701,20 @@ func RunCreateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Cr
|
||||||
obj = append(obj, group)
|
obj = append(obj, group)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for name, key := range c.SSHPublicKeys {
|
||||||
|
obj = append(obj, &api.SSHCredential{
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Name: name,
|
||||||
|
Labels: map[string]string{
|
||||||
|
api.LabelClusterName: cluster.Name,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Spec: api.SSHCredentialSpec{
|
||||||
|
PublicKey: strings.TrimSpace(string(key)),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
for _, o := range addons {
|
for _, o := range addons {
|
||||||
obj = append(obj, o.ToUnstructured())
|
obj = append(obj, o.ToUnstructured())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue