Skip to content

Commit

Permalink
*: enable s390x bootimage support
Browse files Browse the repository at this point in the history
  • Loading branch information
crawford committed Jan 16, 2020
1 parent ceabdbe commit b7d7474
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
16 changes: 9 additions & 7 deletions hack/update-rhcos-bootimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

parser = argparse.ArgumentParser()
parser.add_argument("meta", action='store')
parser.add_argument("arch", action='store', choices=['amd64'])
parser.add_argument("arch", action='store', choices=['amd64', 's390x'])
args = parser.parse_args()

metadata_dir = os.path.join(os.path.dirname(sys.argv[0]), "../data/data")
Expand All @@ -25,13 +25,15 @@
for k in ['images', 'buildid', 'oscontainer',
'ostree-commit', 'ostree-version',
'azure', 'gcp']:
newmeta[k] = meta[k]
newmeta['amis'] = {
entry['name']: {
'hvm': entry['hvm'],
if meta.get(k):
newmeta[k] = meta[k]
if meta.get(k):
newmeta['amis'] = {
entry['name']: {
'hvm': entry['hvm'],
}
for entry in meta['amis']
}
for entry in meta['amis']
}
newmeta['baseURI'] = urllib.parse.urljoin(args.meta, '.')

with open(os.path.join(metadata_dir, f"rhcos-{args.arch}.json"), 'w') as f:
Expand Down
2 changes: 2 additions & 0 deletions pkg/types/machinepools.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ type Architecture string
const (
// ArchitectureAMD64 indicates AMD64 (x86_64).
ArchitectureAMD64 = "amd64"
// ArchitectureS390X indicates s390x (IBM System Z).
ArchitectureS390X = "s390x"
)

// MachinePool is a pool of machines to be installed.
Expand Down
10 changes: 9 additions & 1 deletion pkg/types/validation/installconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,15 @@ func TestValidateInstallConfig(t *testing.T) {
return c
}(),
},
// TODO(crawford): add a test to validate that homogeneous clusters are enforced once an additional architecture is added
{
name: "cluster is not heteregenous",
installConfig: func() *types.InstallConfig {
c := validInstallConfig()
c.Compute[0].Architecture = types.ArchitectureS390X
return c
}(),
expectedError: `^compute\[0\].architecture: Invalid value: "s390x": heteregeneous multi-arch is not supported; compute pool architecture must match control plane$`,
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions pkg/types/validation/machinepools.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var (

validArchitectures = map[types.Architecture]bool{
types.ArchitectureAMD64: true,
types.ArchitectureS390X: true,
}

validArchitectureValues = func() []string {
Expand Down

0 comments on commit b7d7474

Please sign in to comment.