Add NetworkPolicy to label transformer

This commit is contained in:
Maximilian Gaß
2018-06-26 17:18:50 +02:00
parent 5b67b580f2
commit 0c260ef804

View File

@@ -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