Skip to content

Commit

Permalink
Fix health-root-path in test configurations;
Browse files Browse the repository at this point in the history
  • Loading branch information
joergdw committed Mar 17, 2023
1 parent 1f796c7 commit 7084138
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/autoscaler/api/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"time"

"code.cloudfoundry.org/app-autoscaler/src/autoscaler/routes"
. "code.cloudfoundry.org/app-autoscaler/src/autoscaler/testhelpers"

. "code.cloudfoundry.org/app-autoscaler/src/autoscaler/api/config"
Expand Down Expand Up @@ -257,6 +258,11 @@ rate_limit:
conf.RateLimit.ValidDuration = 1 * time.Second

conf.CredHelperImpl = "path/to/plugin"

conf.Health = models.HealthConfig{
UnprotectedEndpoints: []string{"/", routes.LivenessPath,
routes.ReadinessPath, routes.PrometheusPath, routes.PprofPath},
}
})
JustBeforeEach(func() {
err = conf.Validate()
Expand Down
12 changes: 6 additions & 6 deletions src/autoscaler/integration/components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (components *Components) PrepareGolangApiServerConfig(dbURI string, publicA
Level: LOGLEVEL,
},
Health: models.HealthConfig{
UnprotectedEndpoints: []string{"", routes.LivenessPath,
UnprotectedEndpoints: []string{"/", routes.LivenessPath,
routes.ReadinessPath, routes.PrometheusPath, routes.PprofPath}},
PublicApiServer: apiConfig.ServerConfig{
Port: publicApiPort,
Expand Down Expand Up @@ -396,7 +396,7 @@ func (components *Components) PrepareEventGeneratorConfig(dbUri string, port int
Level: LOGLEVEL,
},
Health: models.HealthConfig{
UnprotectedEndpoints: []string{"", routes.LivenessPath,
UnprotectedEndpoints: []string{"/", routes.LivenessPath,
routes.ReadinessPath, routes.PrometheusPath, routes.PprofPath}},
Server: egConfig.ServerConfig{
Port: port,
Expand Down Expand Up @@ -461,7 +461,7 @@ func (components *Components) PrepareScalingEngineConfig(dbURI string, port int,
Secret: "admin",
},
Health: models.HealthConfig{
UnprotectedEndpoints: []string{"", routes.LivenessPath,
UnprotectedEndpoints: []string{"/", routes.LivenessPath,
routes.ReadinessPath, routes.PrometheusPath, routes.PprofPath}},
Server: seConfig.ServerConfig{
Port: port,
Expand Down Expand Up @@ -499,7 +499,7 @@ func (components *Components) PrepareOperatorConfig(dbURI string, ccUAAURL strin
Level: LOGLEVEL,
},
Health: models.HealthConfig{
UnprotectedEndpoints: []string{"", routes.LivenessPath,
UnprotectedEndpoints: []string{"/", routes.LivenessPath,
routes.ReadinessPath, routes.PrometheusPath, routes.PprofPath}},
CF: cf.Config{
API: ccUAAURL,
Expand Down Expand Up @@ -569,7 +569,7 @@ func (components *Components) PrepareMetricsGatewayConfig(dbURI string, metricSe
Level: LOGLEVEL,
},
Health: models.HealthConfig{
UnprotectedEndpoints: []string{"", routes.LivenessPath,
UnprotectedEndpoints: []string{"/", routes.LivenessPath,
routes.ReadinessPath, routes.PrometheusPath, routes.PprofPath}},
EnvelopChanSize: 500,
NozzleCount: 1,
Expand Down Expand Up @@ -615,7 +615,7 @@ func (components *Components) PrepareMetricsServerConfig(dbURI string, httpClien
Level: LOGLEVEL,
},
Health: models.HealthConfig{
UnprotectedEndpoints: []string{"", routes.LivenessPath,
UnprotectedEndpoints: []string{"/", routes.LivenessPath,
routes.ReadinessPath, routes.PrometheusPath, routes.PprofPath}},
HttpClientTimeout: httpClientTimeout,
NodeAddrs: []string{"localhost"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ var _ = Describe("Integration_Operator_Others", func() {
})

JustBeforeEach(func() {
operatorConfPath = components.PrepareOperatorConfig(dbUrl, fakeCCNOAAUAA.URL(), fmt.Sprintf("https://127.0.0.1:%d", components.Ports[ScalingEngine]), fmt.Sprintf("https://127.0.0.1:%d", components.Ports[Scheduler]), 10*time.Second, 1*24*time.Hour, defaultHttpClientTimeout, tmpDir)
operatorConfPath = components.PrepareOperatorConfig(
dbUrl, fakeCCNOAAUAA.URL(), fmt.Sprintf("https://127.0.0.1:%d",
components.Ports[ScalingEngine]),
fmt.Sprintf("https://127.0.0.1:%d", components.Ports[Scheduler]),
10*time.Second, 1*24*time.Hour, defaultHttpClientTimeout, tmpDir)
startOperator()
})

Expand Down

0 comments on commit 7084138

Please sign in to comment.