Skip to content

Commit

Permalink
Fix kubectl download url (#1402)
Browse files Browse the repository at this point in the history
* Fix kubectl download url

* Add && for curl pipe in Dockerfile
  • Loading branch information
koropets authored Oct 3, 2024
1 parent 430dfe7 commit 5060329
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 5060329

Please sign in to comment.