Skip to content

Commit

Permalink
installconfig: Replace KeyPairName with SSHKey.
Browse files Browse the repository at this point in the history
As now we will just accept the SSHKey from the prompt instead of
a KeyPairName.
  • Loading branch information
Yifan Gu committed Aug 27, 2018
1 parent 989fd74 commit b7fb682
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pkg/asset/installconfig/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ func (a *installConfig) Generate(dependencies map[asset.Asset]*asset.State) (*as
switch platform {
case AWSPlatformType:
region := string(platformState.Contents[1].Data)
keyPairName := string(platformState.Contents[2].Data)
sshKey := string(platformState.Contents[2].Data)
installConfig.AWS = &types.AWSPlatform{
Region: region,
KeyPairName: keyPairName,
Region: region,
SSHKey: sshKey,
}
case LibvirtPlatformType:
uri := string(platformState.Contents[1].Data)
Expand Down
5 changes: 4 additions & 1 deletion pkg/asset/installconfig/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,17 @@ func (a *Platform) awsPlatform() (*asset.State, error) {
return assetStateForStringContents(
AWSPlatformType,
asset.QueryUser(a.InputReader, "Region:"),
asset.QueryUser(a.InputReader, "Key Pair Name:"),
// TODO(yifan): Read the default location for ssh-key.
asset.QueryUser(a.InputReader, "SSH Key:"),
), nil
}

func (a *Platform) libvirtPlatform() (*asset.State, error) {
return assetStateForStringContents(
LibvirtPlatformType,
// TODO(yifan): Set the default URI.
asset.QueryUser(a.InputReader, "URI:"),
// TODO(yifan): Read the default location for ssh-key.
asset.QueryUser(a.InputReader, "SSH Key:"),
), nil
}
Expand Down
5 changes: 2 additions & 3 deletions pkg/types/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ type AWSPlatform struct {
// Region specifies the AWS region where the cluster will be created.
Region string `json:"region"`

// KeyPairName is the name of the AWS key pair to use for SSH access to EC2
// instances in this cluster.
KeyPairName string `json:"keyPairName"`
// SSHKey to use for the access to EC2 instances.
SSHKey string `json:"sshKey"`

// VPCID specifies the vpc to associate with the cluster.
// If empty, new vpc will be created.
Expand Down

1 comment on commit b7fb682

@wking
Copy link
Member

@wking wking commented on b7fb682 Aug 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be inserted in the depedency doc? We should probably update here as well. Also, since #127 this is no longer AWS-specific, and in this commit you still have it in AWSPlatform.

Please sign in to comment.