added log message if image is considered not buildable
Some checks failed
release / prerequisites (push) Failing after 50s
release / build_sdks (dotnet) (push) Has been skipped
release / build_sdks (go) (push) Has been skipped
release / build_sdks (java) (push) Has been skipped
release / build_sdks (nodejs) (push) Has been skipped
release / build_sdks (python) (push) Has been skipped
release / test (dotnet) (push) Has been skipped
release / test (go) (push) Has been skipped
release / test (java) (push) Has been skipped
release / test (nodejs) (push) Has been skipped
release / test (python) (push) Has been skipped
release / test (yaml) (push) Has been skipped
release / publish (push) Has been skipped
release / publish_sdks (push) Has been skipped
release / publish_java_sdk (push) Has been skipped
release / publish-go-sdk (push) Has been skipped
release / dispatch_docs_build (push) Has been skipped
Some checks failed
release / prerequisites (push) Failing after 50s
release / build_sdks (dotnet) (push) Has been skipped
release / build_sdks (go) (push) Has been skipped
release / build_sdks (java) (push) Has been skipped
release / build_sdks (nodejs) (push) Has been skipped
release / build_sdks (python) (push) Has been skipped
release / test (dotnet) (push) Has been skipped
release / test (go) (push) Has been skipped
release / test (java) (push) Has been skipped
release / test (nodejs) (push) Has been skipped
release / test (python) (push) Has been skipped
release / test (yaml) (push) Has been skipped
release / publish (push) Has been skipped
release / publish_sdks (push) Has been skipped
release / publish_java_sdk (push) Has been skipped
release / publish-go-sdk (push) Has been skipped
release / dispatch_docs_build (push) Has been skipped
This commit is contained in:
@@ -68,7 +68,8 @@ type Image struct {
|
|||||||
|
|
||||||
// Annotate provides a description of the Image resource.
|
// Annotate provides a description of the Image resource.
|
||||||
func (i *Image) Annotate(a infer.Annotator) {
|
func (i *Image) Annotate(a infer.Annotator) {
|
||||||
a.Describe(&i, dedent(`
|
a.Describe(
|
||||||
|
&i, dedent(`
|
||||||
A Docker image built using buildx -- Docker's interface to the improved
|
A Docker image built using buildx -- Docker's interface to the improved
|
||||||
BuildKit backend.
|
BuildKit backend.
|
||||||
|
|
||||||
@@ -79,8 +80,8 @@ func (i *Image) Annotate(a infer.Annotator) {
|
|||||||
We will strive to keep APIs and behavior as stable as possible, but we
|
We will strive to keep APIs and behavior as stable as possible, but we
|
||||||
cannot guarantee stability until version 1.0.
|
cannot guarantee stability until version 1.0.
|
||||||
`)+
|
`)+
|
||||||
"\n\n"+_migration+
|
"\n\n"+_migration+
|
||||||
"\n\n"+_imageExamples,
|
"\n\n"+_imageExamples,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,7 +303,8 @@ type ImageState struct {
|
|||||||
func (is *ImageState) Annotate(a infer.Annotator) {
|
func (is *ImageState) Annotate(a infer.Annotator) {
|
||||||
is.ImageArgs.Annotate(a)
|
is.ImageArgs.Annotate(a)
|
||||||
|
|
||||||
a.Describe(&is.Digest, dedent(`
|
a.Describe(&is.Digest, dedent(
|
||||||
|
`
|
||||||
A SHA256 digest of the image if it was exported to a registry or
|
A SHA256 digest of the image if it was exported to a registry or
|
||||||
elsewhere.
|
elsewhere.
|
||||||
|
|
||||||
@@ -434,7 +436,13 @@ func (ia *ImageArgs) normalize(preview bool) ImageArgs {
|
|||||||
func (ia *ImageArgs) buildable() bool {
|
func (ia *ImageArgs) buildable() bool {
|
||||||
// We can build the given inputs if filtering unknowns is a no-op.
|
// We can build the given inputs if filtering unknowns is a no-op.
|
||||||
filtered := ia.normalize(true)
|
filtered := ia.normalize(true)
|
||||||
return reflect.DeepEqual(ia, &filtered)
|
equal := reflect.DeepEqual(ia, &filtered)
|
||||||
|
|
||||||
|
if !equal {
|
||||||
|
fmt.Printf("Not buildable:\n\tArgs => %v\n\tNormalize => %v", ia, &filtered)
|
||||||
|
}
|
||||||
|
|
||||||
|
return equal
|
||||||
}
|
}
|
||||||
|
|
||||||
// isExported returns true if the args include a registry export.
|
// isExported returns true if the args include a registry export.
|
||||||
@@ -499,13 +507,15 @@ func (ia ImageArgs) toBuild(
|
|||||||
if len(ia.Exports) == 0 && !ia.Push && !ia.Load {
|
if len(ia.Exports) == 0 && !ia.Push && !ia.Load {
|
||||||
provider.GetLogger(ctx).Warning(
|
provider.GetLogger(ctx).Warning(
|
||||||
"No exports were specified so the build will only remain in the local build cache. " +
|
"No exports were specified so the build will only remain in the local build cache. " +
|
||||||
"Use `push` to upload the image to a registry, or silence this warning with a `cacheonly` export.")
|
"Use `push` to upload the image to a registry, or silence this warning with a `cacheonly` export.",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(opts.Platforms) > 1 && len(opts.CacheTo) > 0 {
|
if len(opts.Platforms) > 1 && len(opts.CacheTo) > 0 {
|
||||||
provider.GetLogger(ctx).Warning(
|
provider.GetLogger(ctx).Warning(
|
||||||
"Caching doesn't work reliably with multi-platform builds (https://github.com/docker/buildx/discussions/1382). " +
|
"Caching doesn't work reliably with multi-platform builds (https://github.com/docker/buildx/discussions/1382). " +
|
||||||
"Instead, perform one cached build per platform and create an Index to join them all together.")
|
"Instead, perform one cached build per platform and create an Index to join them all together.",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &build{
|
return &build{
|
||||||
@@ -523,7 +533,8 @@ func (ia *ImageArgs) validate(supportsMultipleExports, preview bool) (controller
|
|||||||
|
|
||||||
if !supportsMultipleExports {
|
if !supportsMultipleExports {
|
||||||
if len(ia.Exports) > 1 {
|
if len(ia.Exports) > 1 {
|
||||||
multierr = errors.Join(multierr,
|
multierr = errors.Join(
|
||||||
|
multierr,
|
||||||
newCheckFailure(errors.New("multiple exports require a v0.13 buildkit daemon or newer"), "exports"),
|
newCheckFailure(errors.New("multiple exports require a v0.13 buildkit daemon or newer"), "exports"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -537,7 +548,8 @@ func (ia *ImageArgs) validate(supportsMultipleExports, preview bool) (controller
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
if len(ia.Exports) > 0 && (ia.Push || ia.Load) {
|
if len(ia.Exports) > 0 && (ia.Push || ia.Load) {
|
||||||
multierr = errors.Join(multierr,
|
multierr = errors.Join(
|
||||||
|
multierr,
|
||||||
newCheckFailure(errors.New("multiple exports require a v0.13 buildkit daemon or newer"), "exports"),
|
newCheckFailure(errors.New("multiple exports require a v0.13 buildkit daemon or newer"), "exports"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -778,7 +790,8 @@ func (i *Image) Update(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
req infer.UpdateRequest[ImageArgs, ImageState],
|
req infer.UpdateRequest[ImageArgs, ImageState],
|
||||||
) (infer.UpdateResponse[ImageState], error) {
|
) (infer.UpdateResponse[ImageState], error) {
|
||||||
resp, err := i.Create(ctx,
|
resp, err := i.Create(
|
||||||
|
ctx,
|
||||||
infer.CreateRequest[ImageArgs]{Name: req.ID, Inputs: req.Inputs, DryRun: req.DryRun},
|
infer.CreateRequest[ImageArgs]{Name: req.ID, Inputs: req.Inputs, DryRun: req.DryRun},
|
||||||
)
|
)
|
||||||
return infer.UpdateResponse[ImageState]{Output: resp.Output}, err
|
return infer.UpdateResponse[ImageState]{Output: resp.Output}, err
|
||||||
|
|||||||
Reference in New Issue
Block a user