@@ -41,6 +41,12 @@ def validate_credentials_cmd(self) -> str:
4141 :return: command to be executed
4242 """
4343 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'
4450
4551 def save_kubernetes_cluster_cmd (self , cluster_name : str ) -> str :
4652 """
@@ -113,8 +119,8 @@ def new_stack_config(self, env_config, defaults: Union[Dict[Hashable, Any], list
113119 config = super ().new_stack_config (env_config , defaults )
114120
115121 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 "
118124 "DIGITALOCEAN_TOKEN): " )
119125
120126 token = DigitalOceanProvider .token (stack_config = {'config' : config }, env_config = env_config )
@@ -176,7 +182,7 @@ def validate_stack_config(self,
176182 super ().validate_stack_config (stack_config = stack_config , env_config = env_config )
177183 token = DigitalOceanProvider .token (stack_config = stack_config , env_config = env_config )
178184 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 ())
180186 if err :
181187 print (f'Digital Ocean authentication error: { err } ' , file = sys .stderr )
182188 sys .exit (3 )
@@ -217,16 +223,16 @@ def token(stack_config: Union[Mapping[str, Any], MutableMapping[str, auto._confi
217223 return env_config ['DIGITALOCEAN_TOKEN' ]
218224
219225 # 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' ]
222228
223229 # 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
226232
227233 # Otherwise
228234 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 ' \
230236 'or the environment variable DIGITALOCEAN_TOKEN'
231237 raise InvalidConfigurationException (msg )
232238
0 commit comments