Create pkg/machine/ignition package

Moves all of the ignitionfiles out of the `machine` package and into
its own called `ignition`. This required `VMType` to get moved out of
the `machine` package and into the `define` package in order to prevent
a circular dependency.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
This commit is contained in:
Jake Correnti
2023-11-14 13:39:52 -05:00
parent de797e5724
commit c728eeb39e
33 changed files with 259 additions and 173 deletions

View File

@ -187,7 +187,7 @@ func composeDockerHost() (string, error) {
if info.State != define.Running {
return "", fmt.Errorf("machine %s is not running but in state %s", item.Name, info.State)
}
if machineProvider.VMType() == machine.WSLVirt {
if machineProvider.VMType() == define.WSLVirt {
if info.ConnectionInfo.PodmanPipe == nil {
return "", errors.New("pipe of machine is not set")
}

View File

@ -11,6 +11,7 @@ import (
"github.com/containers/podman/v4/cmd/podman/registry"
"github.com/containers/podman/v4/libpod/events"
"github.com/containers/podman/v4/pkg/machine"
"github.com/containers/podman/v4/pkg/machine/define"
"github.com/spf13/cobra"
)
@ -141,7 +142,7 @@ func initMachine(cmd *cobra.Command, args []string) error {
}
// The vmtype names need to be reserved and cannot be used for podman machine names
if _, err := machine.ParseVMType(initOpts.Name, machine.UnknownVirt); err == nil {
if _, err := define.ParseVMType(initOpts.Name, define.UnknownVirt); err == nil {
return fmt.Errorf("cannot use %q for a machine name", initOpts.Name)
}