Merge pull request #59 from sethpollack/hpa

add namerefs for hpa
This commit is contained in:
Jeff Regan
2018-06-06 14:03:15 -07:00
committed by GitHub

View File

@@ -23,6 +23,48 @@ import (
// defaultNameReferencePathConfigs is the default configuration for updating
// the fields reference the name of other resources.
var defaultNameReferencePathConfigs = []referencePathConfig{
{
referencedGVK: schema.GroupVersionKind{
Kind: "Deployment",
},
pathConfigs: []PathConfig{
{
GroupVersionKind: &schema.GroupVersionKind{
Kind: "HorizontalPodAutoscaler",
},
Path: []string{"spec", "scaleTargetRef", "name"},
CreateIfNotPresent: false,
},
},
},
{
referencedGVK: schema.GroupVersionKind{
Kind: "ReplicationController",
},
pathConfigs: []PathConfig{
{
GroupVersionKind: &schema.GroupVersionKind{
Kind: "HorizontalPodAutoscaler",
},
Path: []string{"spec", "scaleTargetRef", "name"},
CreateIfNotPresent: false,
},
},
},
{
referencedGVK: schema.GroupVersionKind{
Kind: "ReplicaSet",
},
pathConfigs: []PathConfig{
{
GroupVersionKind: &schema.GroupVersionKind{
Kind: "HorizontalPodAutoscaler",
},
Path: []string{"spec", "scaleTargetRef", "name"},
CreateIfNotPresent: false,
},
},
},
{
referencedGVK: schema.GroupVersionKind{
Version: "v1",