Merge pull request #145 from babiel/pod-affinity-label-transformer

Add common labels to pod affinity/anti-affinity label selector
This commit is contained in:
Jingfang Liu
2018-07-12 15:41:58 -07:00
committed by GitHub

View File

@@ -52,6 +52,32 @@ var defaultLabelsPathConfigs = []PathConfig{
Path: []string{"spec", "template", "metadata", "labels"},
CreateIfNotPresent: true,
},
{
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "Deployment"},
Path: []string{"spec", "template", "spec", "affinity", "podAffinity",
"preferredDuringSchedulingIgnoredDuringExecution",
"podAffinityTerm", "labelSelector", "matchLabels"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "Deployment"},
Path: []string{"spec", "template", "spec", "affinity", "podAffinity",
"requiredDuringSchedulingIgnoredDuringExecution", "labelSelector", "matchLabels"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "Deployment"},
Path: []string{"spec", "template", "spec", "affinity", "podAntiAffinity",
"preferredDuringSchedulingIgnoredDuringExecution",
"podAffinityTerm", "labelSelector", "matchLabels"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "Deployment"},
Path: []string{"spec", "template", "spec", "affinity", "podAntiAffinity",
"requiredDuringSchedulingIgnoredDuringExecution", "labelSelector", "matchLabels"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{Kind: "ReplicaSet"},
Path: []string{"spec", "selector", "matchLabels"},
@@ -82,6 +108,32 @@ var defaultLabelsPathConfigs = []PathConfig{
Path: []string{"spec", "template", "metadata", "labels"},
CreateIfNotPresent: true,
},
{
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "StatefulSet"},
Path: []string{"spec", "template", "spec", "affinity", "podAffinity",
"preferredDuringSchedulingIgnoredDuringExecution",
"podAffinityTerm", "labelSelector", "matchLabels"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "StatefulSet"},
Path: []string{"spec", "template", "spec", "affinity", "podAffinity",
"requiredDuringSchedulingIgnoredDuringExecution", "labelSelector", "matchLabels"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "StatefulSet"},
Path: []string{"spec", "template", "spec", "affinity", "podAntiAffinity",
"preferredDuringSchedulingIgnoredDuringExecution",
"podAffinityTerm", "labelSelector", "matchLabels"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "StatefulSet"},
Path: []string{"spec", "template", "spec", "affinity", "podAntiAffinity",
"requiredDuringSchedulingIgnoredDuringExecution", "labelSelector", "matchLabels"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{Group: "batch", Kind: "Job"},
Path: []string{"spec", "selector", "matchLabels"},