This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Warning messages from helm template break NS injection (#233)
- Non map type entries in the output of `helm template` are now munged from final generated output; a warning is outputted of what the breaking entry was.
- Loading branch information
Showing
3 changed files
with
136 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package generators | ||
|
||
import ( | ||
"strings" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestCleanK8sManifest(t *testing.T) { | ||
manifest := ` | ||
--- | ||
this should be removed | ||
--- | ||
this: is a valid map and should stay | ||
another: | ||
entry: in the map | ||
--- | ||
this should be removed as well | ||
--- | ||
# This should be removed | ||
--- | ||
--- | ||
this is another: valid map | ||
should: not be removed | ||
--- | ||
# Another to be removed | ||
` | ||
cleaned, err := cleanK8sManifest(manifest) | ||
assert.Nil(t, err) | ||
entries := strings.Split(cleaned, "\n---") | ||
assert.Equal(t, 2, len(entries)) | ||
} |