Skip to content

Commit

Permalink
feat(workers): allow namespaced scripts to be used as Worker tail con…
Browse files Browse the repository at this point in the history
…sumers
  • Loading branch information
ndisidore committed Aug 25, 2023
1 parent 251e120 commit bb00eb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ type WorkerScript struct {
type WorkersTailConsumer struct {
Service string `json:"service"`
Environment *string `json:"environment,omitempty"`
Namespace *string `json:"namespace,omitempty"`
}

// WorkerMetaData contains worker script information such as size, creation & modification dates.
Expand Down
3 changes: 2 additions & 1 deletion workers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,7 @@ func TestUploadWorker_WithTailConsumers(t *testing.T) {
tailConsumers := []WorkersTailConsumer{
{Service: "my-service-a"},
{Service: "my-service-b", Environment: StringPtr("production")},
{Service: "a-namespaced-service", Namespace: StringPtr("a-dispatch-namespace")},
}
response = workersScriptResponse(t,
withWorkerScript(expectedWorkersModuleWorkerScript),
Expand All @@ -1295,7 +1296,7 @@ func TestUploadWorker_WithTailConsumers(t *testing.T) {
})
assert.NoError(t, err)
require.NotNil(t, worker.TailConsumers)
assert.Len(t, *worker.TailConsumers, 2)
assert.Len(t, *worker.TailConsumers, 3)
})
}

Expand Down

0 comments on commit bb00eb2

Please sign in to comment.