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

Endpoints should stay pluralized #1690

Merged
merged 2 commits into from
Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### 4.4-SNAPSHOT
Bugs
* Fix #1690: Endpoints is always pluralized

Improvements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ else if (kind.equalsIgnoreCase("PodSecurityPolicies") ||
kind.equalsIgnoreCase("NetworkPolicies")){
kind = kind.substring(0,kind.length() - 3) + "y";
}
else if (kind.equalsIgnoreCase("securityContextConstraints")){
else if (kind.equalsIgnoreCase("securityContextConstraints") ||
kind.equalsIgnoreCase("endpoints")){
// do nothing
// because its a case which is ending with s but its name is
// like that, it is not plural
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ public void shouldHandleIngress() {
Assert.assertTrue("Expected " + attributes + " to match " + expected, attributes.matches(expected));
}

@Test
public void shouldHandleEndpoints() {
KubernetesAttributesExtractor extractor = new KubernetesAttributesExtractor();
AttributeSet attributes = extractor.extract("/api/v1/namespaces/myns/endpoints");

AttributeSet expected = new AttributeSet();
expected = expected.add(new Attribute("kind", "endpoints"));
expected = expected.add(new Attribute("namespace", "myns"));
Assert.assertTrue("Expected " + attributes + " to match " + expected, attributes.matches(expected));
}

@Test
public void shouldHandleIngresses() {
KubernetesAttributesExtractor extractor = new KubernetesAttributesExtractor();
Expand Down