Skip to content

Commit

Permalink
deprecate core.grpc.port flag
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs committed Jan 22, 2025
1 parent 9561cb5 commit 5048426
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nodebuilder/core/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
var (
coreIPFlag = "core.ip"
corePortFlag = "core.port"
coreGRPCFlag = "core.grpc.port"
coreTLS = "core.tls"
coreXTokenPathFlag = "core.xtoken.path" //nolint:gosec
)
Expand All @@ -30,6 +31,12 @@ func Flags() *flag.FlagSet {
DefaultPort,
"Set a custom gRPC port for the core node connection. The --core.ip flag must also be provided.",
)
flags.String(
coreGRPCFlag,
"",
"Set a custom gRPC port for the core node connection.WARNING: --core.grpc.port is deprecated. "+
"Please use --core.port instead",
)
flags.Bool(
coreTLS,
false,
Expand All @@ -51,6 +58,10 @@ func ParseFlags(
cmd *cobra.Command,
cfg *Config,
) error {
if cmd.Flag(coreIPFlag).Changed {
return fmt.Errorf("the flag is deprecated. Please use --core.port instead")
}

coreIP := cmd.Flag(coreIPFlag).Value.String()
if coreIP == "" {
if cmd.Flag(corePortFlag).Changed {
Expand Down

0 comments on commit 5048426

Please sign in to comment.