diff --git a/src/autoscaler/api/config/config_test.go b/src/autoscaler/api/config/config_test.go index 737eba217c..bc46c32281 100644 --- a/src/autoscaler/api/config/config_test.go +++ b/src/autoscaler/api/config/config_test.go @@ -113,7 +113,8 @@ var _ = Describe("Config", func() { }, }, )) - Expect(conf.CredHelperImpl).To(Equal("default")) + Expect(conf.CredHelperImpl).To(Equal(Expect(conf.Health.UnprotectedEndpoints).To( + ContainElements("/", "/health/liveness","/health/prometheus", }) }) diff --git a/src/autoscaler/api/config/testdata/valid_config.yml b/src/autoscaler/api/config/testdata/valid_config.yml index f2168ecba5..994eca0f65 100644 --- a/src/autoscaler/api/config/testdata/valid_config.yml +++ b/src/autoscaler/api/config/testdata/valid_config.yml @@ -31,6 +31,8 @@ db: catalog_schema_path: '../schemas/catalog.schema.json' catalog_path: '../exampleconfig/catalog-example.json' policy_schema_path: '../exampleconfig/policy.schema.json' +health: + unprotected_endpoints: ["/", "/health/liveness", "/health/prometheus", "/debug/pprof"] scheduler: scheduler_url: https://localhost:8083 tls: diff --git a/src/autoscaler/integration/integration_operator_others_test.go b/src/autoscaler/integration/integration_operator_others_test.go index 4dcd48d463..231d4b797f 100644 --- a/src/autoscaler/integration/integration_operator_others_test.go +++ b/src/autoscaler/integration/integration_operator_others_test.go @@ -111,7 +111,6 @@ var _ = Describe("Integration_Operator_Others", func() { Consistently(func() bool { return activeScheduleExists(testAppId) }). WithTimeout(10 * time.Second). WithPolling(1 * time.Second).Should(BeTrue()) - }) It("should delete an active schedule in scaling engine after restart", func() { diff --git a/src/autoscaler/metricsforwarder/config/config_test.go b/src/autoscaler/metricsforwarder/config/config_test.go index 7f5ee97b3a..fe43b336e7 100644 --- a/src/autoscaler/metricsforwarder/config/config_test.go +++ b/src/autoscaler/metricsforwarder/config/config_test.go @@ -67,6 +67,7 @@ db: connection_max_lifetime: 60s health: port: 9999 + unprotected_endpoints: ["/", "/health/liveness", "/health/prometheus", "/debug/pprof"] cred_helper_impl: default `) }) @@ -75,6 +76,8 @@ cred_helper_impl: default Expect(conf.Server.Port).To(Equal(8081)) Expect(conf.Logging.Level).To(Equal("debug")) Expect(conf.Health.Port).To(Equal(9999)) + Expect(conf.Health.UnprotectedEndpoints).To( + ContainElements("/", "/health/liveness", "/health/prometheus", "/debug/pprof")) Expect(conf.LoggregatorConfig.MetronAddress).To(Equal("127.0.0.1:3457")) Expect(conf.Db[db.PolicyDb]).To(Equal( db.DatabaseConfig{ diff --git a/src/autoscaler/operator/config/config_test.go b/src/autoscaler/operator/config/config_test.go index 7ab76e9c43..f638fb85bd 100644 --- a/src/autoscaler/operator/config/config_test.go +++ b/src/autoscaler/operator/config/config_test.go @@ -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/db" @@ -241,8 +242,10 @@ scheduler: conf.AppSyncer.DB.URL = "postgres://pqgotest:password@exampl.com/pqgotest" conf.DBLock.DB.URL = "postgres://pqgotest:password@exampl.com/pqgotest" conf.HttpClientTimeout = 10 * time.Second - conf.Health.Port = 8081 + conf.Health.Port = 8081 + conf.Health.UnprotectedEndpoints = []string{"/", routes.LivenessPath, + routes.PrometheusPath, routes.PprofPath} }) JustBeforeEach(func() {