Skip to content
Snippets Groups Projects
Commit ed5a2f94 authored by Damien Grisonnet's avatar Damien Grisonnet
Browse files

jsonnet: fix test failures with platformPatch

parent b59b2c23
Branches
Tags
No related merge requests found
......@@ -9,7 +9,7 @@ local prometheusAdapter = import './components/prometheus-adapter.libsonnet';
local prometheusOperator = import './components/prometheus-operator.libsonnet';
local prometheus = import './components/prometheus.libsonnet';
local platformPatch = (import './platforms/platforms.libsonnet').platformPatch;
local platformPatch = import './platforms/platforms.libsonnet';
{
// using `values` as this is similar to helm
......@@ -127,5 +127,5 @@ local platformPatch = (import './platforms/platforms.libsonnet').platformPatch;
name: $.values.kubePrometheus.namespace,
},
},
} + platformPatch($.values.kubePrometheus.platform),
}
},
} + platformPatch
......@@ -9,8 +9,33 @@ local platforms = {
kubespray: import './kubespray.libsonnet',
};
{
// platformPatch returns the platform specific patch associated to the given
// platform.
platformPatch(p): if p != null && std.objectHas(platforms, p) then platforms[p] else {},
local platformPatch(p) = if p != null && std.objectHas(platforms, p) then platforms[p] else {};
{
// initialize the object to prevent "Indexed object has no field" lint errors
local p = {
alertmanager: {},
blackboxExporter: {},
grafana: {},
kubeStateMetrics: {},
nodeExporter: {},
prometheus: {},
prometheusAdapter: {},
prometheusOperator: {},
kubernetesControlPlane: {},
kubePrometheus: {},
} + platformPatch($.values.kubePrometheus.platform),
alertmanager+: p.alertmanager,
blackboxExporter+: p.blackboxExporter,
grafana+: p.grafana,
kubeStateMetrics+: p.kubeStateMetrics,
nodeExporter+: p.nodeExporter,
prometheus+: p.prometheus,
prometheusAdapter+: p.prometheusAdapter,
prometheusOperator+: p.prometheusOperator,
kubernetesControlPlane+: p.kubernetesControlPlane,
kubePrometheus+: p.kubePrometheus,
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment