Skip to content

Commit

Permalink
Adding count of ordered provisions
Browse files Browse the repository at this point in the history
Adding additional "ordered" value to the
provisionCount field of the Workshop resource.
  • Loading branch information
makirill committed Oct 8, 2024
1 parent 79c070b commit 05c1a13
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions helm/crds/workshops.babylon.gpte.redhat.com.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ spec:
provisionCount:
type: object
properties:
ordered:
description: Total number of WorkshopProvisions ordered.
type: integer
provisioning:
description: Number of WorkshopProvisions that are provisioning.
type: integer
Expand Down
5 changes: 3 additions & 2 deletions workshop-manager/operator/workshop.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,13 @@ async def update_status(self):
}
})

async def update_provision_count(self, provisioning, failed, completed):
async def update_provision_count(self, provisioning, failed, completed, ordered):

await self.merge_patch_status({
"provisionCount": {
"ordered": ordered,
"provisioning": provisioning,
"failed": failed,
"completed": completed,
}
})
})
1 change: 1 addition & 0 deletions workshop-manager/operator/workshopprovision.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ async def manage_resource_claims(self, logger, workshop):
failed_count += 1

await workshop.update_provision_count(
ordered=self.count,
provisioning=provisioning_count,
failed=failed_count,
completed=resource_claim_count - provisioning_count - failed_count
Expand Down

0 comments on commit 05c1a13

Please sign in to comment.