-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add task implementations for by-passing the java delegate #136
Conversation
func (c *dliteCommand) startPoller(ctx context.Context, tags []string) error { | ||
r := router.NewRouter(routeMap(c)) | ||
// TODO (Vistaar): Set a token updater thread which resets the token | ||
token, err := delegate.Token("audience", "issuer", c.env.Dlite.AccountID, c.env.Dlite.AccountSecret, tokenExpiry) |
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.
What happens when token expires now?
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.
Have set it to 10 hours for now - after that dlite will not be able to talk to manager. There is an open ticket to fix that: https://harness.atlassian.net/browse/CI-4946. I will see how java delegate does it, if they set infinite expiry will do the same.
StringVar(&c.poolFile) | ||
} | ||
|
||
func (c *dliteCommand) startPoller(ctx context.Context, tags []string) error { |
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 also delete the pools in case we receive sigterm call if reuse pool is not set. Can be taken up in next PR.
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.
ack. Will create a ticket for it
This PR adds support to directly start accepting and executing Harness tasks.
It uses wings-software/dlite as a library to poll for tasks and only contains implementations of the initialize, execute and destroy tasks.
It contains the mapping of the task types to the handlers which receive the task as input and should write the response back after execution.