Skip to content

Commit

Permalink
Fix initial routes for Pipelines and delete of Pipelines from Envoy (#…
Browse files Browse the repository at this point in the history
…543)

* Fix initial and delete of Pipelines

* remove msg and make fatal initial envoy update error

* review updates

* review empty line
  • Loading branch information
ukclivecox authored Oct 31, 2022
1 parent 592b709 commit 32ba9aa
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scheduler/pkg/envoy/processor/incremental.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ func NewIncrementalProcessor(
ip.handlePipelinesEvents,
)

err = ip.updateEnvoy()
if err != nil {
return nil, err
}
return ip, nil
}

Expand Down Expand Up @@ -421,6 +425,10 @@ func (p *IncrementalProcessor) removeExperiment(exp *experiment.Experiment) erro
return p.removeRouteForServerInEnvoy(routeName)
}

func getPipelineRouteName(pipelineName string) string {
return fmt.Sprintf("%s.%s", pipelineName, resources.SeldonPipelineHeaderSuffix)
}

func (p *IncrementalProcessor) addPipeline(pipelineName string) error {
logger := p.logger.WithField("func", "addPipeline")
p.mu.Lock()
Expand All @@ -434,7 +442,7 @@ func (p *IncrementalProcessor) addPipeline(pipelineName string) error {
return p.removePipeline(pip)
}
}
routeName := fmt.Sprintf("%s.%s", pip.Name, resources.SeldonPipelineHeaderSuffix)
routeName := getPipelineRouteName(pip.Name)
p.xdsCache.RemovePipelineRoute(routeName)
exp := p.experimentServer.GetExperimentForBaselinePipeline(pip.Name)
logger.Infof("getting experiment for baseline %s returned %v", pip.Name, exp)
Expand Down Expand Up @@ -466,7 +474,7 @@ func (p *IncrementalProcessor) addPipeline(pipelineName string) error {
}

func (p *IncrementalProcessor) removePipeline(pip *pipeline.Pipeline) error {
p.xdsCache.RemovePipelineRoute(pip.Name)
p.xdsCache.RemovePipelineRoute(getPipelineRouteName(pip.Name))
return p.updateEnvoy()
}

Expand Down

0 comments on commit 32ba9aa

Please sign in to comment.