Skip to content
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

Fix a bug in Ingress update handler #3633

Merged
merged 1 commit into from
Jan 8, 2019

Conversation

wayt
Copy link
Contributor

@wayt wayt commented Jan 7, 2019

What this PR does / why we need it:
As discussed #3586 (comment)
Changes to annotation kubernetes.io/ingress.classand .spec.rules / .spec.backend were not correctly handled.

If the new value wasn't valid, the old Ingress was kept and updated instead of being deleted.

This was introduced in #3474 (@aledbf can you confirm?).

New tests have been added to prevent future regression.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 7, 2019
@wayt
Copy link
Contributor Author

wayt commented Jan 7, 2019

/assign @ElvinEfendi

You'll probably want to include that in 0.22.0 release.

@aledbf
Copy link
Member

aledbf commented Jan 7, 2019

This was introduced in #3474 (@aledbf can you confirm?).

Yes, this bug was introduced in the mentioned PR

@wayt wayt force-pushed the ingress-update-handler branch from fc3842a to 1eb9079 Compare January 7, 2019 20:43
f.EnsureIngress(ing)

f.WaitForNginxServer(invalidHost, func(cfg string) bool {
return strings.Contains(cfg, "server_name foo")
Copy link
Member

Choose a reason for hiding this comment

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

If the ingress is not valid, this configuration will never be generated.

Copy link
Member

Choose a reason for hiding this comment

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

this should be:

f.WaitForNginxConfiguration(func(cfg string) bool {
	return !strings.Contains(cfg, "server_name foo")
})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's true 😕 but I managed to have it pass the e2e test locally. I'll check that out. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be good now 👍

@wayt wayt force-pushed the ingress-update-handler branch from 1eb9079 to 3fa8395 Compare January 8, 2019 14:29
@aledbf
Copy link
Member

aledbf commented Jan 8, 2019

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 8, 2019
@ElvinEfendi
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 8, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, ElvinEfendi, wayt

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot merged commit c31939a into kubernetes:master Jan 8, 2019
@ElvinEfendi ElvinEfendi deleted the ingress-update-handler branch January 8, 2019 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants