add CRIBL_K8S_POD env var to psm
@@ -205,9 +205,20 @@ err:
static cJSON *
jsonEnvironmentObject()
{
- return cJSON_CreateObject();
- // config file???
- // env variables???
+ cJSON* root = NULL;
+
+ if (!(root = cJSON_CreateObject())) goto err;
+
+ char *env_cribl_k8s_pod = getenv("CRIBL_K8S_POD");
+ if (env_cribl_k8s_pod) {
+ if (!cJSON_AddStringToObjLN(root, "CRIBL_K8S_POD",
+ env_cribl_k8s_pod)) goto err;
+ }
+
+ return root;
+err:
+ if (root) cJSON_Delete(root);
+ return NULL;
}
void
