Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix kubectl download url #1402

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ARG HTTPS_PROXY
ARG KUBECTL_VERSION="v1.31.1"

#donwload & install kubectl
RUN curl -sSL -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl &&\
RUN curl -fsSL -o /usr/local/bin/kubectl https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl &&\
chmod +x /usr/local/bin/kubectl

# Copy scripts
Expand Down
6 changes: 3 additions & 3 deletions scripts/download_argo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import stat

from subprocess import Popen, PIPE
from packaging import version
from dataclasses import dataclass
from typing import List, Dict, Any, Optional, IO, cast

Expand Down Expand Up @@ -73,12 +72,12 @@ def make_file_executable(file_path: str):

def download_gz_binary(url: str, output_file: str, timeout: int = None):
with open(output_file, "wb") as f:
p1 = Popen(["curl", "-sL", url], stdout=PIPE)
p1 = Popen(["curl", "-fsL", url], stdout=PIPE)
p2 = Popen(["gzip", "-d"], stdin=p1.stdout, stdout=f)
cast(IO[bytes], p1.stdout).close()
p2.communicate(timeout=timeout)
if p2.returncode != 0:
raise RuntimeError("Failed to download %s" % url)
raise IOError("Failed to download %s" % url)


def symlink(src: str, dst: str):
Expand Down Expand Up @@ -136,6 +135,7 @@ def main():
"-t",
"--process-timeout",
default=PROCESS_TIMEOUT,
type=int,
help="Subprocesses timeout in seconds. Default: %d" % PROCESS_TIMEOUT,
)
args = parser.parse_args()
Expand Down
Loading