Closed swhoro closed 10 months ago
for example:
auto pods = CoreV1API_listNamespacedPod(apiClient, const_cast<char *>("default"), nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); listEntry_t *entry; list_ForEach(entry, pods->items) { v1_pod_t *pod = static_cast<v1_pod_t *>(entry->data); std::cout << pod->metadata->name << std::endl; listEntry_t *labelEntry; list_ForEach(labelEntry, pod->metadata->labels) { // how to write code to get this pod label key and value? } }
https://github.com/kubernetes-client/c/blob/ea7f644c26611c7820b7030fb5f1aa170cfaf607/examples/configmap/main.c#L103C26-L103C36
I think this helps.
https://github.com/kubernetes-client/c/blob/ea7f644c26611c7820b7030fb5f1aa170cfaf607/examples/configmap/main.c#L103C26-L103C36 I think this helps.
Thank you
Closing this since I think the question is answered.
for example: