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

KubernetesMockServer mixes CRD for list requests #3216

Closed
Fabian-K opened this issue Jun 4, 2021 · 0 comments
Closed

KubernetesMockServer mixes CRD for list requests #3216

Fabian-K opened this issue Jun 4, 2021 · 0 comments
Assignees
Labels

Comments

@Fabian-K
Copy link
Contributor

Fabian-K commented Jun 4, 2021

Hi,

when there are multiple CRD with the same kind but from different groups, the mock server will mix those for list requests.

apiVersion: triggers.tekton.dev/v1alpha1
kind: Trigger
---
apiVersion: eventing.knative.dev/v1
kind: Trigger

If you create an instance of Tekton Trigger and then list all Knative Triggers, it will return the Tekton Trigger. Looks like this is because the KubernetesAttributesExtractor only extracts the kind as an attribute and ignores apiVersion.

String kind = m.group(KIND);
if (!Utils.isNullOrEmpty(kind)) {
kind = resolveKindFromPlural(crdContexts, kind);
attributes = attributes.add(new Attribute(KIND, kind));
}

Thanks, Fabian

@shawkins shawkins self-assigned this Jun 10, 2021
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Jun 10, 2021
added awareness of apiVersion
switched to using plural rather than kind
manusa pushed a commit to shawkins/kubernetes-client that referenced this issue Jun 11, 2021
added awareness of apiVersion
switched to using plural rather than kind
@manusa manusa closed this as completed in 1093d5b Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants