Skip to content

Conversation

@pravisankar
Copy link

  • 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.

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 15, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pravisankar
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: ironcladlou

If they are not already assigned, you can assign the PR to them by writing /assign @ironcladlou in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pravisankar
Copy link
Author

@openshift/sig-network-edge PTAL

}
return false, true, nil
}
if oldci.Spec.IngressDomain != ci.Spec.IngressDomain {
Copy link
Contributor

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-

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, thanks

@pravisankar pravisankar force-pushed the handle-default-cr-fixes branch from 0f3cc77 to 2c7012e Compare October 15, 2018 23:46
@pravisankar
Copy link
Author

@ironcladlou updated, ptal

@ironcladlou
Copy link
Contributor

How was it tested?

Copy link
Contributor

@ramr ramr left a 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.

@ramr
Copy link
Contributor

ramr commented Oct 16, 2018

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 16, 2018
@pravisankar pravisankar force-pushed the handle-default-cr-fixes branch from 2c7012e to 46d0d0c Compare October 16, 2018 19:15
@pravisankar
Copy link
Author

Tested both create and update cases on 4.0 cluster
/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 16, 2018
@pravisankar
Copy link
Author

@openshift/sig-network-edge updated, PTAL

}
return false, nil, nil
}
if *oldci.Spec.IngressDomain != *ci.Spec.IngressDomain {
Copy link
Contributor

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?

Copy link
Author

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me fix this

@pravisankar pravisankar force-pushed the handle-default-cr-fixes branch from 46d0d0c to 3f8735c Compare October 16, 2018 19:56
@ironcladlou
Copy link
Contributor

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 {
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

[1] https://github.com/openshift/cluster-ingress-operator/pull/38/files#diff-9ae69f8dcadd8df44e0b10265f3a91a8R107

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're talking about

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 {
, right? There, we are comparing *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.

@openshift-bot
Copy link
Contributor

@pravisankar: PR needs rebase.

Details

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.

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 6, 2018
@openshift-ci-robot
Copy link
Contributor

@pravisankar: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/rhel-images 3f8735c link /test rhel-images

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.

Details

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. I understand the commands that are listed here.

@ironcladlou
Copy link
Contributor

Superseded by #48

@ironcladlou
Copy link
Contributor

/close

@openshift-ci-robot
Copy link
Contributor

@ironcladlou: Closed this PR.

Details

In response to this:

/close

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.

@Miciah
Copy link
Contributor

Miciah commented Dec 19, 2018

Superseded by #48

For the record, I think that was supposed to be #89.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants