Skip to content

Commit 8751193

Browse files
committed
Depreciate auth.key_passphrase
Fixes: #142
1 parent eb16afb commit 8751193

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

manifests/cloud-provider-example.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ auth:
77
<snip>
88
-----END RSA PRIVATE KEY-----
99
# Omit if there is not a password for the key
10-
key_passphrase: supersecretpassword
10+
passphrase: supersecretpassword
1111
fingerprint: 8c:bf:17:7b:5f:e0:7d:13:75:11:d6:39:0d:e2:84:74
1212

1313
# compartment configures Compartment within which the cluster resides.

pkg/oci/ccm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func NewCloudProvider(config *Config) (cloudprovider.Interface, error) {
7373
config.Auth.Region,
7474
config.Auth.Fingerprint,
7575
config.Auth.PrivateKey,
76-
&config.Auth.PrivateKeyPassphrase,
76+
&config.Auth.Passphrase,
7777
))
7878
if err != nil {
7979
return nil, err

pkg/oci/config.go

+11-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ type AuthConfig struct {
3030
TenancyID string `yaml:"tenancy"`
3131
// CompartmentID is DEPRECIATED and should be set on the top level Config
3232
// struct.
33-
CompartmentID string `yaml:"compartment"`
34-
UserID string `yaml:"user"`
35-
PrivateKey string `yaml:"key"`
36-
Fingerprint string `yaml:"fingerprint"`
37-
PrivateKeyPassphrase string `yaml:"key_passphrase"` // TODO(apryde): the yaml should be keyPassphrase
33+
CompartmentID string `yaml:"compartment"`
34+
UserID string `yaml:"user"`
35+
PrivateKey string `yaml:"key"`
36+
Fingerprint string `yaml:"fingerprint"`
37+
// PrivateKeyPassphrase is DEPRECIATED in favour of Passphrase.
38+
PrivateKeyPassphrase string `yaml:"key_passphrase"`
39+
Passphrase string `yaml:"passphrase"`
3840
}
3941

4042
// LoadBalancerConfig holds the configuration options for OCI load balancers.
@@ -72,6 +74,10 @@ func (c *Config) Complete() {
7274
glog.Warning("cloud-provider config: \"auth.compartment\" is DEPRECIATED and will be removed in a later release. Please set \"compartment\".")
7375
c.CompartmentID = c.Auth.CompartmentID
7476
}
77+
if c.Auth.Passphrase == "" && c.Auth.PrivateKeyPassphrase != "" {
78+
glog.Warning("cloud-provider config: \"auth.key_passphrase\" is DEPRECIATED and will be removed in a later release. Please set \"auth.passphrase\".")
79+
c.Auth.Passphrase = c.Auth.PrivateKeyPassphrase
80+
}
7581
}
7682

7783
// Validate validates the OCI cloud-provider config.

0 commit comments

Comments
 (0)