feat: bootstrap official runner through SPIFFE facade
This commit is contained in:
@@ -62,13 +62,22 @@ func TestFindRecoversSandboxByMetadata(t *testing.T) {
|
||||
func TestCreateUsesPoolAndPersistsRecoveryMetadata(t *testing.T) {
|
||||
lifecycle := &fakeLifecycle{}
|
||||
metadata := taskworker.BackendMetadata(assignment())
|
||||
executor, err := backend(lifecycle).Create(context.Background(), assignment(), metadata)
|
||||
executor, err := backend(lifecycle).Create(context.Background(), assignment(), taskworker.LaunchSpec{
|
||||
Metadata: metadata,
|
||||
Environment: map[string]string{
|
||||
"CI_SPIFFE_ID": assignment().Identity.SPIFFEID,
|
||||
"CI_RUNNER_CAPABILITY": "capability",
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if lifecycle.created.Extensions["poolRef"] != "ci-vm" || lifecycle.created.Metadata[assignmentMetadata] != assignment().ID || lifecycle.created.Env["CI_SPIFFE_ID"] != assignment().Identity.SPIFFEID || executor.Name != "sandbox-42" {
|
||||
t.Fatalf("request=%#v executor=%#v", lifecycle.created, executor)
|
||||
}
|
||||
if lifecycle.created.Env["CI_RUNNER_CAPABILITY"] != "capability" {
|
||||
t.Fatalf("environment = %#v", lifecycle.created.Env)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBindIdentityVerifiesPersistedMetadata(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user