1
0
mirror of https://github.com/rancher/types.git synced 2025-09-03 22:24:38 +00:00

More volume fixes and state changes

This commit is contained in:
Darren Shepherd
2018-03-23 16:22:50 -07:00
parent c8a2bab012
commit 28317983c8
3 changed files with 74 additions and 37 deletions

View File

@@ -29,7 +29,11 @@ func (n *NamespaceReference) FromInternal(data map[string]interface{}) {
func (n *NamespaceReference) ToInternal(data map[string]interface{}) {
for _, path := range n.fields {
convert.Transform(data, path, func(input interface{}) interface{} {
return strings.SplitN(convert.ToString(input), ":", 2)[0]
parts := strings.SplitN(convert.ToString(input), ":", 2)
if len(parts) == 2 {
return parts[1]
}
return parts[0]
})
}
}