mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
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:
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user