Update the osbuild/images to the version which introduces "dot notation" for distro release versions. - Replace all uses of distroregistry by distrofactory. - Delete local version of reporegistry and use the one from the osbuild/images. - Weldr: unify `createWeldrAPI()` and `createWeldrAPI2()` into a single `createTestWeldrAPI()` function`. - store/fixture: rework fixtures to allow overriding the host distro name and host architecture name. A cleanup function to restore the host distro and arch names is always part of the fixture struct. - Delete `distro_mock` package, since it is no longer used. - Bump the required version of osbuild to 98, because the OSCAP customization is using the 'compress_results' stage option, which is not available in older versions of osbuild. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
43 lines
1.3 KiB
Go
43 lines
1.3 KiB
Go
//go:build windows
|
|
|
|
package wclayer
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
|
|
"github.com/Microsoft/hcsshim/internal/oc"
|
|
"go.opencensus.io/trace"
|
|
)
|
|
|
|
// ProcessBaseLayer post-processes a base layer that has had its files extracted.
|
|
// The files should have been extracted to <path>\Files.
|
|
func ProcessBaseLayer(ctx context.Context, path string) (err error) {
|
|
title := "hcsshim::ProcessBaseLayer"
|
|
ctx, span := oc.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
|
|
defer span.End()
|
|
defer func() { oc.SetSpanStatus(span, err) }()
|
|
span.AddAttributes(trace.StringAttribute("path", path))
|
|
|
|
err = processBaseImage(path)
|
|
if err != nil {
|
|
return &os.PathError{Op: title, Path: path, Err: err}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// ProcessUtilityVMImage post-processes a utility VM image that has had its files extracted.
|
|
// The files should have been extracted to <path>\Files.
|
|
func ProcessUtilityVMImage(ctx context.Context, path string) (err error) {
|
|
title := "hcsshim::ProcessUtilityVMImage"
|
|
ctx, span := oc.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
|
|
defer span.End()
|
|
defer func() { oc.SetSpanStatus(span, err) }()
|
|
span.AddAttributes(trace.StringAttribute("path", path))
|
|
|
|
err = processUtilityImage(path)
|
|
if err != nil {
|
|
return &os.PathError{Op: title, Path: path, Err: err}
|
|
}
|
|
return nil
|
|
}
|