From eb108b6ab1398b679103041eb4f29b66f7086614 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 3 Feb 2024 17:48:45 +0100 Subject: [PATCH] bump std and fix isTTY & actions deprecation warning --- .github/workflows/deno-ci.yaml | 8 ++++---- deps.ts | 7 +++---- lib/kubeconfig.ts | 2 +- lib/stream-transformers.ts | 2 +- transports/via-kubeconfig.ts | 2 +- transports/via-kubectl-raw.ts | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deno-ci.yaml b/.github/workflows/deno-ci.yaml index bffc654..29502d6 100644 --- a/.github/workflows/deno-ci.yaml +++ b/.github/workflows/deno-ci.yaml @@ -23,7 +23,7 @@ jobs: steps: - name: Checkout source - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Use Deno ${{ matrix.deno-version }} uses: denoland/setup-deno@v1 @@ -33,7 +33,7 @@ jobs: # "https" cache: code from the Internet # External sources won't change much so we use less precise keys - name: Cache https:// - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache/deno/deps/https key: deno-https/v1-${{ github.sha }} @@ -57,7 +57,7 @@ jobs: steps: - name: Checkout source - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Use Deno ${{ matrix.deno-version }} uses: denoland/setup-deno@v1 @@ -67,7 +67,7 @@ jobs: # "https" cache: code from the Internet # External sources won't change much so we use less precise keys - name: Cache https:// - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache/deno/deps/https key: deno-https/v1-${{ github.sha }} diff --git a/deps.ts b/deps.ts index c8a410a..6bc9301 100644 --- a/deps.ts +++ b/deps.ts @@ -1,6 +1,5 @@ -export { join as joinPath } from "https://deno.land/std@0.202.0/path/mod.ts"; +export { join as joinPath } from "https://deno.land/std@0.214.0/path/mod.ts"; -export { parse as parseYaml } from "https://deno.land/std@0.202.0/yaml/mod.ts"; +export { parse as parseYaml } from "https://deno.land/std@0.214.0/yaml/mod.ts"; -export { TextLineStream } from "https://deno.land/std@0.202.0/streams/text_line_stream.ts"; -export { readableStreamFromReader } from "https://deno.land/std@0.202.0/streams/readable_stream_from_reader.ts"; +export { TextLineStream } from "https://deno.land/std@0.214.0/streams/text_line_stream.ts"; \ No newline at end of file diff --git a/lib/kubeconfig.ts b/lib/kubeconfig.ts index 1cdd82b..ac9432f 100644 --- a/lib/kubeconfig.ts +++ b/lib/kubeconfig.ts @@ -221,7 +221,7 @@ export class KubeConfigContext { const execConfig = this.user['exec']; if (!execConfig) throw new Error(`BUG: execConfig disappeared`); - const isTTY = Deno.isatty(Deno.stdin.rid); + const isTTY = Deno.stdin.isTerminal(); const stdinPolicy = execConfig.interactiveMode ?? 'IfAvailable'; if (stdinPolicy == 'Always' && !isTTY) { throw new Error(`KubeConfig exec plugin wants a TTY, but stdin is not a TTY`); diff --git a/lib/stream-transformers.ts b/lib/stream-transformers.ts index bcf31dd..caf1700 100644 --- a/lib/stream-transformers.ts +++ b/lib/stream-transformers.ts @@ -2,7 +2,7 @@ import { JSONObject, WatchEvent } from './contract.ts'; function parseJsonLine(line: string, controller: TransformStreamDefaultController) { if (!line.startsWith('{')) { - throw new Error(`JSON line doesn't start with {: `+line.slice(0, 256)); + throw new Error(`JSON line doesn't start with {: ${line.slice(0, 256)}`); } controller.enqueue(JSON.parse(line)); } diff --git a/transports/via-kubeconfig.ts b/transports/via-kubeconfig.ts index 18d63c6..e3aebfc 100644 --- a/transports/via-kubeconfig.ts +++ b/transports/via-kubeconfig.ts @@ -50,7 +50,7 @@ export class KubeConfigRestClient implements RestClient { await KubeConfig.getInClusterConfig()); } - static async forKubectlProxy(): Promise { + static forKubectlProxy(): Promise { return this.forKubeConfig( KubeConfig.getSimpleUrlConfig({ baseUrl: 'http://localhost:8001', diff --git a/transports/via-kubectl-raw.ts b/transports/via-kubectl-raw.ts index 40876bd..96078f7 100644 --- a/transports/via-kubectl-raw.ts +++ b/transports/via-kubectl-raw.ts @@ -1,4 +1,4 @@ -import { readableStreamFromReader, TextLineStream } from '../deps.ts'; +import { TextLineStream } from '../deps.ts'; import { RestClient, RequestOptions, JSONValue, KubernetesTunnel } from '../lib/contract.ts'; import { JsonParsingTransformer } from '../lib/stream-transformers.ts';