jpictl: introduce jpictl dns show command

to list dns entries

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-10-23 23:13:59 +00:00
parent c578990f8c
commit 440dcde50a
2 changed files with 47 additions and 0 deletions
+18
View File
@@ -132,9 +132,27 @@ var dnsSyncCmd = &cobra.Command{
},
}
var dnsShowCmd = &cobra.Command{
Use: "show [<name>...]",
Short: "dns show lists entries on DNS for our domain",
PreRun: setVerbosity,
RunE: func(cmd *cobra.Command, args []string) error {
mgr, err := newDNSManagerCommand(cmd, true, true)
if err != nil {
return err
}
ctx, cancel := context.WithTimeout(context.Background(), DNSSyncTimeout)
defer cancel()
return mgr.Show(ctx, args...)
},
}
func init() {
rootCmd.AddCommand(dnsCmd)
dnsCmd.AddCommand(dnsWriteCmd)
dnsCmd.AddCommand(dnsSyncCmd)
dnsCmd.AddCommand(dnsShowCmd)
}