2019-01-09 16:54:15 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2021-09-08 17:56:18 +00:00
|
|
|
"context"
|
|
|
|
"errors"
|
2019-01-09 16:54:15 +00:00
|
|
|
"os"
|
|
|
|
|
2022-03-02 23:47:27 +00:00
|
|
|
"github.com/k3s-io/k3s/pkg/cli/agent"
|
|
|
|
"github.com/k3s-io/k3s/pkg/cli/cmds"
|
|
|
|
"github.com/k3s-io/k3s/pkg/configfilearg"
|
2019-01-09 16:54:15 +00:00
|
|
|
"github.com/sirupsen/logrus"
|
2020-08-29 19:46:55 +00:00
|
|
|
"github.com/urfave/cli"
|
2019-01-09 16:54:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
app := cmds.NewApp()
|
2020-08-29 19:46:55 +00:00
|
|
|
app.Commands = []cli.Command{
|
2019-01-09 16:54:15 +00:00
|
|
|
cmds.NewAgentCommand(agent.Run),
|
|
|
|
}
|
|
|
|
|
2021-09-08 17:56:18 +00:00
|
|
|
if err := app.Run(configfilearg.MustParse(os.Args)); err != nil && !errors.Is(err, context.Canceled) {
|
2019-01-09 16:54:15 +00:00
|
|
|
logrus.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|