feat: bootstrap official runner through SPIFFE facade
This commit is contained in:
@@ -61,7 +61,7 @@ func (b Backend) Find(ctx context.Context, assignmentID string) (*taskworker.Exe
|
||||
return executor(result.Items[0]), nil
|
||||
}
|
||||
|
||||
func (b Backend) Create(ctx context.Context, assignment taskassignment.Assignment, metadata taskworker.Metadata) (*taskworker.Executor, error) {
|
||||
func (b Backend) Create(ctx context.Context, assignment taskassignment.Assignment, launch taskworker.LaunchSpec) (*taskworker.Executor, error) {
|
||||
if err := b.validate(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -69,10 +69,11 @@ func (b Backend) Create(ctx context.Context, assignment taskassignment.Assignmen
|
||||
return nil, fmt.Errorf("OpenSandbox backend cannot create %q assignment", assignment.Backend)
|
||||
}
|
||||
environment := clone(b.Config.Env)
|
||||
environment["CI_ASSIGNMENT_ID"] = assignment.ID
|
||||
environment["CI_SPIFFE_ID"] = assignment.Identity.SPIFFEID
|
||||
sandboxMetadata := clone(metadata.Annotations)
|
||||
for key, value := range metadata.Labels {
|
||||
for key, value := range launch.Environment {
|
||||
environment[key] = value
|
||||
}
|
||||
sandboxMetadata := clone(launch.Metadata.Annotations)
|
||||
for key, value := range launch.Metadata.Labels {
|
||||
sandboxMetadata[key] = value
|
||||
}
|
||||
request := opensandbox.CreateSandboxRequest{
|
||||
|
||||
Reference in New Issue
Block a user