kubernetes pod: no url specified when running curl through image

9/27/2019

I have an image whose ENTRYPOINT is the following:

TOKEN=$(gcloud auth print-identity-token)

curl -s -XGET -H "Authorization: Bearer $TOKEN"

And here is my container spec within a Job definition that invokes the above image:

    spec:
      restartPolicy: OnFailure
      containers:
      - name:  pre-upgrade-job
        image: "my-image:0.0.1"
        args: ["https://some-url"]

However, invocation fails with:

➢  k logs -f my-pod
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information

edit: Here is my Dockerfile

TOKEN=$(gcloud auth print-identity-token)

echo $1

curl -s -XGET -H "Authorization: Bearer $TOKEN"
-- pkaramol
curl
docker
kubernetes

1 Answer

9/27/2019

For some reason it turns out it was en escaping issue.

The following worked

spec:
  restartPolicy: OnFailure
  containers:
  - name:  pre-upgrade-job
    image: "my-image:0.0.1"
    args: 
     - "https://some-url"
-- pkaramol
Source: StackOverflow