Skip to content

Commit

Permalink
Change kubectl download location to dl.k8s.io (#194)
Browse files Browse the repository at this point in the history
* Change kubectl download location to dl.k8s.io

* pnpm build
  • Loading branch information
jbonzo authored Sep 20, 2024
1 parent 07e0ee2 commit 68d99aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/setup-kubectl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export async function setupKubectl() {
const p = mapOS(osPlatform);
const a = mapArch(osArch);

const downloadURL = `https://storage.googleapis.com/kubernetes-release/release/${kubectlVersion}/bin/${p}/${a}/kubectl`;
const checksumURL = `https://storage.googleapis.com/kubernetes-release/release/${kubectlVersion}/bin/${p}/${a}/kubectl.sha256`;
const downloadURL = `https://dl.k8s.io/release/${kubectlVersion}/bin/${p}/${a}/kubectl`;
const checksumURL = `https://dl.k8s.io/release/${kubectlVersion}/bin/${p}/${a}/kubectl.sha256`;

let cachedPath = tc.find("kubectl", kubectlVersion, osArch);

if (cachedPath) {
core.info(`Found kubectl ${kubectlVersion} in toolcache @ ${cachedPath}`);
} else {
core.info(`Attempting to download kubectl ${kubectlVersion}…`);
core.info(`Attempting to download kubectl ${kubectlVersion} from ${downloadURL}…`);
const pathToCLI = await download(downloadURL, checksumURL);
const dir = `${dirname(pathToCLI)}/kubectl-${kubectlVersion}`;
await mkdir(dir, { recursive: true });
Expand Down

0 comments on commit 68d99aa

Please sign in to comment.