pkaramol
pkaramol

Reputation: 19432

kubernetes pod: no url specified when running curl through image

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"

Upvotes: 0

Views: 384

Answers (1)

pkaramol
pkaramol

Reputation: 19432

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"

Upvotes: 1

Related Questions