Skip to content

Commit ff4ec5f

Browse files
committed
backport: necessary changes for 8_7_x support of kubectl edit fix
1 parent 1d778cc commit ff4ec5f

File tree

1 file changed

+4
-3
lines changed
  • plugins/plugin-kubectl/src/controller/kubectl

1 file changed

+4
-3
lines changed

plugins/plugin-kubectl/src/controller/kubectl/get.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import commandPrefix from '../command-prefix'
2525
import doGetWatchTable from './watch/get-watch'
2626
import extractAppAndName from '../../lib/util/name'
2727
import { isUsage, doHelp } from '../../lib/util/help'
28-
import { KubeResource, isKubeResource } from '../../lib/model/resource'
28+
import { KubeResource, isKubeResource, KubeItems, isKubeItems } from '../../lib/model/resource'
2929
import { KubeOptions, isEntityRequest, isTableRequest, formatOf, isWatchRequest, getNamespace } from './options'
3030
import { stringToTable, KubeTableResponse, isKubeTableResponse } from '../../lib/view/formatTable'
3131

@@ -101,12 +101,12 @@ export async function doGetAsEntity(args: Arguments<KubeOptions>, response: RawR
101101
export async function doGetAsMMR(
102102
args: Arguments<KubeOptions>,
103103
resource: KubeResource
104-
): Promise<MultiModalResponse<KubeResource>> {
104+
): Promise<MultiModalResponse<KubeResource | KubeItems>> {
105105
try {
106106
// attempt to separate out the app and generated parts of the resource name
107107
const { name: prettyName, nameHash, version } = extractAppAndName(resource)
108108

109-
if (resource.kind === 'List') {
109+
if (isKubeItems(resource)) {
110110
// then this is a response to e.g. `kubectl get pods -o yaml`
111111
return {
112112
apiVersion: resource.apiVersion,
@@ -119,6 +119,7 @@ export async function doGetAsMMR(
119119
originatingCommand: args.command,
120120
isKubeResource: true,
121121
modes: [],
122+
items: resource.items,
122123
kuiRawData: resource.kuiRawData
123124
}
124125
}

0 commit comments

Comments
 (0)