In a bitbucket pipeline, I'm trying to run the command: "kubectl delete job/rolling-update", and tried this:
- step:
name: Delete any previously-existing rolling-update jobs - OK to fail
script:
- set +e
- pipe: atlassian/kubectl-run:1.3.3
variables:
KUBE_CONFIG: $KUBE_CONFIG
KUBECTL_COMMAND: "delete"
KUBECTL_ARGS: "job/rolling-update"
- set -e
- sleep 10
however, the error that I get is this:
<span>Example resource specifications include:</span><span> <br> '-f rsrc.yaml'</span><span> <br> '--filename=rsrc.json'</span><span> <br> '<resource> <name>'</span><span> <br> '<resource>'</span><span><br>✖ kubectl delete failed.</span><span>error: You must provide one or more resources by argument or filename.<br></span>
and I thought I was providing the resource as described in the last line.
EDIT: I also tried:
KUBECTL_ARGS: "['job/rolling-update']"
and that didn't work either.
Note that running this command locally works fine, so the problem is with passing the arguments to the pipe command.
Does anyone know how to fix this issue?
While I'm here, it would be nice to have an example of this in the documentation for this pipe instead of giving all examples using only "apply":
https://bitbucket.org/atlassian/kubectl-run/src/master/README.md
Thank you!