diff --git a/CHANGELOG.md b/CHANGELOG.md index 78d89545..271e6c0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed `service update` crashing with `KeyError: 'Template'` when given a flat YAML body without the Template wrapper - Fixed `service update_env` and `update_labels` crashing when `OtherDockerConfig` is empty - Fixed `tenant config` crashing with help text when `--deletevar` is not provided +- Fixed `apply` misrouting the body into the `name` parameter for subclasses whose `create` signature starts with `name` (e.g. `ssm_param`, `secret`, `aws_secret`, `configmap`); the V2 and V3 base `apply` now call `self.create(body=body)` by keyword ## [0.4.3] - 2026-03-18 diff --git a/src/duplo_resource/ssm_param.py b/src/duplo_resource/ssm_param.py index 35517164..1bcb34bd 100644 --- a/src/duplo_resource/ssm_param.py +++ b/src/duplo_resource/ssm_param.py @@ -14,7 +14,7 @@ def name_from_body(self, body): return body["Name"] @Command() - def create(self, + def create(self, name: args.NAME=None, body: args.BODY=None, paramtype: args.SSM_PARAM_TYPE=None, @@ -25,7 +25,7 @@ def create(self, ```sh duploctl ssm_param create -pval -ptype ``` - + Args: name: The name of the SSM Parameter to create. -ptype/--parametertype: The type of parameter to create, must be String, SecureString, or StringList @@ -39,9 +39,9 @@ def create(self, } ``` - Returns: + Returns: resource: The SSM Parameter object. - + Raises: DuploError: If the SSM Parameter already exists. """ diff --git a/src/duplocloud/resource.py b/src/duplocloud/resource.py index 17f24c3c..ba0068a9 100644 --- a/src/duplocloud/resource.py +++ b/src/duplocloud/resource.py @@ -153,7 +153,7 @@ def apply(self, self.find(name) return self.update(name, body) except DuploNotFound: - return self.create(body) + return self.create(body=body) class DuploResourceV3(DuploResource): @@ -341,6 +341,6 @@ def apply(self, self.find(name) return self.update(name=name, body=body, patches=patches) except DuploNotFound: - return self.create(body) + return self.create(body=body) diff --git a/src/tests/data/param.yaml b/src/tests/data/param.yaml index e69de29b..2bc861b7 100644 --- a/src/tests/data/param.yaml +++ b/src/tests/data/param.yaml @@ -0,0 +1,3 @@ +Name: duploctl-test +Type: String +Value: testvalue