Skip to content

Commit

Permalink
feat(maestro): cleaning and fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiz Pegoraro committed Sep 26, 2023
1 parent 2d8d859 commit 86b8ffc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/maestro/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func loadStreamEsConfig(prefix string) config.EsConfig {
cfg.AllowEmptyEnv(true)
cfg.AutomaticEnv()
var esC config.EsConfig
cfg.Unmarshal(&esC)
_ = cfg.Unmarshal(&esC)
return esC
}

Expand All @@ -240,6 +240,6 @@ func loadSinkerEsConfig(prefix string) config.EsConfig {
cfg.AllowEmptyEnv(true)
cfg.AutomaticEnv()
var esC config.EsConfig
cfg.Unmarshal(&esC)
_ = cfg.Unmarshal(&esC)
return esC
}
2 changes: 2 additions & 0 deletions maestro/deployment/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ type Deployment struct {

func NewDeployment(ownerID string, sinkID string, config types.Metadata) Deployment {
now := time.Now()
deploymentName := "otel-" + sinkID
return Deployment{
OwnerID: ownerID,
SinkID: sinkID,
Config: config,
LastStatus: "pending",
LastStatusUpdate: &now,
CollectorName: deploymentName,
}
}

Expand Down
3 changes: 1 addition & 2 deletions maestro/deployment/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ func (d *deploymentService) UpdateDeployment(ctx context.Context, deployment *De
return errors.New("could not find deployment to update")
}
// Spin down the collector if it is running
deploymentName := "otel-" + got.SinkID
err = d.kubecontrol.KillOtelCollector(ctx, deploymentName, got.SinkID)
err = d.kubecontrol.KillOtelCollector(ctx, got.CollectorName, got.SinkID)
if err != nil {
d.logger.Warn("could not stop running collector, will try to update anyway", zap.Error(err))
}
Expand Down
2 changes: 0 additions & 2 deletions maestro/service/deploy_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ func (d *eventService) HandleSinkDelete(ctx context.Context, event maestroredis.
if deploymentEntry.LastCollectorDeployTime != nil || deploymentEntry.LastCollectorDeployTime.Before(time.Now()) {
if deploymentEntry.LastCollectorStopTime != nil || deploymentEntry.LastCollectorStopTime.Before(time.Now()) {
d.logger.Warn("collector is not running, skipping")
} else {
//
}
}
err = d.deploymentService.RemoveDeployment(ctx, event.Owner, event.SinkID)
Expand Down

0 comments on commit 86b8ffc

Please sign in to comment.