Skip to content

Commit

Permalink
Fix error when config.gerrit is null
Browse files Browse the repository at this point in the history
  • Loading branch information
fredg02 committed Nov 30, 2023
1 parent ff85e03 commit fde7565
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions templates/k8s/statefulset.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,14 @@ local Kube = import "kube.libsonnet";
name: "gerrit-ssh-keys",
readOnly: true,
}
]
+ if std.objectHas(config, "gerrit") then [
] + (if std.objectHas(config, "gerrit") then [
{
mountPath: "/run/secrets/jenkins/ssh-" + gerrit.site,
name: std.strReplace(gerrit.site, '.', '-') + "-ssh-keys",
readOnly: true,
}
}
for gerrit in config.gerrit
] else [],
]) else [],
env: [
{
name: "JAVA_OPTS",
Expand Down Expand Up @@ -222,16 +221,16 @@ local Kube = import "kube.libsonnet";
secretName: "gerrit-ssh-keys",
},
}
]
+ if std.objectHas(config, "gerrit") then [
]
+ (if std.objectHas(config, "gerrit") then [
{
name: std.strReplace(gerrit.site, '.', '-') + "-ssh-keys",
secret: {
secretName: gerrit.site + "-ssh-keys",
},
}
for gerrit in config.gerrit
] else [],
]) else [],
},
},
volumeClaimTemplates: [
Expand Down

0 comments on commit fde7565

Please sign in to comment.