Skip to content

Commit 97a1d8e

Browse files
author
Sanjay Prabhakar
committed
[patch] fix apply_resource
1 parent f8dfc85 commit 97a1d8e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/mas/devops/ocp.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,8 @@ def apply_resource(dynClient: DynamicClient, resource_yaml: str, namespace: str)
293293
resource = dynClient.resources.get(api_version=api_version, kind=kind)
294294
# Try to get the existing resource
295295
resource.get(name=name, namespace=namespace)
296-
# If found, update it
297-
logger.debug(f"Updating existing {kind} '{name}' in namespace '{namespace}'")
298-
resource.patch(body=resource_dict, namespace=namespace, name=name)
296+
# If found, skip creation
297+
logger.debug(f"{kind} '{name}' already exists in namespace '{namespace}', skipping creation.")
299298
except NotFoundError:
300299
# If not found, create it
301300
logger.debug(f"Creating new {kind} '{name}' in namespace '{namespace}'")

0 commit comments

Comments
 (0)