<pre><code>result, err := crdclient.Create(example)
if err == nil {
    fmt.Printf("CREATED: %#v\n", result)
} else if apierrors.IsAlreadyExists(err) {
    fmt.Printf("ALREADY EXISTS: %#v\n", result)
} else {
    panic(err)
}

// List all Example objects
items, err := crdclient.List(meta_v1.ListOptions{})
if err != nil {
    panic(err)
}
fmt.Printf("List:\n%s\n", items)

result, err = crdclient.Get("example123")
if err != nil {
    panic(err)
}
fmt.Printf("Get:\n%v\n", result)

result.Status.Message = "Hello There"
fmt.Println("\n Result is: %v \n", result)
up, uperr := crdclient.Update(result)
if uperr != nil {
    panic(uperr)
}
</code></pre>

<p>In the above example for CRD with kubernetes API I get the error.
"In Update call
panic: name must be provided"</p>

<p>What am I missing? The code is based out the sample given @ <a href="https://github.com/yaronha/kube-crd" rel="nofollow noreferrer">https://github.com/yaronha/kube-crd</a></p>

<p>I looked at the code, you need to update the Update API in the client.go file with the following code:</p>

<pre><code>func (f *crdclient) Update(obj *crd.Example) (*crd.Example, error) {
    var result crd.Example
    err := f.cl.Put().
        Namespace(f.ns).Resource(f.plural).
        Name(obj.Name).
        Body(obj).Do().Into(&amp;result)
    return &amp;result, err
}
</code></pre>

<p>After that your code should be working as expected. </p>
