MCPcopy Create free account
hub / github.com/bytesizedhosting/bcd / Uninstall

Method Uninstall

plugins/base_rpc.go:87–118  ·  view source on GitHub ↗
(opts *ActionOpts, success *bool)

Source from the content-addressed store, hash-verified

85 return nil
86}
87func (self *BaseRPC) Uninstall(opts *ActionOpts, success *bool) error {
88 containerId := opts.ContainerId
89
90 log.WithFields(log.Fields{
91 "container_id": containerId,
92 "name": self.base.GetName(),
93 }).Info("Removing container")
94
95 err := self.base.Uninstall(&AppConfig{ContainerId: containerId})
96
97 if err != nil {
98 return err
99 }
100 *success = true
101
102 if len(opts.DeleteFolders) > 0 {
103 for _, folder := range opts.DeleteFolders {
104 log.WithFields(log.Fields{"folder": folder}).Info("Removing folder")
105 err := os.RemoveAll(folder)
106 if err != nil {
107 log.Infof("Could not delete folder '%s': '%s'", folder, err)
108 }
109 }
110 }
111
112 log.WithFields(log.Fields{
113 "container_id": containerId,
114 "name": self.base.GetName(),
115 }).Info("Container removed")
116
117 return nil
118}

Callers

nothing calls this directly

Calls 2

GetNameMethod · 0.65
UninstallMethod · 0.65

Tested by

no test coverage detected