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

Catch possible errors with incomplete Ingress objects #1041

Merged
merged 2 commits into from
May 30, 2019

Conversation

andresmgot
Copy link
Contributor

Fixes #1040

Ensure that an Ingress object has rules, paths and tls.hosts defined before processing them to avoid errors.

@@ -38,6 +38,27 @@ describe("GetURLItemFromIngress", () => {
tlsHosts: ["foo.bar"],
expectedURLs: ["https://foo.bar", "http://not-foo.bar"],
},
{
description: "it should ignore an ingress if it has no hosts",
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this still show an entry for the Ingress in the AccessURLTable, though without any clickable links? I think we'd still want to show that an Ingress exists, but that the hosts are not correctly defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, this test is misleading, hosts is not a valid field in an ingress so I am adding a test for the test code 😅

In any case, I have just realized two new cases: when an ingress has no rules and when a rule has no host. I am adding test cases for those. For the first it should return an error, for the second we should catch the host as a wildcard (not undefined).

@andresmgot andresmgot merged commit 8288c33 into vmware-tanzu:master May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Something went wrong when config ingress.
2 participants