k3s/pkg/util
Brad Davidson ce17fce058 Add helper function for including stack trace with error message
Not currently used, but was useful in tracking down the specific call path for the empty token handling

Prints error as:
> `msg="Error: starting kubernetes: failed to start cluster: failed to normalize server token; must be in format K10<CA-HASH>::<USERNAME>:<PASSWORD> or <PASSWORD> at github.com/urfave/cli/v2.(*App).RunContext(app.go:333)->github.com/urfave/cli/v2.(*Command).Run(command.go:269)->github.com/urfave/cli/v2.(*Command).Run(command.go:276)->github.com/k3s-io/k3s/pkg/cli/server.Run(server.go:48)->github.com/k3s-io/k3s/pkg/cli/server.run(server.go:629)->github.com/k3s-io/k3s/pkg/server.StartServer(server.go:74)->github.com/k3s-io/k3s/pkg/daemons/control.Server(server.go:72)->github.com/k3s-io/k3s/pkg/cluster.(*Cluster).Start(cluster.go:75)->github.com/k3s-io/k3s/pkg/cluster.Save(storage.go:79)->github.com/k3s-io/k3s/pkg/util.NormalizeToken(token.go:51)"`

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2026-02-03 14:47:50 -08:00
..
bindata Fix windows build os (#13201) 2025-11-15 02:02:12 -08:00
logger lint: unexported-return 2025-12-18 11:20:07 -08:00
metrics Add etcd snapshot metrics 2025-02-18 11:09:42 -08:00
permissions lint: unnecessary-format,use-errors-new 2025-12-18 11:20:07 -08:00
services Add generation for kube-scheduler and kube-controller-manager certs (#12285) 2025-05-09 16:25:44 -03:00
api.go lint: bool-literal-in-expr 2025-12-18 11:20:07 -08:00
apierrors.go Avoid use of github.com/pkg/errors functions that capture stack 2025-03-05 00:41:38 -08:00
args.go lint: redefines-builtin-id 2025-12-18 11:20:07 -08:00
args_test.go Update k8s version to 1.33 2025-04-30 04:43:37 -03:00
cert.go Optimize certificate status check 2025-05-08 11:57:29 -07:00
client.go Migrate to UrfaveCLI v2 (#11831) 2025-03-12 09:02:45 -07:00
client_test.go Migrate to UrfaveCLI v2 (#11831) 2025-03-12 09:02:45 -07:00
command.go VPN PoC 2023-06-09 12:39:33 +02:00
condition.go lint: use-any 2025-12-18 11:20:07 -08:00
context.go Use sync.WaitGroup to avoid exiting before components have shut down 2025-09-17 09:37:08 -07:00
errors.go Add helper function for including stack trace with error message 2026-02-03 14:47:50 -08:00
file.go Avoid use of github.com/pkg/errors functions that capture stack 2025-03-05 00:41:38 -08:00
labels.go feat: remove master role labels (#12395) 2025-05-28 12:41:35 -07:00
lru.go lint: unchecked-type-assertion 2025-12-18 11:20:07 -08:00
net.go lint: unnecessary-format,use-errors-new 2025-12-18 11:20:07 -08:00
net_test.go Migrate to UrfaveCLI v2 (#11831) 2025-03-12 09:02:45 -07:00
net_unix.go lint: redundant-build-tag 2025-12-18 11:20:07 -08:00
net_windows.go lint: redundant-build-tag 2025-12-18 11:20:07 -08:00
patch.go lint: unexported-return 2025-12-18 11:20:07 -08:00
reflect.go lint: use-any 2025-12-18 11:20:07 -08:00
token.go Handle empty token file as nonexistent 2026-02-03 14:47:50 -08:00