Skip to content

Commit

Permalink
feat: arm containerdisks
Browse files Browse the repository at this point in the history
Build and push multiple containerdisks with
different CPU architectures (x64 or aarch64).

Jira-Url: https://issues.redhat.com/browse/CNV-38597
Signed-off-by: Ben Oukhanov <[email protected]>
  • Loading branch information
codingben committed Feb 21, 2024
1 parent adba148 commit fcad9d7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

const (
LabelShaSum = "shasum"
ImageArchitecture = "amd64"
)

func ContainerDiskConfig(checksum string, additionalLabels map[string]string) v1.Config {
Expand All @@ -34,7 +33,7 @@ func ContainerDiskConfig(checksum string, additionalLabels map[string]string) v1
return v1.Config{Labels: labels, Env: env}
}

func ContainerDisk(imgPath string, config v1.Config) (v1.Image, error) {
func ContainerDisk(imgPath, imageArchitecture string, config v1.Config) (v1.Image, error) {
img := empty.Image
layer, err := tarball.LayerFromOpener(StreamLayerOpener(imgPath))
if err != nil {
Expand All @@ -52,7 +51,7 @@ func ContainerDisk(imgPath string, config v1.Config) (v1.Image, error) {
}

// Modify the config file
cf.Architecture = ImageArchitecture
cf.Architecture = imageArchitecture
cf.Config = config

img, err = mutate.ConfigFile(img, cf)
Expand Down

0 comments on commit fcad9d7

Please sign in to comment.