public SparkClusterResourceSpec getResourceSpec(
      SparkCluster cluster, Map<String, String> confOverrides) {
    SparkConf effectiveSparkConf = new SparkConf();

    Map<String, String> confFromSpec = cluster.getSpec().getSparkConf();
    if (MapUtils.isNotEmpty(confFromSpec)) {
      for (Map.Entry<String, String> entry : confFromSpec.entrySet()) {
        effectiveSparkConf.set(entry.getKey(), entry.getValue());
      }
    }

    if (MapUtils.isNotEmpty(confOverrides)) {
      for (Map.Entry<String, String> entry : confOverrides.entrySet()) {
        effectiveSparkConf.set(entry.getKey(), entry.getValue());
      }
    }

    effectiveSparkConf.set("spark.kubernetes.namespace", cluster.getMetadata().getNamespace());

    return new SparkClusterResourceSpec(cluster, effectiveSparkConf);
  }
@Test
  void testGetResourceSpec() {
    SparkClusterSubmissionWorker worker = new SparkClusterSubmissionWorker();
    SparkClusterResourceSpec spec = worker.getResourceSpec(cluster, Collections.emptyMap());
    // SparkClusterResourceSpecTest will cover the detail information of easy resources
    assertNotNull(spec.getMasterService());
    assertNotNull(spec.getMasterStatefulSet());
    assertNotNull(spec.getWorkerStatefulSet());
  }