From 29c7d054ce9c4937b175323fbc9f9f5e94a2113c Mon Sep 17 00:00:00 2001 From: Timo Furrer Date: Mon, 18 Nov 2024 17:39:40 +0100 Subject: [PATCH] Implement `externalK8sProxyUrl` field in Metadata API see https://docs.gitlab.com/ee/api/metadata.html#:~:text=kas.externalK8sProxyUrl --- metadata.go | 7 ++++--- metadata_test.go | 17 ++++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/metadata.go b/metadata.go index db23a81e4..3550c4944 100644 --- a/metadata.go +++ b/metadata.go @@ -33,9 +33,10 @@ type Metadata struct { Version string `json:"version"` Revision string `json:"revision"` KAS struct { - Enabled bool `json:"enabled"` - ExternalURL string `json:"externalUrl"` - Version string `json:"version"` + Enabled bool `json:"enabled"` + ExternalURL string `json:"externalUrl"` + ExternalK8SProxyURL string `json:"externalK8sProxyUrl"` + Version string `json:"version"` } `json:"kas"` Enterprise bool `json:"enterprise"` } diff --git a/metadata_test.go b/metadata_test.go index 637c4c4f5..4e4b75c8c 100644 --- a/metadata_test.go +++ b/metadata_test.go @@ -35,7 +35,8 @@ func TestGetMetadata(t *testing.T) { "enterprise": true, "kas": { "enabled": true, - "externalUrl": "wss://kas.gitlab.com", + "externalUrl": "wss://kas.gitlab.example.com", + "externalK8sProxyUrl": "https://kas.gitlab.example.com/k8s-proxy", "version": "15.6.0-rc2" } }`) @@ -48,13 +49,15 @@ func TestGetMetadata(t *testing.T) { want := &Metadata{ Version: "15.6.0-pre", Revision: "016e8d8bdc3", KAS: struct { - Enabled bool `json:"enabled"` - ExternalURL string `json:"externalUrl"` - Version string `json:"version"` + Enabled bool `json:"enabled"` + ExternalURL string `json:"externalUrl"` + ExternalK8SProxyURL string `json:"externalK8sProxyUrl"` + Version string `json:"version"` }{ - Enabled: true, - ExternalURL: "wss://kas.gitlab.com", - Version: "15.6.0-rc2", + Enabled: true, + ExternalURL: "wss://kas.gitlab.example.com", + ExternalK8SProxyURL: "https://kas.gitlab.example.com/k8s-proxy", + Version: "15.6.0-rc2", }, Enterprise: true, }