Created
July 26, 2019 12:38
-
-
Save srfrnk/385f2c1a0be392ac007c147126b3816f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if filepath.Ext(mf.path) == ".json" { | |
| // Unmarshal the YAML instead of directly marshaling to JSON to support future changes of kustomizationFile::marshal method: | |
| k := make(map[string]interface{}) | |
| err := yaml.Unmarshal(data, &k) | |
| if err != nil { | |
| return err | |
| } | |
| // Remove `kind` and `apiVersion` so as make minimal changes to original source file: | |
| delete(k, "kind") | |
| delete(k, "apiVersion") | |
| data, err = json.MarshalIndent(k, "", " ") | |
| if err != nil { | |
| return err | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment