@@ -25,7 +25,7 @@ import commandPrefix from '../command-prefix'
25
25
import doGetWatchTable from './watch/get-watch'
26
26
import extractAppAndName from '../../lib/util/name'
27
27
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'
29
29
import { KubeOptions , isEntityRequest , isTableRequest , formatOf , isWatchRequest , getNamespace } from './options'
30
30
import { stringToTable , KubeTableResponse , isKubeTableResponse } from '../../lib/view/formatTable'
31
31
@@ -101,12 +101,12 @@ export async function doGetAsEntity(args: Arguments<KubeOptions>, response: RawR
101
101
export async function doGetAsMMR (
102
102
args : Arguments < KubeOptions > ,
103
103
resource : KubeResource
104
- ) : Promise < MultiModalResponse < KubeResource > > {
104
+ ) : Promise < MultiModalResponse < KubeResource | KubeItems > > {
105
105
try {
106
106
// attempt to separate out the app and generated parts of the resource name
107
107
const { name : prettyName , nameHash, version } = extractAppAndName ( resource )
108
108
109
- if ( resource . kind === 'List' ) {
109
+ if ( isKubeItems ( resource ) ) {
110
110
// then this is a response to e.g. `kubectl get pods -o yaml`
111
111
return {
112
112
apiVersion : resource . apiVersion ,
@@ -119,6 +119,7 @@ export async function doGetAsMMR(
119
119
originatingCommand : args . command ,
120
120
isKubeResource : true ,
121
121
modes : [ ] ,
122
+ items : resource . items ,
122
123
kuiRawData : resource . kuiRawData
123
124
}
124
125
}
0 commit comments