Skip to content

Commit

Permalink
Add podman-executable type in metadata struct
Browse files Browse the repository at this point in the history
This new type was added by crc-org/snc#378
  • Loading branch information
guillaumerose committed Apr 19, 2021
1 parent 1893d6a commit a4efc95
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions pkg/crc/machine/bundle/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@ type DiskImage struct {
Format string `json:"format"`
}

type FileType string

const (
OcExecutable FileType = "oc-executable"
PodmanExecutable FileType = "podman-executable"
)

type FileListItem struct {
File
Type string `json:"type"`
Type FileType `json:"type"`
}

type DriverInfo struct {
Expand Down Expand Up @@ -102,7 +109,17 @@ func (bundle *CrcBundleInfo) GetKubeConfigPath() string {

func (bundle *CrcBundleInfo) GetOcPath() string {
for _, file := range bundle.Storage.Files {
if file.Type == "oc-executable" {
if file.Type == OcExecutable {
return bundle.resolvePath(file.Name)
}
}

return ""
}

func (bundle *CrcBundleInfo) GetPodmanPath() string {
for _, file := range bundle.Storage.Files {
if file.Type == PodmanExecutable {
return bundle.resolvePath(file.Name)
}
}
Expand Down

0 comments on commit a4efc95

Please sign in to comment.