@Test public void shouldHandleKindWithoutVersion() { KubernetesAttributesExtractor extractor = new KubernetesAttributesExtractor(); AttributeSet attributes = extractor.extract("/api/pods"); AttributeSet expected = new AttributeSet(); expected = expected.add(new Attribute("kind", "pod")); assertTrue(attributes.matches(expected)); }
@Override public AttributeSet extract(String s) { if (s == null || s.isEmpty()) { return new AttributeSet(); } HasMetadata h = toKubernetesResource(s); if (h != null) { return extract(h); } return fromPath(s); }
KubernetesAttributesExtractor implements AttributeExtractor<HasMetadata> { @Override public AttributeSet extract(String s) { if (s == null || s.isEmpty()) { return new AttributeSet(); } HasMetadata h = toKubernetesResource(s); if (h != null) { return extract(h); } return fromPath(s); } }
KubernetesAttributesExtractor implements AttributeExtractor<HasMetadata> { @Override public AttributeSet extract(String s) { if (s == null || s.isEmpty()) { return new AttributeSet(); } HasMetadata h = toKubernetesResource(s); if (h != null) { return extract(h); } return fromPath(s); } KubernetesAttributesExtractor();  KubernetesAttributesExtractor(List<CustomResourceDefinitionContext> crdContexts); }
KubernetesAttributesExtractor implements AttributeExtractor<HasMetadata> { @Override public AttributeSet extract(String s) { if (s == null || s.isEmpty()) { return new AttributeSet(); } HasMetadata h = toKubernetesResource(s); if (h != null) { return extract(h); } return fromPath(s); } KubernetesAttributesExtractor();  KubernetesAttributesExtractor(List<CustomResourceDefinitionContext> crdContexts); @Override AttributeSet fromPath(String s); @Override AttributeSet fromResource(String s); @Override AttributeSet extract(String s); @Override AttributeSet extract(HasMetadata o); }
KubernetesAttributesExtractor implements AttributeExtractor<HasMetadata> { @Override public AttributeSet extract(String s) { if (s == null || s.isEmpty()) { return new AttributeSet(); } HasMetadata h = toKubernetesResource(s); if (h != null) { return extract(h); } return fromPath(s); } KubernetesAttributesExtractor();  KubernetesAttributesExtractor(List<CustomResourceDefinitionContext> crdContexts); @Override AttributeSet fromPath(String s); @Override AttributeSet fromResource(String s); @Override AttributeSet extract(String s); @Override AttributeSet extract(HasMetadata o); static final String KEY; static final String KIND; static final String NAME; static final String NAMESPACE; static final String VALUE; }