kubernetes-client / c

Official C client library for Kubernetes
Apache License 2.0
144 stars 46 forks source link

PATCH function needs to be added #51

Closed minerba closed 3 years ago

minerba commented 3 years ago

When using only the PUT function, all Json properties must be written.

genericClient has PUT/GET/POST function but there is no function to PATCH in the genericClient function.

ityuhui commented 3 years ago

Hi @minerba

Are these functions what your want ?

char* Generic_patchNamespacedResource(genericClient_t *client, const char *ns, const char *name, const char* body) {
    char path[128];
    makeNamespacedResourcePath(path, client, ns, name);
    return callInternal(client, path, "PATCH", body);
}

char* Generic_patchResource(genericClient_t *client, const char *name, const char* body) {
    char path[128];
    makeResourcePath(path, client, name);
    return callInternal(client, path, "PATCH", body);
}
minerba commented 3 years ago

yes, I want..... When can it be applied??

ityuhui commented 3 years ago

These functions are committed by https://github.com/kubernetes-client/c/pull/52

Please refer to the example to get the usage. e.g. Generic_patchResource