Skip to content

Commit f6343bf

Browse files
committed
Update ControlPlaneUrl format in GetApplicationEnvironments function and test
1 parent 3fbbdb0 commit f6343bf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/resource/control.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type ApplicationEnvResponse struct {
2020

2121
func GetApplicationEnvironments(namespace, application string) (map[string]string, error) {
2222
url := fmt.Sprintf(
23-
"%s/v1/ns/%s/application/%s/environments",
23+
"%s/ns/%s/application/%s/environments",
2424
config.ControlPlaneUrl, namespace, application,
2525
)
2626
resp, err := http.Get(url)

pkg/resource/control_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestGetApplicationEnvironments(t *testing.T) {
4040
}
4141

4242
func TestGetApplicationEnvironments2(t *testing.T) {
43-
config.ControlPlaneUrl = "http://localhost:8000"
43+
config.ControlPlaneUrl = "http://localhost:8000/v1"
4444

4545
// 调用被测试函数
4646
data, err := GetApplicationEnvironments("default1", "showcase-agent-a1")

0 commit comments

Comments
 (0)