Make a RESTMapper scope aware

This commit is contained in:
derekwaynecarr
2015-01-29 11:35:06 -05:00
parent e335e2d3e2
commit 71ec444d63
5 changed files with 122 additions and 39 deletions

View File

@@ -54,6 +54,9 @@ func (m *Mapper) InfoForData(data []byte, source string) (*Info, error) {
}
name, _ := mapping.MetadataAccessor.Name(obj)
namespace, _ := mapping.MetadataAccessor.Namespace(obj)
if mapping.Scope.Name != "namespace" {
namespace = ""
}
resourceVersion, _ := mapping.MetadataAccessor.ResourceVersion(obj)
return &Info{
Mapping: mapping,