Skip to content

Commit

Permalink
change valuesYaml to output
Browse files Browse the repository at this point in the history
  • Loading branch information
zreigz committed Dec 5, 2022
1 parent f7070b1 commit ce0a47f
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions plural/helm/console/values.yaml.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
valuesYaml = {
output = {
global={
application={
links={
Expand All @@ -8,14 +8,11 @@ valuesYaml = {
}
}
},

enabled=true,
ingressClass="nginx",
replicaCount=2,
provider=Var.Provider,
license=Var.License,
ingress={
console_dns=Var.Values.console_dns
console_dns=Var.Values.console_dns,
},
serviceAccount= {
create=true,
Expand Down Expand Up @@ -43,27 +40,27 @@ valuesYaml = {
}

if Var.Provider == "kind" then
valuesYaml.ingress.annotations = {
output.ingress.annotations = {
"external-dns.alpha.kubernetes.io/target: '127.0.0.1'"
}
valuesYaml.replicaCount=1
output.replicaCount=1
end

if Var.Provider == "google" then
valuesYaml.serviceAccount.create = false
output.serviceAccount.create = false
end

if Var.Provider == "azure" then
valuesYaml.podLabels={
output.podLabels={
"aadpodidbinding: console"
}
valuesYaml.consoleIdentityId=importValue("Terraform", "console_msi_id")
valuesYaml.consoleIdentityClientId=importValue("Terraform", "console_msi_client_id")
output.consoleIdentityId=importValue("Terraform", "console_msi_id")
output.consoleIdentityClientId=importValue("Terraform", "console_msi_client_id")

valuesYaml.extraEnv={
output.extraEnv={
{
name="ARM_USE_MSI",
value = true
value = 'true'

},
{
Expand All @@ -79,32 +76,32 @@ if Var.Provider == "azure" then
end

if Var.OIDC ~= nil then
valuesYaml.secrets.plural_client_id=Var.OIDC.ClientId
valuesYaml.secrets.plural_client_secret=Var.OIDC.ClientSecret
output.secrets.plural_client_id=Var.OIDC.ClientId
output.secrets.plural_client_secret=Var.OIDC.ClientSecret
end

if Var.Values.is_demo then
valuesYaml.secrets.is_demo=Var.Values.is_demo
output.secrets.is_demo=Var.Values.is_demo
end

if Var.Values.console_dns then
local gitUrl=dig("console", "secrets", "git_url", "default", Var)
local identity=pathJoin(repoRoot(), ".plural-crypt", "identity")
if gitUrl == "default" or gitUrl == "" then
valuesYaml.secrets.git_url=repoUrl()
output.secrets.git_url=repoUrl()
else
valuesYaml.secrets.git_url=gitUrl
output.secrets.git_url=gitUrl
end

valuesYaml.secrets.repo_root=repoName()
valuesYaml.secrets.branch_name=branchName()
valuesYaml.secrets.config=readFile(pathJoin(homeDir(),".plural","config.yml"))
output.secrets.repo_root=repoName()
output.secrets.branch_name=branchName()
output.secrets.config=readFile(pathJoin(homeDir(),".plural","config.yml"))

if fileExists(identity) then
valuesYaml.secrets.identity=readFile(identity)
output.secrets.identity=readFile(identity)
elseif dig("console", "secrets", "identity", "default", Var) ~= "default" then
valuesYaml.secrets.identity= Var.console.secrets.identity
output.secrets.identity= Var.console.secrets.identity
else
valuesYaml.secrets.key=readFile(pathJoin(homeDir(), ".plural", "key"))
output.secrets.key=readFile(pathJoin(homeDir(), ".plural", "key"))
end
end

0 comments on commit ce0a47f

Please sign in to comment.