41 lines
1.1 KiB
Jsonnet
41 lines
1.1 KiB
Jsonnet
{
|
|
helmApplication(
|
|
name,
|
|
sourceRepoUrl,
|
|
sourceChart,
|
|
sourceTargetRevision,
|
|
namespace="",
|
|
helmValues={}) ::
|
|
{
|
|
apiVersion: "argoproj.io/v1alpha1",
|
|
kind: "Application",
|
|
metadata: {
|
|
name: name,
|
|
namespace: "argo",
|
|
finalizers: ["resources-finalizer.argocd.argoproj.io"]
|
|
},
|
|
spec: {
|
|
project: "default",
|
|
source: {
|
|
chart: sourceChart,
|
|
repoURL: sourceRepoUrl,
|
|
targetRevision: sourceTargetRevision,
|
|
[if helmValues != {} then "helm"]: {
|
|
valuesObject: helmValues
|
|
}
|
|
},
|
|
destination: {
|
|
server: "https://kubernetes.default.svc",
|
|
namespace: if namespace == "" then name else namespace
|
|
},
|
|
syncPolicy: {
|
|
automated: {
|
|
prune: true
|
|
},
|
|
syncOptions: ["CreateNamespace=true"]
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|