diff --git a/cmd/maestro/main.go b/cmd/maestro/main.go index cfb2b5bc0..179c65cc4 100644 --- a/cmd/maestro/main.go +++ b/cmd/maestro/main.go @@ -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 } @@ -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 } diff --git a/maestro/deployment/model.go b/maestro/deployment/model.go index 3379458aa..ad737e1b1 100644 --- a/maestro/deployment/model.go +++ b/maestro/deployment/model.go @@ -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, } } diff --git a/maestro/deployment/service.go b/maestro/deployment/service.go index 68e45efd5..029a49d77 100644 --- a/maestro/deployment/service.go +++ b/maestro/deployment/service.go @@ -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)) } diff --git a/maestro/service/deploy_service.go b/maestro/service/deploy_service.go index 399e1af7f..d0e529b02 100644 --- a/maestro/service/deploy_service.go +++ b/maestro/service/deploy_service.go @@ -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)