@@ -113,7 +113,7 @@ def new_stack_config(self, env_config, defaults: Union[Dict[Hashable, Any], list
113
113
config = super ().new_stack_config (env_config , defaults )
114
114
115
115
if 'DIGITALOCEAN_TOKEN' not in env_config :
116
- config ['digitalocean :token' ] = input ("Digital Ocean API token (this is stored in plain-text - "
116
+ config ['docean :token' ] = input ("Digital Ocean API token (this is stored in plain-text - "
117
117
"alternatively this can be specified as the environment variable "
118
118
"DIGITALOCEAN_TOKEN): " )
119
119
@@ -131,42 +131,42 @@ def new_stack_config(self, env_config, defaults: Union[Dict[Hashable, Any], list
131
131
print ('Supported Kubernetes versions:' )
132
132
for slug in k8s_version_slugs :
133
133
print (f' { slug } ' )
134
- default_version = defaults ['digitalocean :k8s_version' ] or k8s_version_slugs [0 ]
135
- config ['digitalocean :k8s_version' ] = input (f'Kubernetes version [{ default_version } ]: ' ).strip () or default_version
136
- print (f"Kubernetes version: { config ['digitalocean :k8s_version' ]} " )
134
+ default_version = defaults ['docean :k8s_version' ] or k8s_version_slugs [0 ]
135
+ config ['docean :k8s_version' ] = input (f'Kubernetes version [{ default_version } ]: ' ).strip () or default_version
136
+ print (f"Kubernetes version: { config ['docean :k8s_version' ]} " )
137
137
138
138
# Kubernetes regions
139
139
k8s_regions_json_str , _ = external_process .run (do_cli .get_kubernetes_regions_json ())
140
140
k8s_regions_json = json .loads (k8s_regions_json_str )
141
- default_region = defaults ['digitalocean :region' ] or k8s_regions_json [- 1 ]['slug' ]
141
+ default_region = defaults ['docean :region' ] or k8s_regions_json [- 1 ]['slug' ]
142
142
143
143
print ('Supported Regions:' )
144
144
for item in k8s_regions_json :
145
145
print (f" { item ['name' ]} : { item ['slug' ]} " )
146
- config ['digitalocean :region' ] = input (f'Region [{ default_region } ]: ' ).strip () or default_region
147
- print (f"Region: { config ['digitalocean :region' ]} " )
146
+ config ['docean :region' ] = input (f'Region [{ default_region } ]: ' ).strip () or default_region
147
+ print (f"Region: { config ['docean :region' ]} " )
148
148
149
149
# Kubernetes instance size
150
150
k8s_sizes_json_str , _ = external_process .run (do_cli .get_kubernetes_instance_sizes_json ())
151
151
k8s_sizes_json = json .loads (k8s_sizes_json_str )
152
152
k8s_sizes_slugs = [size ['slug' ] for size in k8s_sizes_json ]
153
- default_size = defaults ['digitalocean :instance_size' ] or 's-2vcpu-4gb'
153
+ default_size = defaults ['docean :instance_size' ] or 's-2vcpu-4gb'
154
154
155
155
print ('Supported Instance Sizes:' )
156
156
for slug in k8s_sizes_slugs :
157
157
print (f' { slug } ' )
158
158
159
- config ['digitalocean :instance_size' ] = input (f'Instance size [{ default_size } ]: ' ).strip () or default_size
160
- print (f"Instance size: { config ['digitalocean :instance_size' ]} " )
159
+ config ['docean :instance_size' ] = input (f'Instance size [{ default_size } ]: ' ).strip () or default_size
160
+ print (f"Instance size: { config ['docean :instance_size' ]} " )
161
161
162
162
# Kubernetes instance count
163
- default_node_count = defaults ['digitalocean :node_count' ] or 3
164
- while 'digitalocean :node_count' not in config :
163
+ default_node_count = defaults ['docean :node_count' ] or 3
164
+ while 'docean :node_count' not in config :
165
165
node_count = input ('Node count for Kubernetes cluster '
166
166
f'[{ default_node_count } ]: ' ).strip () or default_node_count
167
167
if type (node_count ) == int or node_count .isdigit ():
168
- config ['digitalocean :node_count' ] = int (node_count )
169
- print (f"Node count: { config ['digitalocean :node_count' ]} " )
168
+ config ['docean :node_count' ] = int (node_count )
169
+ print (f"Node count: { config ['docean :node_count' ]} " )
170
170
171
171
return config
172
172
@@ -217,16 +217,16 @@ def token(stack_config: Union[Mapping[str, Any], MutableMapping[str, auto._confi
217
217
return env_config ['DIGITALOCEAN_TOKEN' ]
218
218
219
219
# We were given a reference to a StackConfigParser object
220
- if 'config' in stack_config and 'digitalocean :token' in stack_config ['config' ]:
221
- return stack_config ['config' ]['digitalocean :token' ]
220
+ if 'config' in stack_config and 'docean :token' in stack_config ['config' ]:
221
+ return stack_config ['config' ]['docean :token' ]
222
222
223
223
# We were given a reference to a Pulumi Stack configuration
224
- if 'digitalocean :token' in stack_config :
225
- return stack_config ['digitalocean :token' ].value
224
+ if 'docean :token' in stack_config :
225
+ return stack_config ['docean :token' ].value
226
226
227
227
# Otherwise
228
228
msg = 'When using the Digital Ocean provider, an API token must be specified - ' \
229
- 'this token can be specified with the Pulumi config parameter digitalocean :token ' \
229
+ 'this token can be specified with the Pulumi config parameter docean :token ' \
230
230
'or the environment variable DIGITALOCEAN_TOKEN'
231
231
raise InvalidConfigurationException (msg )
232
232
0 commit comments