Skip to content

Commit

Permalink
fix: retrieve registry after wait
Browse files Browse the repository at this point in the history
  • Loading branch information
rmocanu-ionos committed Dec 21, 2023
1 parent f641932 commit a3ff7ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 6 additions & 4 deletions docs/api/container-registry/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ This is a module that supports creating, updating or destroying Registries
<tr>
<td>features<br/><mark style="color:blue;">dict</mark></td>
<td align="center">False</td>
<td>Optional registry features. Format: 'vulnerability_scanning' key having a dict for value containing the 'enabled' key with a boolean value Note: These are all enabled by default, some may incur additional charges - see individual feature descriptions for details. Vulnerability scanning for images. Note: this is a paid add-on</td>
<td>Optional registry features. Format: 'vulnerability_scanning' key having a dict for value containing the 'enabled' key with a boolean value
Note: Vulnerability scanning for images is enabled by default. This is a paid add-on, please make sure you specify if you do not want it enabled</td>
</tr>
<tr>
<td>name<br/><mark style="color:blue;">str</mark></td>
Expand All @@ -139,7 +140,7 @@ This is a module that supports creating, updating or destroying Registries
<tr>
<td>allow_replace<br/><mark style="color:blue;">bool</mark></td>
<td align="center">False</td>
<td>Boolean indincating if the resource should be recreated when the state cannot be reached in another way. This may be used to prevent resources from being deleted from specifying a different value to an immutable property. An error will be thrown instead<br />Default: False</td>
<td>Boolean indicating if the resource should be recreated when the state cannot be reached in another way. This may be used to prevent resources from being deleted from specifying a different value to an immutable property. An error will be thrown instead<br />Default: False</td>
</tr>
<tr>
<td>api_url<br/><mark style="color:blue;">str</mark></td>
Expand Down Expand Up @@ -287,7 +288,8 @@ This is a module that supports creating, updating or destroying Registries
<tr>
<td>features<br/><mark style="color:blue;">dict</mark></td>
<td align="center">False</td>
<td>Optional registry features. Format: 'vulnerability_scanning' key having a dict for value containing the 'enabled' key with a boolean value Note: These are all enabled by default, some may incur additional charges - see individual feature descriptions for details. Vulnerability scanning for images. Note: this is a paid add-on</td>
<td>Optional registry features. Format: 'vulnerability_scanning' key having a dict for value containing the 'enabled' key with a boolean value
Note: Vulnerability scanning for images is enabled by default. This is a paid add-on, please make sure you specify if you do not want it enabled</td>
</tr>
<tr>
<td>name<br/><mark style="color:blue;">str</mark></td>
Expand All @@ -302,7 +304,7 @@ This is a module that supports creating, updating or destroying Registries
<tr>
<td>allow_replace<br/><mark style="color:blue;">bool</mark></td>
<td align="center">False</td>
<td>Boolean indincating if the resource should be recreated when the state cannot be reached in another way. This may be used to prevent resources from being deleted from specifying a different value to an immutable property. An error will be thrown instead<br />Default: False</td>
<td>Boolean indicating if the resource should be recreated when the state cannot be reached in another way. This may be used to prevent resources from being deleted from specifying a different value to an immutable property. An error will be thrown instead<br />Default: False</td>
</tr>
<tr>
<td>api_url<br/><mark style="color:blue;">str</mark></td>
Expand Down
6 changes: 4 additions & 2 deletions plugins/modules/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
'type': 'str',
},
'features': {
'description': ["Optional registry features. Format: 'vulnerability_scanning' key having a dict for value containing the 'enabled' key with a boolean value Note: These are all enabled by default, some may incur additional charges - see individual feature descriptions for details. Vulnerability scanning for images. Note: this is a paid add-on"],
'description': ["Optional registry features. Format: 'vulnerability_scanning' key having a dict for value containing the 'enabled' key with a boolean value\n Note: Vulnerability scanning for images is enabled by default. This is a paid add-on, please make sure you specify if you do not want it enabled"],
'available': ['present', 'update'],
'type': 'dict',
},
Expand All @@ -62,7 +62,7 @@
},
'allow_replace': {
'description': [
'Boolean indincating if the resource should be recreated when the state cannot be reached in '
'Boolean indicating if the resource should be recreated when the state cannot be reached in '
'another way. This may be used to prevent resources from being deleted from specifying a different '
'value to an immutable property. An error will be thrown instead',
],
Expand Down Expand Up @@ -317,6 +317,7 @@ def _create_object(module, client, existing_object=None):
scaleup=10000,
timeout=wait_timeout,
)
registry = registries_api.registries_find_by_id(registry.id)
except ionoscloud_container_registry.ApiException as e:
module.fail_json(msg="failed to create the new Registry: %s" % to_native(e))
return registry
Expand Down Expand Up @@ -360,6 +361,7 @@ def _update_object(module, client, existing_object):
scaleup=10000,
timeout=wait_timeout,
)
registry = registries_api.registries_find_by_id(existing_object.id)

return registry
except ionoscloud_container_registry.ApiException as e:
Expand Down

0 comments on commit a3ff7ca

Please sign in to comment.