mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-30 13:35:23 +00:00
Show N/A in reusable when key is ephemeral
This commit is contained in:
parent
29b80e3ca1
commit
db20985b06
@ -44,11 +44,19 @@ var ListPreAuthKeys = &cobra.Command{
|
|||||||
if k.Expiration != nil {
|
if k.Expiration != nil {
|
||||||
expiration = k.Expiration.Format("2006-01-02 15:04:05")
|
expiration = k.Expiration.Format("2006-01-02 15:04:05")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var reusable string
|
||||||
|
if k.Ephemeral {
|
||||||
|
reusable = "N/A"
|
||||||
|
} else {
|
||||||
|
reusable = fmt.Sprintf("%v", k.Reusable)
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Printf(
|
fmt.Printf(
|
||||||
"key: %s, namespace: %s, reusable: %v, ephemeral: %v, expiration: %s, created_at: %s\n",
|
"key: %s, namespace: %s, reusable: %s, ephemeral: %v, expiration: %s, created_at: %s\n",
|
||||||
k.Key,
|
k.Key,
|
||||||
k.Namespace.Name,
|
k.Namespace.Name,
|
||||||
k.Reusable,
|
reusable,
|
||||||
k.Ephemeral,
|
k.Ephemeral,
|
||||||
expiration,
|
expiration,
|
||||||
k.CreatedAt.Format("2006-01-02 15:04:05"),
|
k.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||||
|
Loading…
Reference in New Issue
Block a user