Skip to content

Commit

Permalink
fix k3s version metadata (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
enrichman authored Feb 18, 2025
1 parent 8811ba7 commit 65fe7a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cli/cmds/cluster/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ func createAction(config *CreateConfig) cli.ActionFunc {
return err
}

if strings.Contains(config.version, "+") {
orig := config.version
config.version = strings.Replace(config.version, "+", "-", -1)
logrus.Warnf("Invalid K3s docker reference version: '%s'. Using '%s' instead", orig, config.version)
}

if config.token != "" {
logrus.Infof("Creating cluster token secret")
obj := k3kcluster.TokenSecretObj(config.token, name, cmds.Namespace())
Expand Down
2 changes: 1 addition & 1 deletion cli/cmds/cluster/create_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func NewCreateFlags(config *CreateConfig) []cli.Flag {
},
&cli.StringFlag{
Name: "mode",
Usage: "k3k mode type",
Usage: "k3k mode type (shared, virtual)",
Destination: &config.mode,
Value: "shared",
Action: func(ctx *cli.Context, value string) error {
Expand Down

0 comments on commit 65fe7a6

Please sign in to comment.