Switch 'kubectl edit' to use unstructured objects, handle schemaless objects

mark --output-version as deprecated, add example for fully-qualifying version to edit

Add 'kubectl edit' testcase for editing schemaed and schemaless data together

Add 'kubectl edit' testcase for editing unknown version of known group/kind
This commit is contained in:
Jordan Liggitt
2017-02-12 19:31:06 -05:00
parent 5b805bc18a
commit ec271f5c09
25 changed files with 622 additions and 133 deletions

View File

@@ -205,22 +205,8 @@ func TestEdit(t *testing.T) {
t.Fatalf("%s: %v", name, err)
}
f, tf, _, ns := cmdtesting.NewAPIFactory()
f, tf, _, _ := cmdtesting.NewAPIFactory()
tf.Printer = &testPrinter{}
tf.ClientForMappingFunc = func(mapping *meta.RESTMapping) (resource.RESTClient, error) {
versionedAPIPath := ""
if mapping.GroupVersionKind.Group == "" {
versionedAPIPath = "/api/" + mapping.GroupVersionKind.Version
} else {
versionedAPIPath = "/apis/" + mapping.GroupVersionKind.Group + "/" + mapping.GroupVersionKind.Version
}
return &fake.RESTClient{
APIRegistry: api.Registry,
VersionedAPIPath: versionedAPIPath,
NegotiatedSerializer: ns, //unstructuredSerializer,
Client: fake.CreateHTTPClient(reqResp),
}, nil
}
tf.UnstructuredClientForMappingFunc = func(mapping *meta.RESTMapping) (resource.RESTClient, error) {
versionedAPIPath := ""
if mapping.GroupVersionKind.Group == "" {