Skip to content

Commit

Permalink
remove hybrid (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
samrabelachew authored Jul 25, 2022
1 parent 82bdb74 commit 98c285a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
17 changes: 1 addition & 16 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1004,21 +1004,6 @@ func NewServer(userConfig UserConfig, config Config) (*Server, error) {
ctxLogger.Info("running Atlantis in gateway mode", map[string]interface{}{
"sns": userConfig.LyftGatewaySnsTopicArn,
})
case Hybrid: // gateway eventsController handles POST, and SQS worker is set up to handle messages via default eventsController
vcsPostHandler = gatewayEventsController
worker, err := sqs.NewGatewaySQSWorker(ctx, statsScope, ctxLogger, userConfig.LyftWorkerQueueURL, defaultEventsController)
if err != nil {
ctxLogger.Error("unable to set up worker", map[string]interface{}{
"err": err,
})
cancel()
return nil, errors.Wrapf(err, "setting up sqs handler for hybrid mode")
}
go worker.Work(ctx)
ctxLogger.Info("running Atlantis in hybrid mode", map[string]interface{}{
"sns": userConfig.LyftGatewaySnsTopicArn,
"queue": userConfig.LyftWorkerQueueURL,
})
case Worker: // an SQS worker is set up to handle messages via default eventsController
worker, err := sqs.NewGatewaySQSWorker(ctx, statsScope, ctxLogger, userConfig.LyftWorkerQueueURL, defaultEventsController)
if err != nil {
Expand Down Expand Up @@ -1127,7 +1112,7 @@ func (s *Server) Start() error {
<-stop

// Shutdown sqs polling. Any received messages being processed will either succeed/fail depending on if drainer started.
if s.LyftMode == Hybrid || s.LyftMode == Worker {
if s.LyftMode == Worker {
s.CtxLogger.Warn("Received interrupt. Shutting down the sqs handler")
s.CancelWorker()
}
Expand Down
3 changes: 0 additions & 3 deletions server/user_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ type Mode int
const (
Default Mode = iota
Gateway
Hybrid
Worker
)

Expand Down Expand Up @@ -110,8 +109,6 @@ func (u UserConfig) ToLyftMode() Mode {
return Default
case "gateway":
return Gateway
case "hybrid":
return Hybrid
case "worker":
return Worker
}
Expand Down
4 changes: 0 additions & 4 deletions server/user_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ func TestUserConfig_ToLyftMode(t *testing.T) {
"gateway",
server.Gateway,
},
{
"hybrid",
server.Hybrid,
},
{
"worker",
server.Worker,
Expand Down

0 comments on commit 98c285a

Please sign in to comment.