jsonnet: remove wrapping prometheus-operator lib

This commit is contained in:
paulfantom 2021-01-14 13:19:39 +01:00
parent 255cd9a1c5
commit b67686409e
No known key found for this signature in database
GPG Key ID: 12AE0185401674E7

View File

@ -25,26 +25,13 @@ local defaults = {
}, },
}; };
function(params) { function(params)
local po = self, local config = defaults + params;
config:: defaults + params,
// Safety check // Safety check
assert std.isObject(po.config.resources), assert std.isObject(config.resources);
//TODO(paulfantom): it would be better to include it on the same level as self. prometheusOperator(config) {
local polib = prometheusOperator(po.config), service+: {
'0alertmanagerConfigCustomResourceDefinition': polib['0alertmanagerConfigCustomResourceDefinition'],
'0alertmanagerCustomResourceDefinition': polib['0alertmanagerCustomResourceDefinition'],
'0podmonitorCustomResourceDefinition': polib['0podmonitorCustomResourceDefinition'],
'0probeCustomResourceDefinition': polib['0probeCustomResourceDefinition'],
'0prometheusCustomResourceDefinition': polib['0prometheusCustomResourceDefinition'],
'0prometheusruleCustomResourceDefinition': polib['0prometheusruleCustomResourceDefinition'],
'0servicemonitorCustomResourceDefinition': polib['0servicemonitorCustomResourceDefinition'],
'0thanosrulerCustomResourceDefinition': polib['0thanosrulerCustomResourceDefinition'],
serviceAccount: polib.serviceAccount,
service: polib.service {
spec+: { spec+: {
ports: [ ports: [
{ {
@ -56,7 +43,7 @@ function(params) {
}, },
}, },
serviceMonitor: polib.serviceMonitor { serviceMonitor+: {
spec+: { spec+: {
endpoints: [ endpoints: [
{ {
@ -72,8 +59,7 @@ function(params) {
}, },
}, },
clusterRoleBinding: polib.clusterRoleBinding, clusterRole+: {
clusterRole: polib.clusterRole {
rules+: [ rules+: [
{ {
apiGroups: ['authentication.k8s.io'], apiGroups: ['authentication.k8s.io'],
@ -97,7 +83,7 @@ function(params) {
], ],
}), }),
deployment: polib.deployment { deployment+: {
spec+: { spec+: {
template+: { template+: {
spec+: { spec+: {