mirror of
https://github.com/containers/podman.git
synced 2025-10-12 16:56:32 +08:00
Use machine image as specified in containers.conf
For podman machine init, deprecate the --image-path option for --image. --image now accepts the correct image from containers.conf Also, add the ability to specify an OCI image from the --image flag using the docker:// transport. Signed-off-by: Ashley Cui <acui@redhat.com>
This commit is contained in:
@ -25,6 +25,7 @@ import (
|
||||
|
||||
const (
|
||||
// TODO This is temporary until we decide on a proper image name
|
||||
// Also should be moved into c/common once stabilized
|
||||
artifactRegistry = "quay.io"
|
||||
artifactRepo = "baude"
|
||||
artifactImageName = "stage-podman-machine-image"
|
||||
@ -71,7 +72,7 @@ type DiskArtifactOpts struct {
|
||||
|
||||
*/
|
||||
|
||||
func NewOCIArtifactPull(ctx context.Context, dirs *define.MachineDirs, vmName string, vmType define.VMType, finalPath *define.VMFile) (*OCIArtifactDisk, error) {
|
||||
func NewOCIArtifactPull(ctx context.Context, dirs *define.MachineDirs, endpoint string, vmName string, vmType define.VMType, finalPath *define.VMFile) (*OCIArtifactDisk, error) {
|
||||
var (
|
||||
arch string
|
||||
)
|
||||
@ -91,12 +92,17 @@ func NewOCIArtifactPull(ctx context.Context, dirs *define.MachineDirs, vmName st
|
||||
diskType: vmType.String(),
|
||||
os: machineOS,
|
||||
}
|
||||
|
||||
if endpoint == "" {
|
||||
endpoint = fmt.Sprintf("docker://%s/%s/%s:%s", artifactRegistry, artifactRepo, artifactImageName, artifactVersion.majorMinor())
|
||||
}
|
||||
|
||||
ociDisk := OCIArtifactDisk{
|
||||
ctx: ctx,
|
||||
dirs: dirs,
|
||||
diskArtifactOpts: &diskOpts,
|
||||
finalPath: finalPath.GetPath(),
|
||||
imageEndpoint: fmt.Sprintf("docker://%s/%s/%s:%s", artifactRegistry, artifactRepo, artifactImageName, artifactVersion.majorMinor()),
|
||||
imageEndpoint: endpoint,
|
||||
machineVersion: artifactVersion,
|
||||
name: vmName,
|
||||
pullOptions: &PullOptions{},
|
||||
|
Reference in New Issue
Block a user