Skip to content

Commit

Permalink
Remove deprecated admin server flags (#2752)
Browse files Browse the repository at this point in the history
* Remove healthCheckHTTPPortWarning

Fixes #2738

Signed-off-by: pradeepnnv <pradeepnnv@gmail.com>

* Remove deprecated flag adminHTTPPortWarning

Add breaking change entry to CHANGELOG

Fixes part of #2738

Signed-off-by: pradeepnnv <pradeepnnv@gmail.com>

* Update CHANGELOG.md

Update Change log to use actual CLI Flags instead of variable names.

Fixes part of #2738

Signed-off-by: pradeepnnv <pradeepnnv@gmail.com>

Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Signed-off-by: pradeepnnv <pradeepnnv@gmail.com>

Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
  • Loading branch information
pradeepnnv and yurishkuro authored Feb 1, 2021
1 parent 5c4fe1f commit 165ac36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 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 deprecated flags `--health-check-http-port` & `--admin-http-port`, please use `--admin.http.host-port` ([#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
16 changes: 0 additions & 16 deletions cmd/flags/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +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"

healthCheckHTTPPortWarning = "(deprecated, will be removed after 2020-03-15 or in release v1.19.0, whichever is later)"
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 @@ -74,26 +70,14 @@ func (s *AdminServer) setLogger(logger *zap.Logger) {

// AddFlags registers CLI flags.
func (s *AdminServer) AddFlags(flagSet *flag.FlagSet) {
flagSet.Int(healthCheckHTTPPort, 0, healthCheckHTTPPortWarning+" see --"+adminHTTPHostPort)
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 165ac36

Please sign in to comment.