integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java
public static void createConfigMap(String cmName, String fileOrDirPath,
                                     String namespace, String label) throws Exception {
    String cmd = "kubectl -n " + namespace
        + " delete configmap " + cmName
        + " --ignore-not-found";
    TestUtils.execOrAbortProcess(cmd);

    cmd = "kubectl -n " + namespace
        + " create configmap " + cmName
        + " --from-file=" + fileOrDirPath;
    TestUtils.execOrAbortProcess(cmd, true);

    // create label for configmap
    cmd =
        "kubectl -n "
            + namespace
            + " label cm "
            + cmName
            + " "
            + label;
    TestUtils.execOrAbortProcess(cmd);
  }
/**
   * create configmap in the given namespace. Also creates label.
   * @param cmName config map name
   * @param fileOrDirPath File path
   * @param namespace namespace
   * @throws Exception on failure
   */
create configmap in the given namespace. Also creates label.
@param cmName config map name
@param fileOrDirPath File path
@param namespace namespace
@throws Exception on failure
create configmap in the given namespace . Also creates label . @param cmName config map name @param fileOrDirPath File path @param namespace namespace @throws Exception on failure
public static void createConfigMap(String cmName, String fileOrDirPath,
                                     String namespace, String label) throws Exception {
    String cmd = "kubectl -n " + namespace
        + " delete configmap " + cmName
        + " --ignore-not-found";
    TestUtils.execOrAbortProcess(cmd);
    cmd = "kubectl -n " + namespace
        + " create configmap " + cmName
        + " --from-file=" + fileOrDirPath;
    TestUtils.execOrAbortProcess(cmd, true);
    cmd =
        "kubectl -n "
            + namespace
            + " label cm "
            + cmName
            + " "
            + label;
    TestUtils.execOrAbortProcess(cmd);
  }
public static void createConfigMap ( String cmName , String fileOrDirPath , String namespace , String label ) throws Exception { String cmd = "kubectl -n " + namespace + " delete configmap " + cmName + " --ignore-not-found" ; TestUtils . execOrAbortProcess ( cmd ) ; cmd = "kubectl -n " + namespace + " create configmap " + cmName + " --from-file=" + fileOrDirPath ; TestUtils . execOrAbortProcess ( cmd , true ) ; cmd = "kubectl -n " + namespace + " label cm " + cmName + " " + label ; TestUtils . execOrAbortProcess ( cmd ) ; }
create configmap in the given namespace.
create configmap in the given namespace .
// create label for configmap