How to parse K8S Watch Event object

11/19/2019

I working with go k8s client for fetch resource event coming via api-server of Kubernetes. I can fetch the whole events for the ingress objects but I cannot parse event object show at below .

    ingressInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{
        AddFunc: func(obj interface{ }) {

            /*
                fullKubernetesObject := json.Unmarshal([]byte(myData), &results)
            */


        },

I need to parse obj object in deletefunction and fetch the annotations from k8s object, I want to convert to type object to byte[] but there is no parsing option on code itself.

How I can solve this issue?

-- Ayhan Balik
devops
docker
go
infrastructure
kubernetes

0 Answers