karancode / kustomize-github-action

:european_castle: Github action for kustomize
https://github.com/marketplace/actions/kustomize-github-action
MIT License
46 stars 29 forks source link

[BUG] curl fails to download kustomize #46

Open BartoszBrodzinski-TomTom opened 4 months ago

BartoszBrodzinski-TomTom commented 4 months ago

Describe the bug curl is failing to download kustomize.

getting download url for kustomize v5.4.2
curl: option : blank argument where content is expected
curl: try 'curl --help' or 'curl --manual' for more information
curl: option : blank argument where content is expected
curl: try 'curl --help' or 'curl --manual' for more information
curl: option : blank argument where content is expected
curl: try 'curl --help' or 'curl --manual' for more information
...
Failed to find download URL for v5.4.2

The action started failing today after yesterday's alpine release: https://alpinelinux.org/posts/Alpine-3.20.0-released.html

I looks like with latest release of alpine:3.20, apk repository contains curl app version that isn't backward compatible.

Changing versions of kustomize to download doesn't do the job.

To Reproduce Just run the action.

Expected behavior Action is able to download kustomize with curl and run kustomize on files in repo.

Screenshots/Actions log No need for screenshot, logs at the top of the issue.

Running on: doesn't matter

Additional context https://github.com/karancode/kustomize-github-action/blob/883a86ec3535e4e7d0fe6450a85f8325c97d2a7b/Dockerfile#L1

Pinning alpine to major version only, without minor version is not a very good approach when it comes to alpine images. Different releases of alpine have different versions of apps in apk repository. Up to version 3.19 everything worked fine, now it fails with 3.20.

mgutierrez-wavefin commented 4 months ago

We ran across this issue as well. The short-term solution is to set a github token for authentication.

We believe it's caused by these lines: https://github.com/karancode/kustomize-github-action/blob/master/src/entrypoint.sh#L43-L46 and how it's used on L54 with "${with_token[@]}". When with_token is empty (which we previously do not have a token set), it inserts blank quotes which curl does not like. I don't think it's an issue with curl but rather with bash, since it was updated in the newest version of alpine. If you change L43 to with_token=(), it resolves the issue.

kalyanteja19 commented 4 months ago

Describe the bug curl is failing to download kustomize.

getting download url for kustomize v5.4.2
curl: option : blank argument where content is expected
curl: try 'curl --help' or 'curl --manual' for more information
curl: option : blank argument where content is expected
curl: try 'curl --help' or 'curl --manual' for more information
curl: option : blank argument where content is expected
curl: try 'curl --help' or 'curl --manual' for more information
...
Failed to find download URL for v5.4.2

The action started failing today after yesterday's alpine release: https://alpinelinux.org/posts/Alpine-3.20.0-released.html

I looks like with latest release of alpine:3.20, apk repository contains curl app version that isn't backward compatible.

Changing versions of kustomize to download doesn't do the job.

To Reproduce Just run the action.

Expected behavior Action is able to download kustomize with curl and run kustomize on files in repo.

Screenshots/Actions log No need for screenshot, logs at the top of the issue.

Running on: doesn't matter

Additional context

https://github.com/karancode/kustomize-github-action/blob/883a86ec3535e4e7d0fe6450a85f8325c97d2a7b/Dockerfile#L1

Pinning alpine to major version only, without minor version is not a very good approach when it comes to alpine images. Different releases of alpine have different versions of apps in apk repository. Up to version 3.19 everything worked fine, now it fails with 3.20.

We are also facing this issue

elliottsj commented 4 months ago

Per @mgutierrez-wavefin's comment, we worked around this by passing a parameter

with:
  token: ${{ github.token }}
kalyanteja19 commented 4 months ago

@elliottsj, @mgutierrez-wavefin fix worked like a charm, thank you