-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rename install2 command to install, install to install-legacy * test disabling operator overrides * handle reworking map[interface{}]interface{} properly * get then update status * remove chart apply * f
- Loading branch information
Showing
6 changed files
with
123 additions
and
23 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
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,92 @@ | ||
package helm | ||
|
||
import ( | ||
"github.com/stretchr/testify/require" | ||
"testing" | ||
) | ||
|
||
func Test_cleanUpGenericMap(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
in map[string]interface{} | ||
want map[string]interface{} | ||
}{ | ||
{ | ||
name: "single level map", | ||
in: map[string]interface{}{ | ||
"abc": "xyz", | ||
"number": 5, | ||
"float": 1.5, | ||
"bool": true, | ||
"array": []interface{}{ | ||
"element", | ||
}, | ||
}, | ||
want: map[string]interface{}{ | ||
"abc": "xyz", | ||
"number": 5, | ||
"float": 1.5, | ||
"bool": true, | ||
"array": []interface{}{ | ||
"element", | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: "nested map, string keys", | ||
in: map[string]interface{}{ | ||
"nest": map[string]interface{}{ | ||
"abc": "xyz", | ||
"number": 5, | ||
"float": 1.5, | ||
"bool": true, | ||
"array": []interface{}{ | ||
"element", | ||
}, | ||
}, | ||
}, | ||
want: map[string]interface{}{ | ||
"nest": map[string]interface{}{ | ||
"abc": "xyz", | ||
"number": 5, | ||
"float": 1.5, | ||
"bool": true, | ||
"array": []interface{}{ | ||
"element", | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: "nested map, interface keys", // this is what would fail previously | ||
in: map[string]interface{}{ | ||
"nest": map[interface{}]interface{}{ | ||
"abc": "xyz", | ||
"number": 5, | ||
"float": 1.5, | ||
"bool": true, | ||
"array": []interface{}{ | ||
"element", | ||
}, | ||
}, | ||
}, | ||
want: map[string]interface{}{ | ||
"nest": map[string]interface{}{ | ||
"abc": "xyz", | ||
"number": 5, | ||
"float": 1.5, | ||
"bool": true, | ||
"array": []interface{}{ | ||
"element", | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
req := require.New(t) | ||
req.Equal(tt.want, cleanUpGenericMap(tt.in)) | ||
}) | ||
} | ||
} |
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