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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(keel): send keel docker events if enabled #535

Merged
merged 3 commits into from
Oct 29, 2019

Conversation

emjburns
Copy link
Contributor

In order to react to new docker containers in keel we need to know when there are new containers. This PR adds functionality to emit events to keel with the same criteria as sending new events to echo.

This won't kick in unless you have keel enabled. The format for the docker event we send is subject to change, but I think this is a decent first start 馃し鈥嶁檧 we shall see.

Copy link
Contributor

@luispollo luispollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just had a small question on (possibly?) unauthenticated requests to keel.

payload: [artifacts: [artifact], details: [:]],
eventName: "spinnaker_artifacts_docker"
]
AuthenticatedRequest.allowAnonymous { keelService.get().sendArtifactEvent(artifactEvent) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the allowAnonymous bit common practice/OK?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's common for service to service calls, i.e. we're not doing this call on behalf of a user so we have no user auth info to pass on.

@luispollo
Copy link
Contributor

luispollo commented Oct 26, 2019

P.S. Sorry if this is a silly question, but if we were already sending an event to echo, and echo centralizes most event handling to/from other services, shouldn鈥檛 we just extend the event handler in echo to call keel?

@emjburns
Copy link
Contributor Author

@luispollo that's a good question. Since the information is coming from igor, I didn't want to have it go through an extra service and have an extra network hop to get to keel. I thought it would be simpler to have it come from the "source" (well, the source that's calculating deltas). @asher do you have thoughts on this?

@luispollo
Copy link
Contributor

luispollo commented Oct 28, 2019

BTW @emjburns I noticed that this echo PR from earlier this year introduced echo -> keel integration for artifact events. How does that relate to/differ from what we're trying to accomplish here?

Copy link
Contributor

@asher asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@ezimanyi ezimanyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small comments, otherwise looks good!

@emjburns
Copy link
Contributor Author

(answered Luis's questions offline)

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