Unverified Commit 70304e03 authored by Derek Nola's avatar Derek Nola Committed by GitHub

Add server flag to access nonlocal/nondefault k3s server (#5016) (#5055)

parent d3189ad2
package cmds package cmds
import ( import (
"github.com/rancher/k3s/pkg/version"
"github.com/urfave/cli" "github.com/urfave/cli"
) )
...@@ -9,6 +10,13 @@ const SecretsEncryptCommand = "secrets-encrypt" ...@@ -9,6 +10,13 @@ const SecretsEncryptCommand = "secrets-encrypt"
var EncryptFlags = []cli.Flag{ var EncryptFlags = []cli.Flag{
DataDirFlag, DataDirFlag,
ServerToken, ServerToken,
cli.StringFlag{
Name: "server, s",
Usage: "(cluster) Server to connect to",
EnvVar: version.ProgramUpper + "_URL",
Value: "https://127.0.0.1:6443",
Destination: &ServerConfig.ServerURL,
},
} }
func NewSecretsEncryptCommand(action func(*cli.Context) error, subcommands []cli.Command) cli.Command { func NewSecretsEncryptCommand(action func(*cli.Context) error, subcommands []cli.Command) cli.Command {
......
...@@ -31,9 +31,6 @@ func commandPrep(app *cli.Context, cfg *cmds.Server) (config.Control, *clientacc ...@@ -31,9 +31,6 @@ func commandPrep(app *cli.Context, cfg *cmds.Server) (config.Control, *clientacc
if err != nil { if err != nil {
return controlConfig, nil, err return controlConfig, nil, err
} }
if cfg.ServerURL == "" {
cfg.ServerURL = "https://127.0.0.1:6443"
}
if cfg.Token == "" { if cfg.Token == "" {
fp := filepath.Join(controlConfig.DataDir, "token") fp := filepath.Join(controlConfig.DataDir, "token")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment