Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define a way for callers to wait for the resource created by the library to be in the expected state #24

Open
alaypatel07 opened this issue Jun 24, 2021 · 0 comments
Assignees

Comments

@alaypatel07
Copy link

In the crane-lib state only work, there is a need where the crane-lib creates a bunch of resources, for example pods, routes, services, configmaps, secrets. The users of the crane-lib need the ability for the resources created, to be in the right state to move forward doing meaningful work. We need the expose this ability either via:

  1. createAndWait, this will create the pod and immediately wait for it to be running
  2. Provide a utility functionIsResourceInState(resource, expectedState). The provides a way for the user to keep checking if the pod created is actually running by returning a true/false.

Some of the things we might way to solve for:

  1. Some things in kube might take a long time for them to be in the right state. For example, if the registry is down for 10 mins, and if the image is not present on the node, it would take some time for kube to pull down the image and run? we might not want to block for 10 mins on the createAndWait call
  2. We might want to encapsulate all the business logic regarding the creations of resources in the implementation itself. I.e. the callers might not have to carry the overhead of knowing about all the resources that were created.
@alaypatel07 alaypatel07 self-assigned this Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants