bipinprasad commented on a change in pull request #3366:
URL: https://github.com/apache/storm/pull/3366#discussion_r548522738



##########
File path: storm-core/src/native/worker-launcher/impl/oci/oci_write_config.c
##########
@@ -0,0 +1,464 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <sys/utsname.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "utils/storm_user_info.h"
+#include "utils/file-utils.h"
+
+#include "worker-launcher.h"
+#include "utils/cJSON.h"
+#include "utils/file-utils.h"
+
+#include "oci_launch_cmd.h"
+#include "oci_write_config.h"
+
+#define RUNC_CONFIG_FILENAME    "config.json"
+#define STARTING_JSON_BUFFER_SIZE  (128*1024)
+
+
+static cJSON* build_runc_config_root(const char* rootfs_path) {
+  cJSON* root = cJSON_CreateObject();
+  if (cJSON_AddStringToObject(root, "path", rootfs_path) == NULL) {
+    goto fail;
+  }
+  if (cJSON_AddTrueToObject(root, "readonly") == NULL) {
+    goto fail;
+  }
+  return root;
+
+fail:
+  cJSON_Delete(root);
+  return NULL;
+}
+
+static cJSON* build_runc_config_process_user(const char* username) {
+  cJSON* user_json = cJSON_CreateObject();
+  struct storm_user_info* sui = storm_user_info_alloc();
+  if (sui == NULL) {
+    return NULL;
+  }
+
+  int rc = storm_user_info_fetch(sui, username);

Review comment:
       nit: why is the method named storm_user_info(). Same question for 
storm_user_info.c and storm_user_info.h. They seem to be generic user_info 
query functions and nothing storm specific.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to