fix: 注入执行器 SPIFFE socket
This commit is contained in:
@@ -24,13 +24,14 @@ const (
|
||||
// Bootstrap emits assignment-scoped launch configuration. FacadeURL is the
|
||||
// controller endpoint reached by the local SPIFFE proxy, not by Runner itself.
|
||||
type Bootstrap struct {
|
||||
Capabilities runnerfacade.Capabilities
|
||||
FacadeURL string
|
||||
FacadeSPIFFEID string
|
||||
Capabilities runnerfacade.Capabilities
|
||||
FacadeURL string
|
||||
FacadeSPIFFEID string
|
||||
WorkloadAPIAddr string
|
||||
}
|
||||
|
||||
func (b Bootstrap) Environment(assignment taskassignment.Assignment) (map[string]string, error) {
|
||||
if assignment.ID == "" || assignment.Identity.SPIFFEID == "" || b.FacadeSPIFFEID == "" {
|
||||
if assignment.ID == "" || assignment.Identity.SPIFFEID == "" || b.FacadeSPIFFEID == "" || b.WorkloadAPIAddr == "" {
|
||||
return nil, errors.New("assignment ID and SPIFFE ID are required")
|
||||
}
|
||||
parsed, err := url.Parse(b.FacadeURL)
|
||||
@@ -42,12 +43,13 @@ func (b Bootstrap) Environment(assignment taskassignment.Assignment) (map[string
|
||||
return nil, errors.New("runner capability issuer is not configured")
|
||||
}
|
||||
return map[string]string{
|
||||
EnvAssignmentID: assignment.ID,
|
||||
EnvCapability: capability,
|
||||
EnvFacadeURL: b.FacadeURL,
|
||||
EnvFacadeID: b.FacadeSPIFFEID,
|
||||
EnvSPIFFEID: assignment.Identity.SPIFFEID,
|
||||
EnvBackend: string(assignment.Backend),
|
||||
EnvAssignmentID: assignment.ID,
|
||||
EnvCapability: capability,
|
||||
EnvFacadeURL: b.FacadeURL,
|
||||
EnvFacadeID: b.FacadeSPIFFEID,
|
||||
EnvSPIFFEID: assignment.Identity.SPIFFEID,
|
||||
EnvBackend: string(assignment.Backend),
|
||||
"SPIFFE_ENDPOINT_SOCKET": b.WorkloadAPIAddr,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user