Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugins/plugin-kubectl): kubectl get all fails with resource type error #7736

Merged
merged 1 commit into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion plugins/plugin-kubectl/src/controller/kubectl/explain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,11 @@ async function fetch(command: string, args: Arguments, kindAsProvidedByUser: str
}
}
} catch (err) {
if (!/does not exist/i.test(err.message) && !/couldn't find resource/i.test(err.message)) {
if (
!/does not exist/i.test(err.message) &&
!/couldn't find resource/i.test(err.message) &&
!/resource type/i.test(err.message)
) {
console.error(`error explaining kind ${kindAsProvidedByUser}`, args, err)
throw err
} else {
Expand Down
9 changes: 9 additions & 0 deletions plugins/plugin-kubectl/src/test/k8s2/get-pod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,15 @@ commands.forEach(command => {
.catch(Common.oops(this, true))
})

it(`should get the pod with ${command} get all ${inNamespace}`, () => {
return CLI.command(`${command} get all ${inNamespace}`, this.app)
.then(
ReplExpect.okWithCustom<string>({ selector: Selectors.BY_NAME('nginx') })
)
.then((selector: string) => waitForGreen(this.app, selector))
.catch(Common.oops(this, true))
})

it(`should toggle between grid and list mode`, async () => {
try {
const res = await CLI.command(`${command} get pods ${inNamespace}`, this.app)
Expand Down