Skip to content

Commit ca7bdc4

Browse files
committed
feat: Update project control plane API to fully qualified format
1 parent 7edc772 commit ca7bdc4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/tenant/multi_tenant_registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func NewMultiTenantRegistry(
7474
// forProject() method.
7575
func (r *MultiTenantRegistry) projectRestConfig(projectName string) *rest.Config {
7676
c := rest.CopyConfig(r.baseConfig)
77-
c.Host = strings.TrimSuffix(r.baseConfig.Host, "/") + "/projects/" + projectName + "/control-plane"
77+
c.Host = strings.TrimSuffix(r.baseConfig.Host, "/") + "/apis/resourcemanager.miloapis.com/v1alpha1/projects/" + projectName + "/control-plane"
7878
return c
7979
}
8080

internal/tenant/registry_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,19 @@ func TestMultiTenantRegistry_ProjectRestConfig(t *testing.T) {
160160
name: "base host without trailing slash",
161161
baseHost: "https://api.example.com",
162162
projectName: "my-project",
163-
wantHost: "https://api.example.com/projects/my-project/control-plane",
163+
wantHost: "https://api.example.com/apis/resourcemanager.miloapis.com/v1alpha1/projects/my-project/control-plane",
164164
},
165165
{
166166
name: "base host with trailing slash",
167167
baseHost: "https://api.example.com/",
168168
projectName: "my-project",
169-
wantHost: "https://api.example.com/projects/my-project/control-plane",
169+
wantHost: "https://api.example.com/apis/resourcemanager.miloapis.com/v1alpha1/projects/my-project/control-plane",
170170
},
171171
{
172172
name: "base host with path suffix",
173173
baseHost: "https://api.example.com/prefix",
174174
projectName: "other-project",
175-
wantHost: "https://api.example.com/prefix/projects/other-project/control-plane",
175+
wantHost: "https://api.example.com/prefix/apis/resourcemanager.miloapis.com/v1alpha1/projects/other-project/control-plane",
176176
},
177177
}
178178

0 commit comments

Comments
 (0)