Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(workers): allow namespaced scripts to be used as Worker tail consumers #1377

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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