Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkg/asset/manifests/mco.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ func awsBootImages(ic *types.InstallConfig) (cpImg bool, wImg bool) {
cpImg = true
}

if w := ic.Compute; len(w) > 0 && w[0].Platform.AWS != nil && w[0].Platform.AWS.AMIID != "" {
wImg = true
// On AWS, we need to check both compute and edge compute machine pool.
for _, computeMP := range ic.Compute {
if awsPlatform := computeMP.Platform.AWS; awsPlatform != nil && awsPlatform.AMIID != "" {
wImg = true
}
}
return
}
Expand Down
26 changes: 26 additions & 0 deletions pkg/asset/manifests/mco_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ func TestGenerateMCO(t *testing.T) {
installConfig: icBuild.build(icBuild.withAWSComputeAMI()),
expectedMCO: mcoBuild.build(mcoBuild.withComputeBootImageMgmtDisabled()),
},
{
name: "aws with a custom edge compute image disables mco management",
installConfig: icBuild.build(icBuild.withAWSEdgeComputeAMI()),
expectedMCO: mcoBuild.build(mcoBuild.withComputeBootImageMgmtDisabled()),
},
{
name: "gcp with a custom compute image disables mco management",
installConfig: icBuild.build(icBuild.withGCPComputeAMI()),
Expand Down Expand Up @@ -126,6 +131,27 @@ func (b icBuildNamespace) withAWSComputeAMI() icOption {
}
}

func (b icBuildNamespace) withAWSEdgeComputeAMI() icOption {
return func(ic *types.InstallConfig) {
b.forAWS()(ic)
ic.Compute = []types.MachinePool{
{
Platform: types.MachinePoolPlatform{
AWS: &aws.MachinePool{},
},
},
{
Name: "edge",
Platform: types.MachinePoolPlatform{
AWS: &aws.MachinePool{
AMIID: "ami-xxxxxxxxxxxxx",
},
},
},
}
}
}

func (b icBuildNamespace) withGCPComputeAMI() icOption {
return func(ic *types.InstallConfig) {
b.forGCP()(ic)
Expand Down