Skip to content

Commit 52caba2

Browse files
committed
Add a deprecation hint to nsc expose
Fixes NSL-2500
1 parent 0269ac7 commit 52caba2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/cli/cmd/cluster/expose.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ func newExposeContainerCmd(use string, hidden bool) *cobra.Command {
7575
return fnerrors.New("only one of --all or --container may be specified")
7676
}
7777

78+
if hidden && *output == "plain" {
79+
out := console.Warnings(ctx)
80+
fmt.Fprintf(out, "`nsc %s` is deprecated. For backwards compatibility it behaves as `nsc expose container [cluster-id]`.\n", use)
81+
fmt.Fprintln(out, "To expose an exported port on a running container `nsc expose container [cluster-id].")
82+
fmt.Fprintln(out, "To exponse a Kubernentes Load Balancer use `nsc expose kubernetes [cluster-id]`.")
83+
}
84+
7885
cluster, _, err := SelectRunningCluster(ctx, args)
7986
if err != nil {
8087
return err

0 commit comments

Comments
 (0)