Skip to content

Commit

Permalink
only use replace_resource if resource already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
knatsu-summer committed Aug 27, 2024
1 parent c31d332 commit 1728acb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions oper8/deploy_manager/openshift_deploy_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,8 +920,10 @@ def _apply(self, resource_definition, method: DeployMethod):
# If the resource requires a replace operation then use put. Otherwise use
# server side apply
if (
req_replace or method is DeployMethod.REPLACE
) and method != DeployMethod.UPDATE:
(req_replace or method is DeployMethod.REPLACE)
and method != DeployMethod.UPDATE
and current != {}
):
apply_res = self._replace_resource(
resource_definition,
)
Expand Down

0 comments on commit 1728acb

Please sign in to comment.