Version 0.29f + WIP: gocage destroy

This commit is contained in:
yo 2022-09-25 13:45:40 +02:00
parent fabe9cc330
commit 38266af66e

View File

@ -14,7 +14,7 @@ import (
)
const (
gVersion = "0.29f"
gVersion = "0.29g"
// TODO : Get from $jail_zpool/defaults.json
MIN_DYN_DEVFS_RULESET = 1000
@ -26,6 +26,7 @@ var (
gDatastores []Datastore
gUseSudo bool
gForce bool
gConfigFile string
gDisplayJColumns string
@ -91,6 +92,16 @@ ex: gocage list srv-db srv-web`,
},
}
/* destroyCmd = &cobra.Command{
Use: "destroy",
Short: "destroy jails",
Long: `Destroy jail filesystem, snapshots and configuration file.`,
Run: func(cmd *cobra.Command, args []string) {
ListJails(args, false)
DestroyJails(args)
},
}
*/
stopCmd = &cobra.Command{
Use: "stop",
Short: "stop jail",
@ -291,6 +302,8 @@ func init() {
listCmd.Flags().StringVarP(&gFilterJails, "filter", "f", "none", "Only display jails with these values. Ex: \"gocage list -f Config.Boot=1\" will only list started on boot jails")
listCmd.Flags().StringVarP(&gSortJailFields, "sort", "s", "none", "Display jails sorted by field values. Ex: \"gocage list -s +Name,-Config.Priority\" will sort jails by their decreasing name, then increasing start priority. 3 critera max supported.")
// destroyCmd.Flags().BoolVarP(&gForce, "force", "f", false, "Force stop jail if running")
snapshotListCmd.Flags().StringVarP(&gDisplaySColumns, "outcol", "o", "Jailname,Name,Creation,Referenced,Used", "Show these columns in output")
snapshotListCmd.Flags().BoolVarP(&gNoSnapLineSep, "nolinesep", "l", false, "Do not display line separator between snapshots")
snapshotListCmd.Flags().StringVarP(&gFilterSnaps, "filter", "f", "none", "Only display snapshots with these values. Ex: \"gocage snapshot list -f Config.Boot=1\" will only list started on boot jails")
@ -320,6 +333,7 @@ func init() {
rootCmd.AddCommand(stopCmd)
rootCmd.AddCommand(startCmd)
rootCmd.AddCommand(restartCmd)
// rootCmd.AddCommand(destroyCmd)
rootCmd.AddCommand(shellCmd)
rootCmd.AddCommand(getCmd)
rootCmd.AddCommand(setCmd)