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

com.fasterxml.jackson.databind.JsonMappingException: No resource type found for:v1#List #1429

Closed
gastaldi opened this issue Mar 13, 2019 · 5 comments

Comments

@gastaldi
Copy link
Contributor

Works in Kubernetes-client 4.0.7

Test case:

class SerializationTest {

    @Test
    void should_not_throw_exception() throws Exception {
        InputStream is = Files.newInputStream(Paths.get("src/test/resources/service.cache.yml"));
        assertNotNull(is);
        assertThatCode(() -> Serialization.unmarshal(is, Collections.emptyMap()))
                .doesNotThrowAnyException();
    }
}

service.cache.yml:

apiVersion: v1
kind: List
items:
  - apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      name: cache-server
      labels:
        app: cache-server
    spec:
      replicas: 1
      strategy:
        type: Recreate
      template:
        metadata:
          labels:
            app: cache-server
        spec:
          containers:
            - env:
              - name: INFINISPAN_CONNECTORS
                value: hotrod
              image: registry.access.redhat.com/jboss-datagrid-7/datagrid73-openshift:1.0
              name: cache-server
              ports:
              - containerPort: 8778
                protocol: TCP
              - containerPort: 11211
                protocol: TCP
              - containerPort: 11222
                protocol: TCP
              - containerPort: 11333
                protocol: TCP
              - containerPort: 8080
                protocol: TCP
              - containerPort: 8443
                protocol: TCP
  - apiVersion: v1
    kind: Service
    metadata:
      labels:
        app: cache-server
      name: cache-server
    spec:
      selector:
        app: cache-server
      ports:
      - name: 8080-tcp
        port: 8080
        protocol: TCP
        targetPort: 8080
      - name: 8443-tcp
        port: 8443
        protocol: TCP
        targetPort: 8443
      - name: 8778-tcp
        port: 8778
        protocol: TCP
        targetPort: 8778
      - name: 11211-tcp
        port: 11211
        protocol: TCP
        targetPort: 11211
      - name: 11222-tcp
        port: 11222
        protocol: TCP
        targetPort: 11222
      - name: 11333-tcp
        port: 11333
        protocol: TCP
        targetPort: 11333
      type: ClusterIP
@gastaldi
Copy link
Contributor Author

Detected in fabric8-launcher/launcher-application#698

@gastaldi
Copy link
Contributor Author

gastaldi commented Mar 13, 2019

The problem is because InternalResourceMappingProvider is not in META-INF/services in the kubernetes-model JAR.

This file is missing in the resulting JAR: https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-model/kubernetes-model/src/main/resources/META-INF/services/io.fabric8.kubernetes.api.KubernetesResourceMappingProvider

@gastaldi
Copy link
Contributor Author

@rohanKanojia this is a blocker issue and makes the library unusable for Kubernetes List YAMLs

@gastaldi
Copy link
Contributor Author

@iocanel ^^

@gastaldi
Copy link
Contributor Author

Created a PR with the fix in #1430

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

No branches or pull requests

1 participant