Skip to content

Commit 84f51f4

Browse files
committed
add command to remove reference into the db of converted images
1 parent c235fad commit 84f51f4

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

daemon/cmd/remove_converted.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package cmd
2+
3+
import (
4+
log "github.com/sirupsen/logrus"
5+
"github.com/spf13/cobra"
6+
7+
"github.com/cvmfs/docker-graphdriver/daemon/lib"
8+
)
9+
10+
func init() {
11+
rootCmd.AddCommand(removeAllConverted)
12+
}
13+
14+
var removeAllConverted = &cobra.Command{
15+
Use: "remove-converted",
16+
Aliases: []string{"rm-converted", "rm-convert", "converted-rm", "convert-rm"},
17+
Short: "Remove all the reference to already converted images, basically reset the status of the database",
18+
Run: func(cmd *cobra.Command, args []string) {
19+
n, err := lib.DeleteAllConverted()
20+
if err != nil {
21+
lib.LogE(err).Fatal("Error in removing the converted references")
22+
}
23+
lib.Log().WithFields(log.Fields{"removed references": n}).Info("Removed all the reference to converted images")
24+
},
25+
}

0 commit comments

Comments
 (0)