aboutsummaryrefslogtreecommitdiff
path: root/deploy/vendor/github.com/grafana/jsonnet-libs/ksonnet-util/kausal.libsonnet
blob: 6a6f1498ee3edbc475764cd25d23044d945a2ae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// kausal.libsonnet provides a backwards compatible way as many libraries leverage kausal.libsonnet.
// Ideally util.libsonnet is consumed separately.

(import 'grafana.libsonnet')
+ {
  local this = self,
  _config+:: {
    enable_rbac: true,
    enable_pod_priorities: false,
    namespace: error 'Must define a namespace',
  },

  util+::
    (import 'util.libsonnet').withK(this)
    + {
      rbac(name, rules)::
        if $._config.enable_rbac
        then super.rbac(name, rules, $._config.namespace)
        else {},
      namespacedRBAC(name, rules)::
        if $._config.enable_rbac
        then super.namespacedRBAC(name, rules, $._config.namespace)
        else {},
      podPriority(p):
        if $._config.enable_pod_priorities
        then super.podPriority(p)
        else {},
    },
}