OCPBUGS-2436: Revert "Revert "[AWS] Add LB Type in the infrastructure cluster object via install-config yaml"" and fix OCPBUGS-2436#6491
Conversation
…t via install-config yaml"" This reverts commit 98beea1.
pkg/asset/manifests/ingress.go
Outdated
There was a problem hiding this comment.
Is there concern with leaving ingress.spec.LoadBalancer.Platform.Type as empty "" if the install config.AWS.LBType is not configured?
There was a problem hiding this comment.
the const type defined is either Classic or NLB. So "" shall not be allowed to add in the ingressconfig for the LBType.
There was a problem hiding this comment.
The ingress operator should handle this case without issue, but we can set an explicit default to "Classic" if that makes more sense to do.
There was a problem hiding this comment.
But you can't leave it as "" as only two values are allowed i.e Classic and NLB. I don't think setting Classic in Ingress.Spec.Loadbalancer is needed as it is optional.
There was a problem hiding this comment.
Question about handling the LBType not being set was originally raised here: fbd2ea0#r971049072.
What happens when the manifest is created with LBType value is set to "Classic" or "NLB" initially on day 0 and the customer updates just the LBType field to "" day 2 keeping everything else in the manifest the same? Does the ingress controller be updated to take care of this?
There was a problem hiding this comment.
What happens when the manifest is created with LBType value is set to "Classic" or "NLB" initially on day 0 and the customer updates just the LBType field to "" day 2 keeping everything else in the manifest the same? Does the ingress controller be updated to take care of this?
The ingress operator preserves the LB type that was specified or defaulted when the ingresscontroller was created.
|
#6490 has merged. |
|
/payload-job periodic-ci-openshift-release-master-nightly-4.12-e2e-aws-sdn-serial |
|
@stbenjam: trigger 1 job(s) for the /payload-(job|aggregate) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/dee3c720-4e3b-11ed-8442-8598813a5e97-0 |
|
@Miciah: This pull request references Jira Issue OCPBUGS-2436, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (shaozhan@redhat.com), skipping review request. The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
pkg/asset/manifests/ingress.go
Outdated
There was a problem hiding this comment.
I think we shall check if it set to NLB or Classic
There was a problem hiding this comment.
Is there validation somewhere to make sure that the value of LBType when set is either "Classic" or "NLB"? If not, I think it should be added to make sure we are not passing also some random string within this manifest.
There was a problem hiding this comment.
Are the unit tests that I added sufficient?
There was a problem hiding this comment.
Yes, they are sufficient given the latest implementation creates the manifest always with LBType values "Classic/NLB".
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: patrickdillon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| expectedIngressAWSLBType: configv1.Classic, | ||
| expectedIngressPlatformType: configv1.AWSPlatformType, | ||
| }, | ||
| { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
This should be covered in the latest push.
| * "NLB": A Network Load Balancer that makes routing decisions | ||
| at the transport layer (TCP/SSL). See the following for additional | ||
| details: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#nlb' | ||
| type: string |
There was a problem hiding this comment.
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.
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.go to say that this field is optional, in which case the default is "Classic".
There was a problem hiding this comment.
I updated the godoc and ran go1.19 generate ./... to regenerate data/data/install.openshift.io_installconfigs.yaml.
There was a problem hiding this comment.
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.
|
@Miciah here's the unit test I came up with. Feel free to modify as you see fit: |
afcc85b to
8e7d76b
Compare
|
@Miciah: This pull request references Jira Issue OCPBUGS-2436, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (shaozhan@redhat.com), skipping review request. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
b3a79da to
ebb7219
Compare
When generating the ingresses.config.openshift.io/cluster manifest on AWS,
always set spec.loadBalancer.platform.aws.type even if the install-config
lbType is nonempty.
Before this commit, if lbType was empty, the installer generated a manifest
with the following:
loadBalancer:
platform:
aws: {}
type: AWS
Whereas loadBalancer, platform, and aws are optional fields, the type
subfield of the aws field is required. As a consequence, the cluster
bootstrap would fail with the following error:
"cluster-ingress-02-config.yml": failed to create ingresses.v1.config.openshift.io/cluster -n : Ingress.config.openshift.io "cluster" is invalid: spec.loadBalancer.platform.aws.type: Required value
This commit ensures that the installer doesn't generate an invalid ingress
manifest when lbType is empty.
Follow-up to commit 5d12adc.
This commit fixes bug OCPBUGS-2436.
https://issues.redhat.com/browse/OCPBUGS-2436
* pkg/asset/manifests/ingress.go (generateClusterConfig): Always set
spec.loadBalancer.platform.aws.type when the platform is AWS.
* pkg/asset/manifests/ingress_test.go
(TestGenerateIngerssDefaultPlacement): Update test cases to expect
spec.loadBalancer.platform.aws.type to default to "Classic" on AWS.
* pkg/types/aws/platform.go (Platform): Update godoc to make it clear that
LBType is optional and defaults to "Classic".
* pkg/explain/printer_test.go (Test_PrintFields): Update.
* data/data/install.openshift.io_installconfigs.yaml: Regenerate.
ebb7219 to
1a71334
Compare
|
|
|
/lgtm |
|
issue does not seem related to PR so will /retest-required |
|
/retest-required |
1 similar comment
|
/retest-required |
@mfojtik The PR to revert has already merged #6490. So, CIs 2e-serial-aws and e2e-upgrade should be passing. This PR is adding the original changes (in #6478) back in with some fixes. |
|
@Miciah: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/hold Revision 1a71334 was retested 3 times: holding |
|
/retest-required |
|
/hold cancel |
|
@Miciah: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-2436 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This commit reverts #6490 (which reverted #6478) and incorporates #6489 to fix the issue that necessitated the initial reversion.
Revert "Revert "[AWS] Add LB Type in the infrastructure cluster object via install-config yaml""
This reverts #6490.
Fix ingress config with empty
lbTypeon AWSWhen generating the
ingresses.config.openshift.io/clustermanifest on AWS, always setspec.loadBalancer.platform.aws.typeeven if the install-configlbTypeis nonempty.Before this PR, if
lbTypewas empty, the installer generated a manifest with the following:Whereas
loadBalancer,platform, andawsare optional fields, thetypesubfield of theawsfield is required. As a consequence, the cluster bootstrap would fail with the following error:This PR ensures that the installer doesn't generate an invalid ingress manifest when
lbTypeis empty.Follow-up to #6478.
pkg/asset/manifests/ingress.go(generateClusterConfig): Always setspec.loadBalancer.platform.aws.typewhen the platform is AWS.pkg/asset/manifests/ingress_test.go(TestGenerateIngerssDefaultPlacement): Update test cases to expectspec.loadBalancer.platform.aws.typeto default to "Classic" on AWS.