@@ -41,6 +41,12 @@ def validate_credentials_cmd(self) -> str:
41
41
:return: command to be executed
42
42
"""
43
43
return f'{ self .base_cmd ()} account get'
44
+ def auth_credentials_cmd (self ) -> str :
45
+ """
46
+ Runs the doctl auth command for helm usage later in MARA
47
+ :return: command to be executed
48
+ """
49
+ return f'{ self .base_cmd ()} auth init'
44
50
45
51
def save_kubernetes_cluster_cmd (self , cluster_name : str ) -> str :
46
52
"""
@@ -113,8 +119,8 @@ def new_stack_config(self, env_config, defaults: Union[Dict[Hashable, Any], list
113
119
config = super ().new_stack_config (env_config , defaults )
114
120
115
121
if 'DIGITALOCEAN_TOKEN' not in env_config :
116
- config ['docean :token' ] = input ("Digital Ocean API token (this is stored in plain-text - "
117
- "alternatively this can be specified as the environment variable "
122
+ config ['digitalocean :token' ] = input ("Digital Ocean API token (this is stored in plain-text - "
123
+ "YOU WILL ALSO NEED TO SPECIFY IT IN THE ENVIRONMENT VARIABLE "
118
124
"DIGITALOCEAN_TOKEN): " )
119
125
120
126
token = DigitalOceanProvider .token (stack_config = {'config' : config }, env_config = env_config )
@@ -176,7 +182,7 @@ def validate_stack_config(self,
176
182
super ().validate_stack_config (stack_config = stack_config , env_config = env_config )
177
183
token = DigitalOceanProvider .token (stack_config = stack_config , env_config = env_config )
178
184
do_cli = DoctlCli (access_token = token )
179
- _ , err = external_process .run (cmd = do_cli .validate_credentials_cmd ())
185
+ _ , err = external_process .run (cmd = do_cli .auth_credentials_cmd ())
180
186
if err :
181
187
print (f'Digital Ocean authentication error: { err } ' , file = sys .stderr )
182
188
sys .exit (3 )
@@ -217,16 +223,16 @@ def token(stack_config: Union[Mapping[str, Any], MutableMapping[str, auto._confi
217
223
return env_config ['DIGITALOCEAN_TOKEN' ]
218
224
219
225
# We were given a reference to a StackConfigParser object
220
- if 'config' in stack_config and 'docean :token' in stack_config ['config' ]:
221
- return stack_config ['config' ]['docean :token' ]
226
+ if 'config' in stack_config and 'digitalocean :token' in stack_config ['config' ]:
227
+ return stack_config ['config' ]['digitalocean :token' ]
222
228
223
229
# We were given a reference to a Pulumi Stack configuration
224
- if 'docean :token' in stack_config :
225
- return stack_config ['docean :token' ].value
230
+ if 'digitalocean :token' in stack_config :
231
+ return stack_config ['digitalocean :token' ].value
226
232
227
233
# Otherwise
228
234
msg = 'When using the Digital Ocean provider, an API token must be specified - ' \
229
- 'this token can be specified with the Pulumi config parameter docean :token ' \
235
+ 'this token can be specified with the Pulumi config parameter digitalocean :token ' \
230
236
'or the environment variable DIGITALOCEAN_TOKEN'
231
237
raise InvalidConfigurationException (msg )
232
238
0 commit comments