Skip to content

Commit

Permalink
Remove deprecated flag adminHTTPPortWarning
Browse files Browse the repository at this point in the history
Add breaking change entry to CHANGELOG

Fixes part of jaegertracing#2738

Signed-off-by: pradeepnnv <pradeepnnv@gmail.com>
  • Loading branch information
pradeepnnv committed Jan 31, 2021
1 parent e95ec24 commit 26b5544
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Changes by Version

#### Breaking changes

* Remove depricated flags `healthCheckHTTPPortWarning` & `adminHTTPPortWarning` ([#2752](https://github.com/jaegertracing/jaeger/pull/2752), [@pradeepnnv](https://github.com/pradeepnnv))

#### New Features

* Add TLS Support for GRPC and HTTP endpoints of the Query server ([#2337](https://github.com/jaegertracing/jaeger/pull/2337), [@rjs211](https://github.com/rjs211))
Expand Down
14 changes: 0 additions & 14 deletions cmd/flags/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,12 @@ import (
"github.com/jaegertracing/jaeger/pkg/healthcheck"
"github.com/jaegertracing/jaeger/pkg/recoveryhandler"
"github.com/jaegertracing/jaeger/pkg/version"
"github.com/jaegertracing/jaeger/ports"
)

const (
healthCheckHTTPPort = "health-check-http-port"
adminHTTPPort = "admin-http-port"
adminHTTPHostPort = "admin.http.host-port"

adminHTTPPortWarning = "(deprecated, will be removed after 2020-06-30 or in release v1.20.0, whichever is later)"
)

// AdminServer runs an HTTP server with admin endpoints, such as healthcheck at /, /metrics, etc.
Expand Down Expand Up @@ -73,25 +70,14 @@ func (s *AdminServer) setLogger(logger *zap.Logger) {

// AddFlags registers CLI flags.
func (s *AdminServer) AddFlags(flagSet *flag.FlagSet) {
flagSet.Int(adminHTTPPort, 0, adminHTTPPortWarning+" see --"+adminHTTPHostPort)
flagSet.String(adminHTTPHostPort, s.adminHostPort, fmt.Sprintf("The host:port (e.g. 127.0.0.1%s or %s) for the admin server, including health check, /metrics, etc.", s.adminHostPort, s.adminHostPort))
}

// Util function to use deprecated flag value if specified
func (s *AdminServer) checkDeprecatedFlag(v *viper.Viper, actualFlagName string, expectedFlagName string) {
if v := v.GetInt(actualFlagName); v != 0 {
s.logger.Sugar().Warnf("Using deprecated flag %s, please upgrade to %s", actualFlagName, expectedFlagName)
s.adminHostPort = ports.PortToHostPort(v)
}
}

// InitFromViper initializes the server with properties retrieved from Viper.
func (s *AdminServer) initFromViper(v *viper.Viper, logger *zap.Logger) {
s.setLogger(logger)

s.adminHostPort = v.GetString(adminHTTPHostPort)
s.checkDeprecatedFlag(v, healthCheckHTTPPort, adminHTTPHostPort)
s.checkDeprecatedFlag(v, adminHTTPPort, adminHTTPHostPort)
}

// Handle adds a new handler to the admin server.
Expand Down

0 comments on commit 26b5544

Please sign in to comment.