-
Notifications
You must be signed in to change notification settings - Fork 220
Handle ingress domain updates to default cluster ingress #48
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
Conversation
pravisankar
commented
Oct 15, 2018
- Delete duplicate finalizers section in default cluster ingress cr.
- Current code fetches needed info from installer configmap and tries to create default cluster ingress cr and ignores in case of already exists error. It won't handle the case where default cluster ingress cr exists but the ingress domain got changed. This pr handles this case.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pravisankar If they are not already assigned, you can assign the PR to them by writing 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 |
|
@openshift/sig-network-edge PTAL |
pkg/stub/handler.go
Outdated
| } | ||
| return false, true, nil | ||
| } | ||
| if oldci.Spec.IngressDomain != ci.Spec.IngressDomain { |
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 think you need to deference the pointers to do what you mean here: https://play.golang.org/p/N1-AT4yXgH-
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.
yes, thanks
0f3cc77 to
2c7012e
Compare
|
@ironcladlou updated, ptal |
|
How was it tested? |
ramr
left a comment
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.
changes look good - should handle both create/update cases ... though am not certain if the installer supports an update case.
|
/hold |
2c7012e to
46d0d0c
Compare
|
Tested both create and update cases on 4.0 cluster |
|
@openshift/sig-network-edge updated, PTAL |
| } | ||
| return false, nil, nil | ||
| } | ||
| if *oldci.Spec.IngressDomain != *ci.Spec.IngressDomain { |
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.
If either of this is nil will the function panic?
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.
Tried this https://play.golang.org/p/i0W49iA8Gjh and I didn't see an issue.
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.
Let me fix this
46d0d0c to
3f8735c
Compare
|
Would like to test this once #51 lands |
| if err == nil { | ||
| logrus.Infof("created default cluster ingress %s/%s", ci.Namespace, ci.Name) | ||
| changed, nci, err := checkClusterIngress(ci) | ||
| if err != nil { |
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 think this can use: clusterIngressStatusEqual
from PR: #38
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.
Maybe not clusterIngressStatusEqual, but the part that compares .loadBalancer.Ingress could be factored into a function that could be used both by checkClusterIngress and by clusterIngressStatusEqual. Now that #47 is merged, I'll rebase #38 Tuesday and factor out a LoadBalancerStatusEqual function. No need for that to block this PR though; I can change checkClusterIngress to use LoadBalancerStatusEqual if #48 merges before #38 is ready.
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.
Err, actually, checkClusterIngress is comparing only .spec.ingressDomain (a string) whereas clusterIngressStatusEqual is comparing .status.loadBalancer (a slice of a struct that has two string values), so there is really no opportunity for code re-use here as far as I see.
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 might be confused but if the LoadBalancerIngress struct are different as being checked in your PR [1] it means there's an update it should be enough for this purpouse.
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.
We're talking about
cluster-ingress-operator/pkg/stub/handler.go
Lines 111 to 117 in 3f8735c
| if ci.Spec.IngressDomain == nil { | |
| return false, nil, fmt.Errorf("invalid ingress domain for default cluster ingress %s/%s", ci.Namespace, ci.Name) | |
| } | |
| if oldci.Spec.IngressDomain == nil { | |
| oldci.Spec.IngressDomain = new(string) | |
| } | |
| if *oldci.Spec.IngressDomain != *ci.Spec.IngressDomain { |
*string values in order to determine whether the old ClusterIngress and new ClusterIngress specify the same ingress domain. clusterIngressStatusEqual compares []LoadBalancerIngress values, where LoadBalancerIngress is struct { IP, Hostname string }, in order to determine whether the old ClusterIngressStatus and new ClusterIngressStatus have the same ingresses.
|
@pravisankar: PR needs rebase. 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. |
|
@pravisankar: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
|
Superseded by #48 |
|
/close |
|
@ironcladlou: Closed this PR. 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. |