Skip to content

Commit

Permalink
Merge pull request #1690 from mathbruyen/bugfix/plural-endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
fusesource-ci authored Aug 6, 2019
2 parents fe91996 + a62bf0c commit 736ac8d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
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

0 comments on commit 736ac8d

Please sign in to comment.