Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 8174037

Browse files
committed
Remove deprecated key_file and bastion_key_file
These were deprecated in the 0.6.x series. Their functionality was broken in a recent release which whould have removed them as well.
1 parent 77d76a6 commit 8174037

2 files changed

Lines changed: 1 addition & 38 deletions

File tree

communicator/ssh/provisioner.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const (
3232
)
3333

3434
// connectionInfo is decoded from the ConnInfo of the resource. These are the
35-
// only keys we look at. If a KeyFile is given, that is used instead
35+
// only keys we look at. If a PrivateKey is given, that is used instead
3636
// of a password.
3737
type connectionInfo struct {
3838
User string
@@ -50,10 +50,6 @@ type connectionInfo struct {
5050
BastionPrivateKey string `mapstructure:"bastion_private_key"`
5151
BastionHost string `mapstructure:"bastion_host"`
5252
BastionPort int `mapstructure:"bastion_port"`
53-
54-
// Deprecated
55-
KeyFile string `mapstructure:"key_file"`
56-
BastionKeyFile string `mapstructure:"bastion_key_file"`
5753
}
5854

5955
// parseConnectionInfo is used to convert the ConnInfo of the InstanceState into
@@ -101,15 +97,6 @@ func parseConnectionInfo(s *terraform.InstanceState) (*connectionInfo, error) {
10197
connInfo.TimeoutVal = DefaultTimeout
10298
}
10399

104-
// Load deprecated fields; we can handle either path or contents in
105-
// underlying implementation.
106-
if connInfo.PrivateKey == "" && connInfo.KeyFile != "" {
107-
connInfo.PrivateKey = connInfo.KeyFile
108-
}
109-
if connInfo.BastionPrivateKey == "" && connInfo.BastionKeyFile != "" {
110-
connInfo.BastionPrivateKey = connInfo.BastionKeyFile
111-
}
112-
113100
// Default all bastion config attrs to their non-bastion counterparts
114101
if connInfo.BastionHost != "" {
115102
// Format the bastion host if needed.

communicator/ssh/provisioner_test.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -127,27 +127,3 @@ func TestProvisioner_connInfoHostname(t *testing.T) {
127127
t.Fatalf("bad %v", conf)
128128
}
129129
}
130-
131-
func TestProvisioner_connInfoLegacy(t *testing.T) {
132-
r := &terraform.InstanceState{
133-
Ephemeral: terraform.EphemeralState{
134-
ConnInfo: map[string]string{
135-
"type": "ssh",
136-
"key_file": "/my/key/file.pem",
137-
"bastion_host": "127.0.1.1",
138-
},
139-
},
140-
}
141-
142-
conf, err := parseConnectionInfo(r)
143-
if err != nil {
144-
t.Fatalf("err: %v", err)
145-
}
146-
147-
if conf.PrivateKey != "/my/key/file.pem" {
148-
t.Fatalf("bad: %v", conf)
149-
}
150-
if conf.BastionPrivateKey != "/my/key/file.pem" {
151-
t.Fatalf("bad: %v", conf)
152-
}
153-
}

0 commit comments

Comments
 (0)