From bc5859d44bb432eaec3c15953224b3b1413af74f Mon Sep 17 00:00:00 2001 From: Eyob Tefera Date: Sat, 1 Aug 2020 08:55:00 +0000 Subject: [PATCH] Replace patchesJson6902 field with patches. --- api/types/fix.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/types/fix.go b/api/types/fix.go index 71548bea5..ed386a133 100644 --- a/api/types/fix.go +++ b/api/types/fix.go @@ -9,14 +9,15 @@ import ( "sigs.k8s.io/yaml" ) -// FixKustomizationPreUnmarshalling modies the raw data +// FixKustomizationPreUnmarshalling modifies the raw data // before marshalling - e.g. changes old field names to // new field names. func FixKustomizationPreUnmarshalling(data []byte) ([]byte, error) { - deprecateFieldsMap := map[string]string{ - "imageTags:": "images:", + deprecatedFieldsMap := map[string]string{ + "imageTags:": "images:", + "patchesJson6902": "patches", } - for oldname, newname := range deprecateFieldsMap { + for oldname, newname := range deprecatedFieldsMap { pattern := regexp.MustCompile(oldname) data = pattern.ReplaceAll(data, []byte(newname)) }