-
Notifications
You must be signed in to change notification settings - Fork 18
Add pre/post lease hooks #606
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
base: main
Are you sure you want to change the base?
Conversation
❌ Deploy Preview for jumpstarter-docs failed. Why did it fail? →
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Nice!! this will be really really useful |
| "jumpstarter.dev/lease": context.lease_name, | ||
| }, | ||
| ) as session: | ||
| async with session.serve_unix_async() as unix_path: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should reuse the existing session to make sure that the hooks calls on the driver altering states should persist.
|
This would be a hook point when the connection is ready and you can start talking to the exporter. |
Implement new hook scripts that can be configured in the exporter config to run
jcommands within a temporary lease environment.The following environment variables are exposed to hook scripts:
JUMPSTARTER_HOST- Path to the Unix socket for j CLI accessJMP_DRIVERS_ALLOW=UNSAFE- Allows all drivers for local accessLEASE_NAME- The name of the current leaseCLIENT_NAME- Name of the client that acquired the leaseLEASE_DURATION- Duration of the leaseEXPORTER_NAME- Name of the exporterEXPORTER_NAMESPACE- Namespace of the exporterExample YAML config: