slauger/hcloud-okd4

make fetch doesnt work

Closed this issue · 4 comments

Q-efx commented

root@dev-server:~/hcloud-okd4# make fetch
wget -O openshift-install-linux-none.tar.gz https://github.com/openshift/okd/releases/download/none/openshift-install-linux-none.tar.gz
--2022-08-31 10:02:15-- https://github.com/openshift/okd/releases/download/none/openshift-install-linux-none.tar.gz
Resolving github.com (github.com)... 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com/okd-project/okd/releases/download/none/openshift-install-linux-none.tar.gz [following]
--2022-08-31 10:02:15-- https://github.com/okd-project/okd/releases/download/none/openshift-install-linux-none.tar.gz
Reusing existing connection to github.com:443.
HTTP request sent, awaiting response... 404 Not Found
2022-08-31 10:02:16 ERROR 404: Not Found.

Hi,

the make fetch command depends on the ENV OPENSHIFT_RELEASE. Set it to a fixed OKD Version or use

export OPENSHIFT_RELEASE=$(make latest_version)

to get the latest version via the GitHub API.

make latest_version currently doesn't work because the url has changed:

jq: error (at <stdin>:5): Cannot index object with number
make: *** [Makefile:36: latest_version_okd] Error 5

Reason: The OKD Repo has been moved:

curl https://api.github.com/repos/openshift/okd/tags
{
  "message": "Moved Permanently",
  "url": "https://api.github.com/repositories/222003131/tags",
  "documentation_url": "https://docs.github.com/v3/#http-redirects"
}

I guess the URL in the Makefile needs to be changed:

latest_version_okd:
	@curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/okd-project/okd/tags | jq -j -r .[0].name

Workaround: Set the version manually to the latest tag. E.g.:

export OPENSHIFT_RELEASE=4.11.0-0.okd-2022-08-20-022919

Thanks for the hint! I fixed the GitHub API call and now everything works as expected:

-bash$ make latest_version_ocp
4.10.28

-bash$ make latest_version_okd
4.11.0-0.okd-2022-08-20-022919