mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: include 'everyone' group in template importing (#18257)
This commit is contained in:
@@ -739,6 +739,9 @@ func (s *server) acquireProtoJob(ctx context.Context, job database.ProvisionerJo
|
||||
Metadata: &sdkproto.Metadata{
|
||||
CoderUrl: s.AccessURL.String(),
|
||||
WorkspaceName: input.WorkspaceName,
|
||||
// There is no owner for a template import, but we can assume
|
||||
// the "Everyone" group as a placeholder.
|
||||
WorkspaceOwnerGroups: []string{database.EveryoneGroup},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -759,6 +762,9 @@ func (s *server) acquireProtoJob(ctx context.Context, job database.ProvisionerJo
|
||||
UserVariableValues: convertVariableValues(userVariableValues),
|
||||
Metadata: &sdkproto.Metadata{
|
||||
CoderUrl: s.AccessURL.String(),
|
||||
// There is no owner for a template import, but we can assume
|
||||
// the "Everyone" group as a placeholder.
|
||||
WorkspaceOwnerGroups: []string{database.EveryoneGroup},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -568,8 +568,9 @@ func TestAcquireJob(t *testing.T) {
|
||||
want, err := json.Marshal(&proto.AcquiredJob_TemplateDryRun_{
|
||||
TemplateDryRun: &proto.AcquiredJob_TemplateDryRun{
|
||||
Metadata: &sdkproto.Metadata{
|
||||
CoderUrl: (&url.URL{}).String(),
|
||||
WorkspaceName: "testing",
|
||||
CoderUrl: (&url.URL{}).String(),
|
||||
WorkspaceName: "testing",
|
||||
WorkspaceOwnerGroups: []string{database.EveryoneGroup},
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -600,7 +601,8 @@ func TestAcquireJob(t *testing.T) {
|
||||
want, err := json.Marshal(&proto.AcquiredJob_TemplateImport_{
|
||||
TemplateImport: &proto.AcquiredJob_TemplateImport{
|
||||
Metadata: &sdkproto.Metadata{
|
||||
CoderUrl: (&url.URL{}).String(),
|
||||
CoderUrl: (&url.URL{}).String(),
|
||||
WorkspaceOwnerGroups: []string{database.EveryoneGroup},
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -643,7 +645,8 @@ func TestAcquireJob(t *testing.T) {
|
||||
{Name: "first", Sensitive: true, Value: "first_value"},
|
||||
},
|
||||
Metadata: &sdkproto.Metadata{
|
||||
CoderUrl: (&url.URL{}).String(),
|
||||
CoderUrl: (&url.URL{}).String(),
|
||||
WorkspaceOwnerGroups: []string{database.EveryoneGroup},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user