Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
feat: should not create dlq job with empty image and prom host
Browse files Browse the repository at this point in the history
  • Loading branch information
StewartJingga committed Oct 24, 2023
1 parent 58ea2a7 commit cc9c306
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/server/v1/dlq/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ var (
ErrFirehoseNamespaceNotFound = errors.New("could not find firehose namespace from resource output")
ErrFirehoseNamespaceInvalid = errors.New("invalid firehose namespace from resource output")
ErrFirehoseNotFound = errors.New("firehose not found")
ErrEmptyConfigImage = errors.New("empty dlq job image")
ErrEmptyConfigPrometheusHost = errors.New("empty prometheus host")
)
7 changes: 7 additions & 0 deletions internal/server/v1/dlq/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ func NewService(client entropyv1beta1rpc.ResourceServiceClient, gcsClient gcs.Bl

// TODO: replace *DlqJob with a generated models.DlqJob
func (s *Service) CreateDLQJob(ctx context.Context, userEmail string, dlqJob models.DlqJob) (models.DlqJob, error) {
if s.cfg.DlqJobImage == "" {
return models.DlqJob{}, ErrEmptyConfigImage
}
if s.cfg.PrometheusHost == "" {
return models.DlqJob{}, ErrEmptyConfigPrometheusHost
}

dlqJob.Replicas = 1

def, err := s.client.GetResource(ctx, &entropyv1beta1.GetResourceRequest{Urn: dlqJob.ResourceID})
Expand Down

0 comments on commit cc9c306

Please sign in to comment.