Skip to content

Commit 13b8e11

Browse files
authored
refactor(consul): use core.v1.envVar/v1.policyRule (#323)
Removes `.mixin` too. Works with k8s-alpha
1 parent de586e2 commit 13b8e11

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

consul/consul.libsonnet

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,10 @@ k {
256256
]) +
257257
$.util.resourcesRequests('100m', '500Mi'),
258258

259-
local policyRule = $.rbac.v1beta1.policyRule,
259+
local policyRule = $.rbac.v1.policyRule,
260260

261261
consul_sidekick_rbac:
262262
$.util.namespacedRBAC('consul-sidekick', [
263-
policyRule.new() +
264263
policyRule.withApiGroups(['', 'extensions', 'apps']) +
265264
policyRule.withResources(['pods', 'replicasets']) +
266265
policyRule.withVerbs(['get', 'list', 'watch']),
@@ -273,8 +272,8 @@ k {
273272
'--pod-name=$(POD_NAME)',
274273
]) +
275274
container.withEnv([
276-
container.envType.fromFieldPath('POD_NAMESPACE', 'metadata.namespace'),
277-
container.envType.fromFieldPath('POD_NAME', 'metadata.name'),
275+
$.core.v1.envVar.fromFieldPath('POD_NAMESPACE', 'metadata.namespace'),
276+
$.core.v1.envVar.fromFieldPath('POD_NAME', 'metadata.name'),
278277
]),
279278

280279
consul_statsd_exporter::
@@ -303,7 +302,7 @@ k {
303302
$.consul_statsd_exporter,
304303
$.consul_exporter,
305304
]) +
306-
deployment.mixin.spec.template.spec.withServiceAccount('consul-sidekick') +
305+
deployment.spec.template.spec.withServiceAccount('consul-sidekick') +
307306
$.util.configMapVolumeMount($.consul_config_map, '/etc/config') +
308307
$.util.antiAffinity,
309308

0 commit comments

Comments
 (0)