MCPcopy Create free account
hub / github.com/bufbuild/buf / buildImage

Method buildImage

private/buf/bufctl/controller.go:1189–1208  ·  view source on GitHub ↗
(
	ctx context.Context,
	moduleReadBucket bufmodule.ModuleReadBucket,
	functionOptions *functionOptions,
)

Source from the content-addressed store, hash-verified

1187}
1188
1189func (c *controller) buildImage(
1190 ctx context.Context,
1191 moduleReadBucket bufmodule.ModuleReadBucket,
1192 functionOptions *functionOptions,
1193) (bufimage.Image, error) {
1194 var options []bufimage.BuildImageOption
1195 if functionOptions.imageExcludeSourceInfo {
1196 options = append(options, bufimage.WithExcludeSourceCodeInfo())
1197 }
1198 image, err := bufimage.BuildImage(
1199 ctx,
1200 c.logger,
1201 moduleReadBucket,
1202 options...,
1203 )
1204 if err != nil {
1205 return nil, err
1206 }
1207 return filterImage(image, functionOptions, true)
1208}
1209
1210// buildTargetImageWithConfigs builds an image for each module in the workspace.
1211// This is used to associate LintConfig and BreakingConfig on a per-module basis.

Callers 2

getImageForWorkspaceMethod · 0.95

Calls 3

BuildImageFunction · 0.92
filterImageFunction · 0.70

Tested by

no test coverage detected