Add source policies for build

Build{x,kit} support passing in source policies via an (expirimental)
env var.
This change adds those policies to the build request.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2024-01-08 22:13:26 +00:00 committed by Nicolas De loof
parent 8d81b87513
commit 2bf2b22fbe
1 changed files with 21 additions and 15 deletions

View File

@ -410,6 +410,11 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se
}} }}
} }
sp, err := build.ReadSourcePolicy()
if err != nil {
return build.Options{}, err
}
return build.Options{ return build.Options{
Inputs: build.Inputs{ Inputs: build.Inputs{
ContextPath: service.Build.Context, ContextPath: service.Build.Context,
@ -432,6 +437,7 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se
Ulimits: toUlimitOpt(service.Build.Ulimits), Ulimits: toUlimitOpt(service.Build.Ulimits),
Session: sessionConfig, Session: sessionConfig,
Allow: allow, Allow: allow,
SourcePolicy: sp,
}, nil }, nil
} }