Prune FCOS related code

Given the switch to pulling oci artifacts for podman, we no longer need
a fair bit of fedora coreos code for automatically downloading images.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
Brent Baude
2024-02-13 14:35:37 -06:00
parent 5fc351a67a
commit 1f64ae10f6
14 changed files with 93 additions and 887 deletions

View File

@ -5,9 +5,10 @@ import (
"fmt"
"io"
"net/http"
"runtime"
"github.com/containers/podman/v5/pkg/machine"
"github.com/containers/podman/v5/pkg/machine/define"
"github.com/containers/podman/v5/pkg/machine/vmconfigs"
"github.com/coreos/stream-metadata-go/fedoracoreos"
"github.com/coreos/stream-metadata-go/stream"
"github.com/sirupsen/logrus"
@ -49,11 +50,15 @@ func GetDownload(vmType define.VMType) (string, error) {
format = "qcow2.xz"
}
arch, ok := fcosstable.Architectures[machine.GetFcosArch()]
arch, err := vmconfigs.NormalizeMachineArch(runtime.GOARCH)
if err != nil {
return "", err
}
fcosArch, ok := fcosstable.Architectures[arch]
if !ok {
return "", fmt.Errorf("unable to pull VM image: no targetArch in stream")
}
upstreamArtifacts := arch.Artifacts
upstreamArtifacts := fcosArch.Artifacts
if upstreamArtifacts == nil {
return "", fmt.Errorf("unable to pull VM image: no artifact in stream")
}