Skip to content

Commit 7272899

Browse files
committed
🧹 Remove deprecated flags
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
1 parent 7e9e176 commit 7272899

File tree

1 file changed

+0
-15
lines changed
  • pkg/kubernetes-mcp-server/cmd

1 file changed

+0
-15
lines changed

pkg/kubernetes-mcp-server/cmd/root.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ const (
5757
flagVersion = "version"
5858
flagLogLevel = "log-level"
5959
flagConfig = "config"
60-
flagSSEPort = "sse-port"
61-
flagHttpPort = "http-port"
6260
flagPort = "port"
6361
flagSSEBaseUrl = "sse-base-url"
6462
flagKubeconfig = "kubeconfig"
@@ -79,8 +77,6 @@ type MCPServerOptions struct {
7977
Version bool
8078
LogLevel int
8179
Port string
82-
SSEPort int
83-
HttpPort int
8480
SSEBaseUrl string
8581
Kubeconfig string
8682
Toolsets []string
@@ -133,10 +129,6 @@ func NewMCPServer(streams genericiooptions.IOStreams) *cobra.Command {
133129
cmd.Flags().BoolVar(&o.Version, flagVersion, o.Version, "Print version information and quit")
134130
cmd.Flags().IntVar(&o.LogLevel, flagLogLevel, o.LogLevel, "Set the log level (from 0 to 9)")
135131
cmd.Flags().StringVar(&o.ConfigPath, flagConfig, o.ConfigPath, "Path of the config file.")
136-
cmd.Flags().IntVar(&o.SSEPort, flagSSEPort, o.SSEPort, "Start a SSE server on the specified port")
137-
cmd.Flag(flagSSEPort).Deprecated = "Use --port instead"
138-
cmd.Flags().IntVar(&o.HttpPort, flagHttpPort, o.HttpPort, "Start a streamable HTTP server on the specified port")
139-
cmd.Flag(flagHttpPort).Deprecated = "Use --port instead"
140132
cmd.Flags().StringVar(&o.Port, flagPort, o.Port, "Start a streamable HTTP and SSE HTTP server on the specified port (e.g. 8080)")
141133
cmd.Flags().StringVar(&o.SSEBaseUrl, flagSSEBaseUrl, o.SSEBaseUrl, "SSE public base URL to use when sending the endpoint message (e.g. https://example.com)")
142134
cmd.Flags().StringVar(&o.Kubeconfig, flagKubeconfig, o.Kubeconfig, "Path to the kubeconfig file to use for authentication")
@@ -188,10 +180,6 @@ func (m *MCPServerOptions) loadFlags(cmd *cobra.Command) {
188180
}
189181
if cmd.Flag(flagPort).Changed {
190182
m.StaticConfig.Port = m.Port
191-
} else if cmd.Flag(flagSSEPort).Changed {
192-
m.StaticConfig.Port = strconv.Itoa(m.SSEPort)
193-
} else if cmd.Flag(flagHttpPort).Changed {
194-
m.StaticConfig.Port = strconv.Itoa(m.HttpPort)
195183
}
196184
if cmd.Flag(flagSSEBaseUrl).Changed {
197185
m.StaticConfig.SSEBaseURL = m.SSEBaseUrl
@@ -253,9 +241,6 @@ func (m *MCPServerOptions) initializeLogging() {
253241
}
254242

255243
func (m *MCPServerOptions) Validate() error {
256-
if m.Port != "" && (m.SSEPort > 0 || m.HttpPort > 0) {
257-
return fmt.Errorf("--port is mutually exclusive with deprecated --http-port and --sse-port flags")
258-
}
259244
if output.FromString(m.StaticConfig.ListOutput) == nil {
260245
return fmt.Errorf("invalid output name: %s, valid names are: %s", m.StaticConfig.ListOutput, strings.Join(output.Names, ", "))
261246
}

0 commit comments

Comments
 (0)