-
Notifications
You must be signed in to change notification settings - Fork 1.5k
MCO-2200: Add day-0 dual streams support for ABI install flow #10481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,8 +134,13 @@ func validatePlatform(ctx context.Context, meta *Metadata, fldPath *field.Path, | |
| } | ||
|
|
||
| func validateAMI(ctx context.Context, meta *Metadata, config *types.InstallConfig) field.ErrorList { | ||
| osImageStream := config.OSImageStream | ||
| if osImageStream == "" { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Surprising to see this AWS change in a PR about ABI. I think this should be set in https://github.com/openshift/installer/blob/main/pkg/types/defaults/installconfig.go rather than here. That would eliminate a lot of places where this same logic is repeated.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zaneb agree. In fact, the switchover PR has changed this interface to avoid doing this |
||
| osImageStream = rhcos.DefaultOSImageStream | ||
| } | ||
|
|
||
| // accept AMI from the rhcos stream metadata | ||
| if rhcos.AMIRegions(config.ControlPlane.Architecture, config.OSImageStream).Has(config.Platform.AWS.Region) { | ||
| if rhcos.AMIRegions(config.ControlPlane.Architecture, osImageStream).Has(config.Platform.AWS.Region) { | ||
| return nil | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,7 +66,11 @@ func ValidateForProvisioning(ic *types.InstallConfig) error { | |
|
|
||
| // validate PreloadedOSImageName if configured | ||
| if p.PreloadedOSImageName != "" { | ||
| err = validatePreloadedImage(ctx, nc, p, ic.OSImageStream) | ||
| osImageStream := ic.OSImageStream | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: this could become a smart getter in installConfig asset
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment somehow relates to this one: https://github.com/openshift/installer/pull/10481/changes#r3280912958 |
||
| if osImageStream == "" { | ||
| osImageStream = rhcos.DefaultOSImageStream | ||
| } | ||
| err = validatePreloadedImage(ctx, nc, p, osImageStream) | ||
| if err != nil { | ||
| errList = append(errList, field.Invalid(parentPath.Child("preloadedOSImageName"), p.PreloadedOSImageName, fmt.Sprintf("fail to validate the preloaded rhcos image: %v", err))) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,8 @@ import ( | |
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
|
|
||
| "github.com/openshift/installer/pkg/types" | ||
| ) | ||
|
|
||
| func TestBaseIso(t *testing.T) { | ||
|
|
@@ -69,7 +71,7 @@ func TestBaseIso(t *testing.T) { | |
| isoBaseVersion: ocReleaseImage, | ||
| baseIsoFileName: ocBaseIsoFilename, | ||
| baseIsoError: tc.getIsoError, | ||
| }) | ||
| }, "") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should never pass |
||
| filename, err := fetcher.GetBaseISOFilename(context.Background(), "") | ||
|
|
||
| if tc.expectedError == "" { | ||
|
|
@@ -88,14 +90,14 @@ type mockRelease struct { | |
| baseIsoError error | ||
| } | ||
|
|
||
| func (m *mockRelease) GetBaseIso(architecture string) (string, error) { | ||
| func (m *mockRelease) GetBaseIso(architecture string, osImageStream types.OSImageStream) (string, error) { | ||
| if m.baseIsoError != nil { | ||
| return "", m.baseIsoError | ||
| } | ||
| return m.baseIsoFileName, nil | ||
| } | ||
|
|
||
| func (m *mockRelease) GetBaseIsoVersion(architecture string) (string, error) { | ||
| func (m *mockRelease) GetBaseIsoVersion(architecture string, osImageStream types.OSImageStream) (string, error) { | ||
| return m.isoBaseVersion, nil | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.