Closed minerba closed 3 years ago
I called Function CoreV1API_listNamespacedSecret but I can't see secret's data Info
There is Some Bug in "v1_secret_parserFromJSON"
// v1_secret->data cJSON *data = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "data"); list_t *dataList; if (data) { cJSON *data_local_map; if(!cJSON_IsObject(data)) { goto end;//primitive map container } dataList = list_create(); keyValuePair_t *localMapKeyPair; cJSON_ArrayForEach(data_local_map, data) { cJSON *localMapObject = data_local_map; list_addElement(dataList , localMapKeyPair); } }
I think it has to be changed like Below
cJSON *data = cJSON_GetObjectItemCaseSensitive(v1_secretJSON, "data"); list_t *dataList; if (data) { cJSON *data_local_map; if(!cJSON_IsObject(data)) { goto end;//primitive map container } dataList = list_create(); keyValuePair_t *localMapKeyPair; cJSON_ArrayForEach(data_local_map, data) { cJSON *localMapObject = data_local_map; if(!cJSON_IsString(localMapObject)) { goto end; } localMapKeyPair = keyValuePair_create(strdup(localMapObject->string), strdup(localMapObject->valuestring)); list_addElement(dataList , localMapKeyPair); } }
"localMapKeyPair" have No value, just Declared in scope. But Used in list_addElement(dataList, localMapKeyPair);
so data value is NULL in v1_secret_t.
@minerba we will investigate this and see where the issue is.
I begin to investigate this issue now.
I called Function CoreV1API_listNamespacedSecret but I can't see secret's data Info
There is Some Bug in "v1_secret_parserFromJSON"
I think it has to be changed like Below
"localMapKeyPair" have No value, just Declared in scope. But Used in list_addElement(dataList, localMapKeyPair);
so data value is NULL in v1_secret_t.