@@ -19,19 +19,22 @@ import (
19
19
"io"
20
20
"io/ioutil"
21
21
22
+ "github.com/golang/glog"
22
23
"gopkg.in/yaml.v2"
23
24
)
24
25
25
26
// AuthConfig holds the configuration required for communicating with the OCI
26
27
// API.
27
28
type AuthConfig struct {
28
- Region string `yaml:"region"`
29
- TenancyOCID string `yaml:"tenancy"`
30
- CompartmentOCID string `yaml:"compartment"`
31
- UserOCID string `yaml:"user"`
32
- PrivateKey string `yaml:"key"`
33
- Fingerprint string `yaml:"fingerprint"`
34
- PrivateKeyPassphrase string `yaml:"key_passphrase"` // TODO(apryde): the yaml should be keyPassphrase
29
+ Region string `yaml:"region"`
30
+ TenancyOCID string `yaml:"tenancy"`
31
+ CompartmentOCID string `yaml:"compartment"`
32
+ UserOCID string `yaml:"user"`
33
+ PrivateKey string `yaml:"key"`
34
+ Fingerprint string `yaml:"fingerprint"`
35
+ // PrivateKeyPassphrase is DEPRECIATED in favour of Passphrase.
36
+ PrivateKeyPassphrase string `yaml:"key_passphrase"`
37
+ Passphrase string `yaml:"passphrase"`
35
38
}
36
39
37
40
// LoadBalancerConfig holds the configuration options for OCI load balancers.
@@ -60,6 +63,14 @@ type Config struct {
60
63
VCNID string `yaml:"vcn"`
61
64
}
62
65
66
+ // Complete the config applying defaults / overrides.
67
+ func (c * Config ) Complete () {
68
+ if c .Auth .Passphrase == "" && c .Auth .PrivateKeyPassphrase != "" {
69
+ glog .Warning ("cloud-provider config: \" auth.key_passphrase\" is DEPRECIATED and will be removed in a later release. Please set \" auth.passphrase\" ." )
70
+ c .Auth .Passphrase = c .Auth .PrivateKeyPassphrase
71
+ }
72
+ }
73
+
63
74
// Validate validates the OCI cloud-provider config.
64
75
func (c * Config ) Validate () error {
65
76
return ValidateConfig (c ).ToAggregate ()
0 commit comments