secrets: Add secrets block to job spec (#26076)

This commit is contained in:
Michael Smithhisler
2025-06-24 15:17:42 -04:00
parent 9682aa2724
commit 65c7f34f2d
13 changed files with 518 additions and 3 deletions

View File

@@ -1466,6 +1466,18 @@ func ApiTaskToStructsTask(job *structs.Job, group *structs.TaskGroup,
}
}
if len(apiTask.Secrets) > 0 {
structsTask.Secrets = []*structs.Secret{}
for _, s := range apiTask.Secrets {
structsTask.Secrets = append(structsTask.Secrets, &structs.Secret{
Name: s.Name,
Provider: s.Provider,
Path: s.Path,
Config: s.Config,
})
}
}
if apiTask.Consul != nil {
structsTask.Consul = apiConsulToStructs(apiTask.Consul)
}