mirror of
https://github.com/niusmallnan/steve.git
synced 2025-07-19 17:07:10 +00:00
Convert to string to fix nil value
This commit is contained in:
parent
f3aa58babd
commit
24e6192504
@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/rancher/norman/pkg/types"
|
"github.com/rancher/norman/pkg/types"
|
||||||
|
"github.com/rancher/norman/pkg/types/convert"
|
||||||
"github.com/rancher/norman/pkg/types/values"
|
"github.com/rancher/norman/pkg/types/values"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -20,8 +21,8 @@ func (d *defaultMapper) FromInternal(data map[string]interface{}) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
name := values.GetValueN(data, "metadata", "name")
|
name := convert.ToString(values.GetValueN(data, "metadata", "name"))
|
||||||
namespace := values.GetValueN(data, "metadata", "namespace")
|
namespace := convert.ToString(values.GetValueN(data, "metadata", "namespace"))
|
||||||
|
|
||||||
if namespace == "" {
|
if namespace == "" {
|
||||||
data["id"] = name
|
data["id"] = name
|
||||||
|
Loading…
Reference in New Issue
Block a user