Skip to content

Commit 2b7b9e3

Browse files
committed
Follow-up fix which missed PR
1 parent 0415696 commit 2b7b9e3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

operator/resourcehandle.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,17 @@ async def bind_handle_to_claim(
170170
_content_type = 'application/json-patch+json',
171171
body = patch,
172172
)
173+
matched_resource_handle = ResourceHandle.__register_definition(definition=definition)
173174
except kubernetes_asyncio.client.exceptions.ApiException as exception:
174175
if exception.status == 404:
175176
logger.warning(f"Attempt to bind deleted {matched_resource_handle} to {resource_claim}")
176177
matched_resource_handle.__unregister()
177178
matched_resource_handle = None
178179
else:
179180
raise
180-
matched_resource_handle = ResourceHandle.__register_definition(definition=definition)
181-
logger.info(f"Bound {matched_resource_handle} to {resource_claim}")
182-
break
181+
if matched_resource_handle:
182+
logger.info(f"Bound {matched_resource_handle} to {resource_claim}")
183+
break
183184
else:
184185
# No unbound resource handle matched
185186
return None

0 commit comments

Comments
 (0)