-
Notifications
You must be signed in to change notification settings - Fork 1.5k
OCPBUGS-2436: Revert "Revert "[AWS] Add LB Type in the infrastructure cluster object via install-config yaml"" and fix OCPBUGS-2436 #6491
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,11 +53,13 @@ func installConfigFromTopologies(t *testing.T, options []icOption, | |
|
|
||
| func TestGenerateIngerssDefaultPlacement(t *testing.T) { | ||
| cases := []struct { | ||
| name string | ||
| installConfigBuildOptions []icOption | ||
| controlPlaneTopology configv1.TopologyMode | ||
| infrastructureTopology configv1.TopologyMode | ||
| expectedIngressPlacement configv1.DefaultPlacement | ||
| name string | ||
| installConfigBuildOptions []icOption | ||
| controlPlaneTopology configv1.TopologyMode | ||
| infrastructureTopology configv1.TopologyMode | ||
| expectedIngressPlacement configv1.DefaultPlacement | ||
| expectedIngressAWSLBType configv1.AWSLBType | ||
| expectedIngressPlatformType configv1.PlatformType | ||
| }{ | ||
| { | ||
| // AWS currently uses a load balancer even on single-node, so the | ||
|
|
@@ -91,6 +93,24 @@ func TestGenerateIngerssDefaultPlacement(t *testing.T) { | |
| infrastructureTopology: configv1.HighlyAvailableTopologyMode, | ||
| expectedIngressPlacement: configv1.DefaultPlacementWorkers, | ||
| }, | ||
| { | ||
| name: "test setting of aws lb type to NLB", | ||
| installConfigBuildOptions: []icOption{icBuild.withLBType(configv1.NLB)}, | ||
| controlPlaneTopology: configv1.HighlyAvailableTopologyMode, | ||
| infrastructureTopology: configv1.HighlyAvailableTopologyMode, | ||
| expectedIngressPlacement: configv1.DefaultPlacementWorkers, | ||
| expectedIngressAWSLBType: configv1.NLB, | ||
| expectedIngressPlatformType: configv1.AWSPlatformType, | ||
| }, | ||
| { | ||
| name: "test setting of aws lb type to Classic", | ||
| installConfigBuildOptions: []icOption{icBuild.withLBType(configv1.Classic)}, | ||
| controlPlaneTopology: configv1.HighlyAvailableTopologyMode, | ||
| infrastructureTopology: configv1.HighlyAvailableTopologyMode, | ||
| expectedIngressPlacement: configv1.DefaultPlacementWorkers, | ||
| expectedIngressAWSLBType: configv1.Classic, | ||
| expectedIngressPlatformType: configv1.AWSPlatformType, | ||
| }, | ||
| { | ||
|
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. I had originally requested an update to unit tests to test for all input values here: fbd2ea0#r971050233. As a result a test was added for when the LBType is set to "Classic". Should there be a test case here for the case when the install-config contains "" as LBType for the scenario when the LBType value is not spcifically set by the customer?
Contributor
Author
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 should be covered in the latest push. |
||
| name: "none-platform single node with 0 or 1 day-1 workers", | ||
| installConfigBuildOptions: []icOption{icBuild.forNone()}, | ||
|
|
@@ -154,6 +174,10 @@ func TestGenerateIngerssDefaultPlacement(t *testing.T) { | |
| return | ||
| } | ||
| assert.Equal(t, tc.expectedIngressPlacement, actualIngress.Status.DefaultPlacement) | ||
| if len(tc.expectedIngressAWSLBType) != 0 && len(tc.expectedIngressPlatformType) != 0 { | ||
| assert.Equal(t, tc.expectedIngressAWSLBType, actualIngress.Spec.LoadBalancer.Platform.AWS.Type) | ||
| assert.Equal(t, tc.expectedIngressPlatformType, actualIngress.Spec.LoadBalancer.Platform.Type) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Text here is a little misleading to reviewers and potentially users. It says that Valid values are "Classic" and "NLB". Some suggestions: Can we say "LBType is an optional configuration that allows the user..." ? Can we talk about the unset case before the values that it can be set to?
Then we can talk about the values that are allowed when the value is actually set. Right now, we talk about behavior when set, then unset and values when it is set.
Also, can we use this opportunity to fix the nit about double spaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this a generated file? I don't see how we can fix the double spaces. I can add some text in
pkg/types/aws/platform.goto say that this field is optional, in which case the default is "Classic".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the godoc and ran
go1.19 generate ./...to regeneratedata/data/install.openshift.io_installconfigs.yaml.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just did another push in which I removed indentation for the list items in the godoc in order to prevent the generated CRD yaml from having those double-spaces.