From 47de29da6ced13388ddb9063c09610858a3a1747 Mon Sep 17 00:00:00 2001 From: Jan Dubois Date: Thu, 9 Jan 2025 20:20:01 -0800 Subject: [PATCH] Add spin kube plugin to rddepman version checking No need to download it; we install the plugin via the `spin plugin` command. Signed-off-by: Jan Dubois --- scripts/dependencies/tools.ts | 23 +++++++++++++++++++++++ scripts/rddepman.ts | 1 + 2 files changed, 24 insertions(+) diff --git a/scripts/dependencies/tools.ts b/scripts/dependencies/tools.ts index 502464d3206..060b4a9ae4f 100644 --- a/scripts/dependencies/tools.ts +++ b/scripts/dependencies/tools.ts @@ -627,3 +627,26 @@ export class SpinCLI implements Dependency, GitHubDependency { return semver.rcompare(version1, version2); } } + +export class SpinKubePlugin implements Dependency, GitHubDependency { + name = 'spinKubePlugin'; + githubOwner = 'spinkube'; + githubRepo = 'spin-plugin-kube'; + + download(context: DownloadContext): Promise { + // We don't download anything there; `resources/setup-spin` does the installation. + return Promise.resolve(); + } + + async getAvailableVersions(includePrerelease = false): Promise { + return await getPublishedVersions(this.githubOwner, this.githubRepo, includePrerelease); + } + + versionToTagName(version: string): string { + return `v${ version }`; + } + + rcompareVersions(version1: string, version2: string): -1 | 0 | 1 { + return semver.rcompare(version1, version2); + } +} diff --git a/scripts/rddepman.ts b/scripts/rddepman.ts index 73f155d98ad..c8e2d896b14 100644 --- a/scripts/rddepman.ts +++ b/scripts/rddepman.ts @@ -50,6 +50,7 @@ const dependencies: Dependency[] = [ new tools.CertManager(), new tools.SpinOperator(), new tools.SpinCLI(), + new tools.SpinKubePlugin(), ]; function git(...args: string[]): number | null {