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