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

Read lock name from file #43

Open
dvianello opened this issue Oct 3, 2018 · 2 comments
Open

Read lock name from file #43

dvianello opened this issue Oct 3, 2018 · 2 comments

Comments

@dvianello
Copy link

Hello,

we have a use-case in which we'd like to (independently from this resource) scan the locks repository, pick a lock based on a condition and then provide the lock name to the resource from a file or is some other run-time way.

Is this supported by this resource?

Cheers,
Dario

@aegershman
Copy link

I am not a maintainer or anything like that, but just out of curiosity, could you expand more on your use-case? If not, no big deal, I'm just intrigued.

@dvianello
Copy link
Author

Hi @aegershman,

we have a requirement for removing environments after a certain TTL defined at deployment time.

At the moment, we're storing the expiry time in the lock, and we move an "expired" lock with an out-of-band process from claimed to unclaimed once their TTL is over. Another job picks at random a lock from the unclaimed folder every 15 minutes and destroys that environment. However, as you can imagine, especially when the number of locks increases, it might take hours to "randomly pick" the expired locks with environments still attached to them.

What we'd like to do is to scan the "unclaimed" folder for a particular flag that states if the corresponding environment has been removed or not, and then pass the lock to the destroy pipeline, which will lock the environment while it removes it. Right now we're forced to let entropy rule the game :-)

Cheers,
Dario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants