Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

rollout: Publish rollout events to PubSub#109

Open
gvso wants to merge 4 commits intoGoogleCloudPlatform:mainfrom
gvso:pubsub-implementation
Open

rollout: Publish rollout events to PubSub#109
gvso wants to merge 4 commits intoGoogleCloudPlatform:mainfrom
gvso:pubsub-implementation

Conversation

@gvso
Copy link
Contributor

@gvso gvso commented Aug 26, 2020

This integrates the rollout package with the pubsub package to publish events after rollouts/rollbacks occur. It also adds a new flag --notify-pubsub to specify the PubSub topic.

This integrates the rollout package with the pubsub package to publish events
after rollouts/rollbacks occur. It also adds a new flag `--notify-pubsub` to
specify the PubSub topic.

Signed-off-by: Getulio Valentin Sánchez <gvso@google.com>
}

// Wait for all messages to be sent (or to fail).
r.pubsubClient.Stop()
Copy link
Contributor Author

@gvso gvso Aug 26, 2020

Choose a reason for hiding this comment

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

Since we're publishing one event per go routine (in each rollout process), we might just wait for the event to be published using PublishResult.Get. In this way, we can abstract the synchronous publishing from the user of the pubsub package

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah that's a decent idea. I think that could be done with

waitFn, err := PublishMessage()

Copy link
Contributor

Choose a reason for hiding this comment

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

lets move Get into Publish

Signed-off-by: Getulio Valentin Sánchez <gvso@google.com>
return d, errors.Wrap(err, "failed to diagnose candidate's health")
}

func (r *Rollout) publish(svc *run.Service, diagnosis health.DiagnosisResult) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

better name like publishEvent

Getulio Valentin Sánchez added 2 commits August 26, 2020 15:13
Signed-off-by: Getulio Valentin Sánchez <gvso@google.com>
Signed-off-by: Getulio Valentin Sánchez <gvso@google.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish to Pub/Sub after a rollout/rollback have occurred

2 participants