mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
21d21ddd4d
Signed-off-by: Darren Shepherd <darren@rancher.com>
21 lines
475 B
Go
21 lines
475 B
Go
package configfilearg
|
|
|
|
import (
|
|
"github.com/rancher/k3s/pkg/version"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func MustParse(args []string) []string {
|
|
parser := &Parser{
|
|
After: []string{"server", "agent"},
|
|
FlagNames: []string{"--config", "-c"},
|
|
EnvName: version.ProgramUpper + "_CONFIG_FILE",
|
|
DefaultConfig: "/etc/rancher/" + version.Program + "/config.yaml",
|
|
}
|
|
result, err := parser.Parse(args)
|
|
if err != nil {
|
|
logrus.Fatal(err)
|
|
}
|
|
return result
|
|
}
|