add PersistentVolumeClaim to name reference transformer

fixes #149
This commit is contained in:
ryane
2018-07-03 10:16:25 -04:00
parent 6f82073d4b
commit 36772aac89
3 changed files with 80 additions and 0 deletions

View File

@@ -789,6 +789,63 @@ var defaultNameReferencePathConfigs = []ReferencePathConfig{
},
},
},
{
referencedGVK: schema.GroupVersionKind{
Version: "v1",
Kind: "PersistentVolumeClaim",
},
pathConfigs: []PathConfig{
{
GroupVersionKind: &schema.GroupVersionKind{
Kind: "Pod",
},
Path: []string{"spec", "volumes", "persistentVolumeClaim", "claimName"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{
Kind: "StatefulSet",
},
Path: []string{"spec", "template", "spec", "volumes", "persistentVolumeClaim", "claimName"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{
Kind: "Deployment",
},
Path: []string{"spec", "template", "spec", "volumes", "persistentVolumeClaim", "claimName"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{
Kind: "ReplicationController",
},
Path: []string{"spec", "template", "spec", "volumes", "persistentVolumeClaim", "claimName"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{
Kind: "CronJob",
},
Path: []string{"spec", "jobTemplate", "spec", "template", "spec", "volumes", "persistentVolumeClaim", "claimName"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{
Kind: "Job",
},
Path: []string{"spec", "template", "spec", "volumes", "persistentVolumeClaim", "claimName"},
CreateIfNotPresent: false,
},
{
GroupVersionKind: &schema.GroupVersionKind{
Kind: "DaemonSet",
},
Path: []string{"spec", "template", "spec", "volumes", "persistentVolumeClaim", "claimName"},
CreateIfNotPresent: false,
},
},
},
}
// AddNameReferencePathConfigs adds extra reference path configs to the default one