From 021e6bd569bd13796e41e4d32654ae96c774ba1e Mon Sep 17 00:00:00 2001 From: ymqytw Date: Tue, 6 Feb 2018 17:01:47 -0800 Subject: [PATCH] fix wrong paths of name reference transformer config --- .../commands/testdata/simple/out/expected.yaml | 2 +- .../exampleinstance/deployment/deployment.yaml | 2 +- pkg/kinflate/transformers/namereference_test.go | 2 +- pkg/kinflate/transformers/namereferenceconfig.go | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/kinflate/commands/testdata/simple/out/expected.yaml b/pkg/kinflate/commands/testdata/simple/out/expected.yaml index 9eaa3387c..edaf555ae 100644 --- a/pkg/kinflate/commands/testdata/simple/out/expected.yaml +++ b/pkg/kinflate/commands/testdata/simple/out/expected.yaml @@ -135,4 +135,4 @@ spec: name: app-env - name: app-tls secret: - name: test-infra-app-tls-4d47hbbh9m + secretName: test-infra-app-tls-4d47hbbh9m diff --git a/pkg/kinflate/examples/simple/instances/exampleinstance/deployment/deployment.yaml b/pkg/kinflate/examples/simple/instances/exampleinstance/deployment/deployment.yaml index 5a481a080..c6a060d55 100644 --- a/pkg/kinflate/examples/simple/instances/exampleinstance/deployment/deployment.yaml +++ b/pkg/kinflate/examples/simple/instances/exampleinstance/deployment/deployment.yaml @@ -39,5 +39,5 @@ spec: name: app-env name: app-env - secret: - name: app-tls + secretName: app-tls name: app-tls diff --git a/pkg/kinflate/transformers/namereference_test.go b/pkg/kinflate/transformers/namereference_test.go index 1a8a9fbf4..43b2b7de2 100644 --- a/pkg/kinflate/transformers/namereference_test.go +++ b/pkg/kinflate/transformers/namereference_test.go @@ -106,7 +106,7 @@ func makeNameRefDeployment(cmName, secretName string) *unstructured.Unstructured "name": cmName, }, "secret": map[string]interface{}{ - "name": secretName, + "secretName": secretName, }, }, }, diff --git a/pkg/kinflate/transformers/namereferenceconfig.go b/pkg/kinflate/transformers/namereferenceconfig.go index bbea6c25b..3e1ff44b3 100644 --- a/pkg/kinflate/transformers/namereferenceconfig.go +++ b/pkg/kinflate/transformers/namereferenceconfig.go @@ -192,7 +192,7 @@ var defaultNameReferencePathConfigs = []referencePathConfig{ Version: "v1", Kind: "Pod", }, - Path: []string{"spec", "volumes", "secret", "name"}, + Path: []string{"spec", "volumes", "secret", "secretName"}, CreateIfNotPresent: false, }, { @@ -215,7 +215,7 @@ var defaultNameReferencePathConfigs = []referencePathConfig{ GroupVersionKind: &schema.GroupVersionKind{ Kind: "Deployment", }, - Path: []string{"spec", "template", "spec", "volumes", "secret", "name"}, + Path: []string{"spec", "template", "spec", "volumes", "secret", "secretName"}, CreateIfNotPresent: false, }, { @@ -236,7 +236,7 @@ var defaultNameReferencePathConfigs = []referencePathConfig{ GroupVersionKind: &schema.GroupVersionKind{ Kind: "ReplicaSet", }, - Path: []string{"spec", "template", "spec", "volumes", "secret", "name"}, + Path: []string{"spec", "template", "spec", "volumes", "secret", "secretName"}, CreateIfNotPresent: false, }, { @@ -257,7 +257,7 @@ var defaultNameReferencePathConfigs = []referencePathConfig{ GroupVersionKind: &schema.GroupVersionKind{ Kind: "DaemonSet", }, - Path: []string{"spec", "template", "spec", "volumes", "secret", "name"}, + Path: []string{"spec", "template", "spec", "volumes", "secret", "secretName"}, CreateIfNotPresent: false, }, { @@ -278,7 +278,7 @@ var defaultNameReferencePathConfigs = []referencePathConfig{ GroupVersionKind: &schema.GroupVersionKind{ Kind: "StatefulSet", }, - Path: []string{"spec", "template", "spec", "volumes", "secret", "name"}, + Path: []string{"spec", "template", "spec", "volumes", "secret", "secretName"}, CreateIfNotPresent: false, }, { @@ -299,7 +299,7 @@ var defaultNameReferencePathConfigs = []referencePathConfig{ GroupVersionKind: &schema.GroupVersionKind{ Kind: "Job", }, - Path: []string{"spec", "template", "spec", "volumes", "secret", "name"}, + Path: []string{"spec", "template", "spec", "volumes", "secret", "secretName"}, CreateIfNotPresent: false, }, { @@ -320,7 +320,7 @@ var defaultNameReferencePathConfigs = []referencePathConfig{ GroupVersionKind: &schema.GroupVersionKind{ Kind: "CronJob", }, - Path: []string{"spec", "jobTemplate", "spec", "template", "spec", "volumes", "secret", "name"}, + Path: []string{"spec", "jobTemplate", "spec", "template", "spec", "volumes", "secret", "secretName"}, CreateIfNotPresent: false, }, {