Skip to content

Commit 281f690

Browse files
committed
Add option to update secrets if they exist but not by default
1 parent c0ffe01 commit 281f690

File tree

5 files changed

+28
-8
lines changed

5 files changed

+28
-8
lines changed

CHANGELOG.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
1.25.16: CYBL-2002 - Add option to update secrets if they exist but not by default
12
1.25.15: CYBL-2016 Fix runtime_properties update at concurrent reservations.
23
1.25.14: RD-6414 Hide authorization in headers in rest plugin.
34
1.25.13:

cloudify_secrets/sdk.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,15 @@ def _write(self, rest_client_method, entries, variant=None):
6464

6565
return result
6666

67-
def create(self, entries, variant=None, **_):
68-
return self._write(self._rest_client.secrets.create, entries, variant)
67+
def create(self, entries, variant=None, **kwargs):
68+
if kwargs.get('update_if_exists', False) is True:
69+
return self._write(self._rest_client.secrets.patch,
70+
entries,
71+
variant)
72+
else:
73+
return self._write(self._rest_client.secrets.create,
74+
entries,
75+
variant)
6976

7077
def update(self, entries, variant=None, **_):
7178
return self._write(self._rest_client.secrets.patch, entries, variant)

plugin.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins:
33
cfy_util: &utilities_plugin
44
executor: central_deployment_agent
55
package_name: cloudify-utilities-plugin
6-
package_version: '1.25.15'
6+
package_version: '1.25.16'
77

88
cfy_files: *utilities_plugin
99

@@ -739,6 +739,10 @@ node_types:
739739
type: boolean
740740
default: false
741741
required: false
742+
update_if_exists:
743+
type: boolean
744+
default: false
745+
required: false
742746
interfaces:
743747
cloudify.interfaces.lifecycle:
744748
create:

plugin_1_4.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins:
33
cfy_util: &utilities_plugin
44
executor: central_deployment_agent
55
package_name: cloudify-utilities-plugin
6-
package_version: '1.25.15'
6+
package_version: '1.25.16'
77

88
cfy_files: *utilities_plugin
99

@@ -738,9 +738,13 @@ node_types:
738738
type: string
739739
required: false
740740
logs_secrets:
741-
type: boolean
742-
default: false
743-
required: false
741+
type: boolean
742+
default: false
743+
required: false
744+
update_if_exists:
745+
type: boolean
746+
default: false
747+
required: false
744748
interfaces:
745749
cloudify.interfaces.lifecycle:
746750
create:

v2_plugin.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins:
33
cfy_util: &utilities_plugin
44
executor: central_deployment_agent
55
package_name: cloudify-utilities-plugin
6-
package_version: '1.25.15'
6+
package_version: '1.25.16'
77

88
cfy_files: *utilities_plugin
99

@@ -741,6 +741,10 @@ node_types:
741741
type: boolean
742742
default: false
743743
required: false
744+
update_if_exists:
745+
type: boolean
746+
default: false
747+
required: false
744748
interfaces:
745749
cloudify.interfaces.lifecycle:
746750
create:

0 commit comments

Comments
 (0)