Skip to content

Instantly share code, notes, and snippets.

@saurabhkdm
Created December 1, 2020 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saurabhkdm/93a74808699cf68fbe6c151e08f3744a to your computer and use it in GitHub Desktop.
Save saurabhkdm/93a74808699cf68fbe6c151e08f3744a to your computer and use it in GitHub Desktop.
module.exports = (robot) ->
robot.hear /List pods/i, (res) ->
@exec = require('child_process').exec
command = "kubectl get pods"
res.send("Getting your pods")
@exec command, (error, stdout, stderror) ->
if stdout
res.send "```\n" + stdout + "\n```"
else
res.send ("Sorry that didn't work")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment