Skip to content

Commit

Permalink
Fix mgc tls secret deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
averevki committed Nov 6, 2023
1 parent 407a717 commit b062b9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions testsuite/openshift/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ def connected(self):
return False
return True

def get_secret(self, name):
def get_secret(self, name, ignore_not_found=False):
"""Returns dict-like structure for accessing secret data"""
with self.context:
return oc.selector(f"secret/{name}").object(cls=Secret)
return oc.selector(f"secret/{name}").object(cls=Secret, ignore_not_found=ignore_not_found)

def get_route(self, name):
"""Returns dict-like structure for accessing secret data"""
Expand Down
4 changes: 2 additions & 2 deletions testsuite/openshift/objects/gateway_api/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ def get_tls_cert(self) -> Certificate:

def delete_tls_secret(self):
"""Deletes secret with TLS certificate used by the gateway"""
tls_secret = self.openshift.get_secret(self.cert_secret_name)
tls_secret.delete(ignore_not_found=True)
if tls_secret := self.openshift.get_secret(self.cert_secret_name, ignore_not_found=True):
tls_secret.delete(ignore_not_found=True)

def get_spoke_gateway(self, spokes: dict[str, OpenShiftClient]) -> "MGCGateway":
"""
Expand Down

0 comments on commit b062b9f

Please sign in to comment.