jpictl: introduce jpictl dns show command
to list dns entries Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user