Skip to content

TypeMeta : Kind + ApiVersion are empty when the object is processed the first time #202

@cmoulliard

Description

@cmoulliard

Bug

Original ticket : operator-framework/operator-sdk#727

When I create a Component's custom resource, the component is well created and the MetaData well defined (Kind, ApiVersion)

oc get cp/fruit-client -o yaml                
apiVersion: component.k8s.io/v1alpha1
kind: Component
metadata:
  name: fruit-client
  namespace: my-spring-app
spec:
  deployment: innerloop
  exposeService: true
  runtime: springboot
  version: 1.5.16

but when the reconcile's function of the controller fetch the Component, then the Kind, ApiVersion fields are empty

What is the root cause of this issue ?

screenshot 2018-11-09 12 27 43

Environment

okd : 3.11 (= kubernetes v1.11)
operator-sdk : v0.1.1+git

Project

Code of the API : https://github.com/snowdrop/component-operator/tree/operator-0.1.1/pkg/apis
Code of the controller : https://github.com/snowdrop/component-operator/blob/operator-0.1.1/pkg/controller/component/handler.go#L94

Hypothesis

As described here I suspect that we have a deepCopy issue the first time that we get the object from the cache

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions