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 1f99654
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/1377.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
workers: allow namespaced scripts to be used as Worker tail consumers
```
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 1f99654

Please sign in to comment.