Skip to content

Commit

Permalink
Improve error message when using a "K10" prefixed token (k3s-io#4180) (
Browse files Browse the repository at this point in the history
…k3s-io#4430)

* Add new error message with a K10 prefixed secret token

Signed-off-by: dereknola <derek.nola@suse.com>
  • Loading branch information
dereknola authored Nov 9, 2021
1 parent cb0918a commit 586ed94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cluster/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func readTokenFromFile(serverToken, certs, dataDir string) (string, error) {
func normalizeToken(token string) (string, error) {
_, password, ok := clientaccess.ParseUsernamePassword(token)
if !ok {
return password, errors.New("failed to normalize token")
return password, errors.New("failed to normalize token; must be in format K10<CA-HASH>::<USERNAME>:<PASSWORD> or <PASSWORD>")
}
return password, nil
}
Expand Down

0 comments on commit 586ed94

Please sign in to comment.