mirror of https://github.com/kubernetes/kops.git
				
				
				
			Include SSHCredentials in create cluster dryrun output
This commit is contained in:
		
							parent
							
								
									4b66b5b72c
								
							
						
					
					
						commit
						309c893ca1
					
				|  | @ -33,6 +33,7 @@ import ( | |||
| 	"github.com/spf13/pflag" | ||||
| 	"go.uber.org/multierr" | ||||
| 	apierrors "k8s.io/apimachinery/pkg/api/errors" | ||||
| 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||
| 	"k8s.io/apimachinery/pkg/runtime" | ||||
| 	"k8s.io/apimachinery/pkg/util/sets" | ||||
| 	"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) | ||||
| 		} | ||||
| 
 | ||||
| 		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 { | ||||
| 			obj = append(obj, o.ToUnstructured()) | ||||
| 		} | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue