Integrate convertion tool to kubectl

Added 'convert' subcommand to kubectl to convert config files
between different API versions.
This commit is contained in:
hurf
2015-07-16 17:20:53 +08:00
parent 86fdc3f85c
commit e1b88c6942
43 changed files with 557 additions and 33 deletions

View File

@@ -532,3 +532,11 @@ func (f *Factory) ClientMapperForCommand() resource.ClientMapper {
return f.RESTClient(mapping)
})
}
// NilClientMapperForCommand returns a ClientMapper which always returns nil.
// When command is running locally and client isn't needed, this mapper can be parsed to NewBuilder.
func (f *Factory) NilClientMapperForCommand() resource.ClientMapper {
return resource.ClientMapperFunc(func(mapping *meta.RESTMapping) (resource.RESTClient, error) {
return nil, nil
})
}