Skip to content
Snippets Groups Projects
Commit 97d0355704ac authored by steeve.chailloux's avatar steeve.chailloux
Browse files

split now contains resource kind first

parent 4fd1b672157e
No related branches found
No related tags found
No related merge requests found
Pipeline #36369 passed
......@@ -124,5 +124,9 @@
resource := make(map[string]interface{})
require.NoError(t, v.Unmarshal(&resource))
kind, ok := resource["kind"].(string)
require.True(t, ok)
assert.Equal(t, tokens[0], kind)
apiVersion, ok := resource["apiversion"].(string)
require.True(t, ok)
......@@ -127,10 +131,6 @@
apiVersion, ok := resource["apiversion"].(string)
require.True(t, ok)
assert.Equal(t, tokens[0], apiVersion)
kind, ok := resource["kind"].(string)
require.True(t, ok)
assert.Equal(t, tokens[1], kind)
assert.Equal(t, tokens[1], apiVersion)
metadata, ok := resource["metadata"].(map[string]interface{})
require.True(t, ok)
......
......@@ -169,7 +169,7 @@
if !ok {
return nil, fmt.Errorf("fail to type assert metadata.name from: %+v", resource)
}
filename := fmt.Sprintf("%s.%s.%s.yaml", strings.Replace(apiVersion, "/", "_", -1), kind, name)
filename := fmt.Sprintf("%s.%s.%s.yaml", kind, strings.Replace(apiVersion, "/", "_", -1), name)
fPath := filepath.Join(buildDir, filename)
if out, err := yaml.Marshal(resource); err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment