Skip to content

docs: exec example #1312

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

Merged
merged 2 commits into from
Nov 15, 2023
Merged
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
4 changes: 1 addition & 3 deletions examples/typescript/exec/exec-example.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as k8s from '@kubernetes/client-node';
import * as stream from 'stream';

const command = process.argv[2];

const kc = new k8s.KubeConfig();
kc.loadFromDefault();

Expand All @@ -11,7 +9,7 @@ exec.exec(
'default',
'nginx-4217019353-9gl4s',
'nginx',
command,
['ls, '-al', '.'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would happen if you run it with: <typescript> ./examples/typescript/exec/exec-example.ts 'ls -al' - that should work, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting “bin not found” errors doing as you suggest/ask. I presume the string vs array is encoded differently in the resultant url

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I think I understand.
I think this is fine as this is only an example. Thank you.

process.stdout as stream.Writable,
process.stderr as stream.Writable,
process.stdin as stream.Readable,
Expand Down