Skip to content

Commit

Permalink
Merge pull request #2062 from xanzy/metadata-proxy
Browse files Browse the repository at this point in the history
Implement `externalK8sProxyUrl` field in Metadata API
  • Loading branch information
RicePatrick authored Nov 18, 2024
2 parents 24eba26 + 29c7d05 commit 912f9bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
7 changes: 4 additions & 3 deletions metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down
17 changes: 10 additions & 7 deletions metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}`)
Expand All @@ -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,
}
Expand Down

0 comments on commit 912f9bf

Please sign in to comment.