Fix Reusable typo, add tests for Augustines scenario

This commit is contained in:
Kristoffer Dalby 2021-11-08 20:49:03 +00:00
parent 6371135459
commit 0803c407a9
5 changed files with 103 additions and 4 deletions

View file

@ -97,7 +97,7 @@ var registerNodeCmd = &cobra.Command{
response, err := client.RegisterMachine(ctx, request)
if err != nil {
ErrorOutput(err, fmt.Sprintf("Cannot register machine: %s\n", err), output)
ErrorOutput(err, fmt.Sprintf("Cannot register machine: %s\n", status.Convert(err).Message()), output)
return
}

View file

@ -75,7 +75,7 @@ var listPreAuthKeys = &cobra.Command{
if k.GetEphemeral() {
reusable = "N/A"
} else {
reusable = fmt.Sprintf("%v", k.GetResuable())
reusable = fmt.Sprintf("%v", k.GetReusable())
}
d = append(d, []string{
@ -112,9 +112,15 @@ var createPreAuthKeyCmd = &cobra.Command{
reusable, _ := cmd.Flags().GetBool("reusable")
ephemeral, _ := cmd.Flags().GetBool("ephemeral")
log.Trace().
Bool("reusable", reusable).
Bool("ephemeral", ephemeral).
Str("namespace", namespace).
Msg("Preparing to create preauthkey")
request := &v1.CreatePreAuthKeyRequest{
Namespace: namespace,
Resuable: reusable,
Reusable: reusable,
Ephemeral: ephemeral,
}