From 0c260ef80418355c06831a33e304d96e38507369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ga=C3=9F?= Date: Tue, 26 Jun 2018 17:18:50 +0200 Subject: [PATCH] Add NetworkPolicy to label transformer --- pkg/transformers/labelsandannotationsconfig.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/transformers/labelsandannotationsconfig.go b/pkg/transformers/labelsandannotationsconfig.go index e18362d7a..f66a217e5 100644 --- a/pkg/transformers/labelsandannotationsconfig.go +++ b/pkg/transformers/labelsandannotationsconfig.go @@ -107,6 +107,21 @@ var defaultLabelsPathConfigs = []PathConfig{ Path: []string{"spec", "selector", "matchLabels"}, CreateIfNotPresent: true, }, + { + GroupVersionKind: &schema.GroupVersionKind{Group: "networking.k8s.io", Kind: "NetworkPolicy"}, + Path: []string{"spec", "podSelector", "matchLabels"}, + CreateIfNotPresent: true, + }, + { + GroupVersionKind: &schema.GroupVersionKind{Group: "networking.k8s.io", Kind: "NetworkPolicy"}, + Path: []string{"spec", "ingress", "from", "podSelector", "matchLabels"}, + CreateIfNotPresent: false, + }, + { + GroupVersionKind: &schema.GroupVersionKind{Group: "networking.k8s.io", Kind: "NetworkPolicy"}, + Path: []string{"spec", "egress", "to", "podSelector", "matchLabels"}, + CreateIfNotPresent: false, + }, } // defaultLabelsPathConfigs is the default configuration for mutating annotations