jsonnet: fix test failures with platformPatch
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
This commit is contained in:
@@ -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.
|
||||
local platformPatch(p) = if p != null && std.objectHas(platforms, p) then platforms[p] else {};
|
||||
|
||||
{
|
||||
// platformPatch returns the platform specific patch associated to the given
|
||||
// platform.
|
||||
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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user