hi all, I am referring to k8s.core.v1.secret, reg...
# kubernetes
s
hi all, I am referring to k8s.core.v1.secret, regarding data field, can the key and value be variables? Another thing is the input secert.value, this should be a const from another resource instead of a string, I supposed I need to remove the double quotes before parsing to the secret class? here's my code:
Copy code
if(helmConfigs.secret){
     let k8sSecret = new k8s.core.v1.Secret(${helmConfigs.secret.name}, {
        metadata: {
          name: helmConfigs.secret.name,
          namespace: helmConfigs.namespace
        },
      data: {
        helmConfigs.secret.key: helmConfigs.secret.value
      }
      });
    }
input:
Copy code
helm: {
"cert-manager": {
      namespace: "cert-manager",
      version: "v1.5.3",
      repo: "<https://charts.jetstack.io>",
      chart: "cert-manager",
      values: require(`./google/helm_values/cert_manager`),
     secret: {}
    },
    "external-dns-public": {
      namespace: "external-dns",
      version: "3.1.1",
      repo: "<https://charts.bitnami.com/bitnami>",
      chart: "external-dns",
      values: require(`./google/helm_values/external_dns_public`),
     secret: {
         name: "external-dns-public"
         key: "credentials.json"
         value: "dnskey.privateKey"
     }
    }    
  }
b
can you wrap you code in three backticks please? ```
s
done