Skip to content

Commit

Permalink
change to localhost
Browse files Browse the repository at this point in the history
Signed-off-by: zirain <zirain2009@gmail.com>
  • Loading branch information
zirain committed Oct 31, 2024
1 parent c266511 commit 5c4e99b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/cmd/envoy/shutdown_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,8 @@ func Shutdown(drainTimeout time.Duration, minDrainDuration time.Duration, exitAt

// postEnvoyAdminAPI sends a POST request to the Envoy admin API
func postEnvoyAdminAPI(path string) error {
// TODO: change bootstrap.AdminAddress() to localhost because there're in the same pod?
if resp, err := http.Post(fmt.Sprintf("http://%s:%d/%s",
bootstrap.AdminAddress(egv1a1.IPv4), bootstrap.EnvoyAdminPort, path), "application/json", nil); err != nil {
"localhost", bootstrap.EnvoyAdminPort, path), "application/json", nil); err != nil {

Check warning on line 174 in internal/cmd/envoy/shutdown_manager.go

View check run for this annotation

Codecov / codecov/patch

internal/cmd/envoy/shutdown_manager.go#L174

Added line #L174 was not covered by tests
return err
} else {
defer resp.Body.Close()
Expand All @@ -188,7 +187,7 @@ func postEnvoyAdminAPI(path string) error {
func getTotalConnections() (*int, error) {
// Send request to Envoy admin API to retrieve server.total_connections stat
if resp, err := http.Get(fmt.Sprintf("http://%s:%d//stats?filter=^server\\.total_connections$&format=json",
bootstrap.AdminAddress(egv1a1.IPv4), bootstrap.EnvoyAdminPort)); err != nil {
"localhost", bootstrap.EnvoyAdminPort)); err != nil {

Check warning on line 190 in internal/cmd/envoy/shutdown_manager.go

View check run for this annotation

Codecov / codecov/patch

internal/cmd/envoy/shutdown_manager.go#L190

Added line #L190 was not covered by tests
return nil, err
} else {
defer resp.Body.Close()
Expand Down

0 comments on commit 5c4e99b

Please sign in to comment.