Skip to content

Commit bc4c544

Browse files
Mayuri GoraviyalaMayuri Goraviyala
authored andcommitted
[patch] Error Fixed for subscription status
1 parent 70907c5 commit bc4c544

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/mas/devops/olm.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,13 @@ def applySubscription(dynClient: DynamicClient, namespace: str, packageName: str
158158
logger.debug(f"Waiting for Subscription {name} in {namespace}")
159159
while True:
160160
subscriptionResource = subscriptionsAPI.get(name=name, namespace=namespace)
161+
state = getattr(subscriptionResource.status, "state", None)
161162

162-
if subscriptionResource.status.state == "AtLatestKnown":
163-
logger.debug(f"Subscription ready for {name} in {namespace} ")
163+
if state == "AtLatestKnown":
164+
logger.debug(f"Subscription {name} in {namespace} reached state: {state}")
164165
return subscriptionResource
165166

166-
logger.debug(f"Subscription ready not yet for {name} in {namespace} ")
167+
logger.debug(f"Subscription {name} in {namespace} not ready yet (state = {state}), retrying...")
167168
sleep(30)
168169

169170

0 commit comments

Comments
 (0)