diff options
author | Doug Rabson <dfr@rabson.org> | 2022-08-26 10:04:18 +0100 |
---|---|---|
committer | Doug Rabson <dfr@rabson.org> | 2022-08-30 11:23:58 +0100 |
commit | 39880670cdde8482baf69e6a0f98b33bf34669f3 (patch) | |
tree | 248bd711f63e9a7ee8a3f53502483351b1f74f8c /pkg/specgen/generate/oci_unsupported.go | |
parent | 0166feef2a0205967eb95867a7d953f9171b27b7 (diff) | |
download | podman-39880670cdde8482baf69e6a0f98b33bf34669f3.tar.gz podman-39880670cdde8482baf69e6a0f98b33bf34669f3.tar.bz2 podman-39880670cdde8482baf69e6a0f98b33bf34669f3.zip |
specgen/generate: Move SpecGenToOCI, WeightDevices to oci_linux.go and add stubs.
Almost all of SpecGenToOCI deals with linux-specific aspects of the
runtime spec. Rather than try to factor this out piecemeal, I think it
is cleaner to move the whole function along with its implementation
helper functions. This also meams we don't need non-linux stubs for
functions called from oci_linux.go
[NO NEW TESTS NEEDED]
Signed-off-by: Doug Rabson <dfr@rabson.org>
Diffstat (limited to 'pkg/specgen/generate/oci_unsupported.go')
-rw-r--r-- | pkg/specgen/generate/oci_unsupported.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/pkg/specgen/generate/oci_unsupported.go b/pkg/specgen/generate/oci_unsupported.go new file mode 100644 index 000000000..3902f9c9f --- /dev/null +++ b/pkg/specgen/generate/oci_unsupported.go @@ -0,0 +1,24 @@ +//go:build !linux +// +build !linux + +package generate + +import ( + "context" + "errors" + + "github.com/containers/common/libimage" + "github.com/containers/common/pkg/config" + "github.com/containers/podman/v4/libpod" + "github.com/containers/podman/v4/pkg/specgen" + spec "github.com/opencontainers/runtime-spec/specs-go" +) + +// SpecGenToOCI returns the base configuration for the container. +func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runtime, rtc *config.Config, newImage *libimage.Image, mounts []spec.Mount, pod *libpod.Pod, finalCmd []string, compatibleOptions *libpod.InfraInherit) (*spec.Spec, error) { + return nil, errors.New("unsupported SpecGenToOCI") +} + +func WeightDevices(wtDevices map[string]spec.LinuxWeightDevice) ([]spec.LinuxWeightDevice, error) { + return []spec.LinuxWeightDevice{}, errors.New("unsupported WeightDevices") +} |