mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-28 18:38:40 +00:00
fix: allow any type in cli test global values (#8305)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
fc7eb295ef
commit
3967adde6e
3 changed files with 11 additions and 11 deletions
|
@ -1,8 +1,8 @@
|
|||
package values
|
||||
|
||||
type Values struct {
|
||||
Policies []Policy `json:"policies"`
|
||||
GlobalValues map[string]string `json:"globalValues"`
|
||||
NamespaceSelectors []NamespaceSelector `json:"namespaceSelector"`
|
||||
Subresources []Subresource `json:"subresources"`
|
||||
Policies []Policy `json:"policies"`
|
||||
GlobalValues map[string]interface{} `json:"globalValues"`
|
||||
NamespaceSelectors []NamespaceSelector `json:"namespaceSelector"`
|
||||
Subresources []Subresource `json:"subresources"`
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ func Command() *cobra.Command {
|
|||
output = file
|
||||
}
|
||||
values := valuesapi.Values{
|
||||
GlobalValues: map[string]string{},
|
||||
GlobalValues: map[string]interface{}{},
|
||||
}
|
||||
for _, result := range namespaceSelector {
|
||||
result := parseNamespaceSelector(result)
|
||||
|
|
|
@ -48,14 +48,14 @@ func TestNew(t *testing.T) {
|
|||
resourcePath: "",
|
||||
path: "",
|
||||
vals: &valuesapi.Values{
|
||||
GlobalValues: map[string]string{
|
||||
GlobalValues: map[string]interface{}{
|
||||
"bar": "baz",
|
||||
},
|
||||
},
|
||||
vars: nil,
|
||||
want: &Variables{
|
||||
values: &valuesapi.Values{
|
||||
GlobalValues: map[string]string{
|
||||
GlobalValues: map[string]interface{}{
|
||||
"bar": "baz",
|
||||
},
|
||||
},
|
||||
|
@ -67,7 +67,7 @@ func TestNew(t *testing.T) {
|
|||
resourcePath: "",
|
||||
path: "",
|
||||
vals: &valuesapi.Values{
|
||||
GlobalValues: map[string]string{
|
||||
GlobalValues: map[string]interface{}{
|
||||
"bar": "baz",
|
||||
},
|
||||
},
|
||||
|
@ -76,7 +76,7 @@ func TestNew(t *testing.T) {
|
|||
},
|
||||
want: &Variables{
|
||||
values: &valuesapi.Values{
|
||||
GlobalValues: map[string]string{
|
||||
GlobalValues: map[string]interface{}{
|
||||
"bar": "baz",
|
||||
},
|
||||
},
|
||||
|
@ -169,14 +169,14 @@ func TestNew(t *testing.T) {
|
|||
resourcePath: "",
|
||||
path: "../_testdata/values/limit-configmap-for-sa.yaml",
|
||||
vals: &valuesapi.Values{
|
||||
GlobalValues: map[string]string{
|
||||
GlobalValues: map[string]interface{}{
|
||||
"bar": "baz",
|
||||
},
|
||||
},
|
||||
vars: nil,
|
||||
want: &Variables{
|
||||
values: &valuesapi.Values{
|
||||
GlobalValues: map[string]string{
|
||||
GlobalValues: map[string]interface{}{
|
||||
"bar": "baz",
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue