Skip to content

Commit

Permalink
Keep healtcheck port flag backward compatibility (jaegertracing#1315)
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Galuszka committed Mar 21, 2019
1 parent 69da933 commit 96d8331
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const (
logLevel = "log-level"
configFile = "config-file"
adminEndpointHTTPPort = "admin-endpoint-http-port"
healthCheckHTTPPort = "health-check-http-port" // deprecated
)

var defaultAdminEdpointPort int
Expand Down Expand Up @@ -79,6 +80,7 @@ func SetDefaultAdminEndpointPort(port int) {
func AddFlags(flagSet *flag.FlagSet) {
flagSet.String(spanStorageType, "", fmt.Sprintf(`Deprecated; please use %s environment variable. Run this binary with "env" command for help.`, storage.SpanStorageTypeEnvVar))
flagSet.Int(adminEndpointHTTPPort, defaultAdminEdpointPort, "The http port for the health check service")
flagSet.Int(healthCheckHTTPPort, defaultAdminEdpointPort, fmt.Sprintf("Deprecated; please use %s", adminEndpointHTTPPort))
AddLoggingFlag(flagSet)
}

Expand All @@ -91,6 +93,9 @@ func AddLoggingFlag(flagSet *flag.FlagSet) {
func (flags *SharedFlags) InitFromViper(v *viper.Viper) *SharedFlags {
flags.Logging.Level = v.GetString(logLevel)
flags.AdminEndpoint.Port = v.GetInt(adminEndpointHTTPPort)
if flags.AdminEndpoint.Port == defaultAdminEdpointPort {
flags.AdminEndpoint.Port = v.GetInt(healthCheckHTTPPort)
}
return flags
}

Expand Down

0 comments on commit 96d8331

Please sign in to comment.