Skip to content
Permalink
Browse files
fix(helm): don't add annotations and labels to *List Kinds
Signed-off-by: Ilya Lesikov <ilya@lesikov.com>
  • Loading branch information
ilya-lesikov authored and alexey-igrychev committed Feb 21, 2022
1 parent a7064ff commit 4f2d02906f64d9e13760b58f1ecbe4377057357a
Showing with 6 additions and 2 deletions.
  1. +6 −2 pkg/deploy/helm/extra_annotations_and_labels_post_renderer.go
@@ -89,7 +89,9 @@ func (pr *ExtraAnnotationsAndLabelsPostRenderer) Run(renderedManifests *bytes.Bu
fmt.Printf("Unpacket obj annotations: %#v\n", obj.GetAnnotations())
}

if len(extraAnnotations) > 0 {
if obj.IsList() && len(extraAnnotations) > 0 {
logboek.Warn().LogF("werf annotations won't be applied to *List resource Kinds, including %s. We advise to replace *List resources with multiple separate resources of the same Kind\n", obj.GetKind())
} else if len(extraAnnotations) > 0 {
annotations := obj.GetAnnotations()
if annotations == nil {
annotations = make(map[string]string)
@@ -100,7 +102,9 @@ func (pr *ExtraAnnotationsAndLabelsPostRenderer) Run(renderedManifests *bytes.Bu
obj.SetAnnotations(annotations)
}

if len(extraLabels) > 0 {
if obj.IsList() && len(extraLabels) > 0 {
logboek.Warn().LogF("werf labels won't be applied to *List resource Kinds, including %s. We advise to replace *List resources with multiple separate resources of the same Kind\n", obj.GetKind())
} else if len(extraLabels) > 0 {
labels := obj.GetLabels()
if labels == nil {
labels = make(map[string]string)

0 comments on commit 4f2d029

Please sign in to comment.