error: read /xxx/xxx/xxx: is a directory when using commands
Summary
Unknown issue when trying to use kubectl commands on gitlab-runner.
I have used this config fine in the past which led me to believe it is a runner issue
Steps to reproduce
Create a repo.
Add a CI file with the staging stage shown below.
Let it run and see the error it produces.
.gitlab-ci.yml
staging:
stage: deploy
image: registry.gitlab.com/gitlab-examples/kubernetes-deploy
environment:
name: production
url: https://redacted.com
before_script:
- kubectl config set-cluster default-cluster --server=$KUBE_URL --certificate-authority=$KUBE_CA_PEM_FILE
- kubectl config set-credentials default-admin --token=$KUBE_TOKEN
- kubectl config set-context default-system --cluster=default-cluster --user=default-admin --namespace=default
- kubectl config use-context default-system
script:
- kubectl set image deployment/embed embed=$CI_REGISTRY_IMAGE:$CI_BUILD_REF
Actual behavior
It gives the error of error: read /builds/disweb/embed: is a directory
Expected behavior
Relevant logs and/or screenshots
job log
Running with gitlab-runner 12.2.0 (a987417a)
on lab FGQi-C1p
Using Docker executor with image registry.gitlab.com/gitlab-examples/kubernetes-deploy ...
Pulling docker image registry.gitlab.com/gitlab-examples/kubernetes-deploy ...
Using docker image sha256:f72f0696c971153613e458f3a6593ae835b554650db2794ee94c63a57cbb7241 for registry.gitlab.com/gitlab-examples/kubernetes-deploy ...
Running on runner-FGQi-C1p-project-4-concurrent-0 via lab...
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/disweb/embed/.git/
Checking out 59e75282 as master...
Removing build/
Skipping Git submodules setup
Downloading artifacts for canary (526)...
Downloading artifacts from coordinator... ok id=526 responseStatus=200 OK token=JNK25EET
$ kubectl config set-cluster default-cluster --server=$KUBE_URL --certificate-authority=$KUBE_CA_PEM_FILE
Cluster "default-cluster" set.
$ kubectl config set-credentials default-admin --token=$KUBE_TOKEN
User "default-admin" set.
$ kubectl config set-context default-system --cluster=default-cluster --user=default-admin --namespace=default
Context "default-system" created.
$ kubectl config use-context default-system
Switched to context "default-system".
$ kubectl get nodes
error: read /builds/disweb/embed: is a directory
ERROR: Job failed: exit code 1
Environment description
This is a gitlab CE installation with a custom runner.
config.toml contents
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "lab"
url = "REDACTED"
token = "REDACTED"
executor = "docker"
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "ubuntu:18-git"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
Used GitLab Runner version
Runtime platform arch=amd64 os=linux pid=4560 revision=a987417a version=12.2.0
