From ca0cdae588b1cfc4726adab0061926149b3c1d8a Mon Sep 17 00:00:00 2001 From: michaelschiff Date: Tue, 24 Oct 2023 09:39:00 -0700 Subject: [PATCH] Enable stamping for commonLabels and commonAnnotations --- skylib/kustomize/kustomize.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skylib/kustomize/kustomize.bzl b/skylib/kustomize/kustomize.bzl index 1c70edaa..0c23c84c 100644 --- a/skylib/kustomize/kustomize.bzl +++ b/skylib/kustomize/kustomize.bzl @@ -124,11 +124,13 @@ def _kustomize_impl(ctx): if ctx.attr.common_labels: kustomization_yaml += "commonLabels:\n" for k in ctx.attr.common_labels: + use_stamp = use_stamp or "{" in ctx.attr.common_labels[k] kustomization_yaml += " {}: '{}'\n".format(k, ctx.attr.common_labels[k]) if ctx.attr.common_annotations: kustomization_yaml += "commonAnnotations:\n" for k in ctx.attr.common_annotations: + use_stamp = use_stamp or "{" in ctx.attr.common_annotations[k] kustomization_yaml += " {}: '{}'\n".format(k, ctx.attr.common_annotations[k]) kustomization_yaml += "generatorOptions:\n"