()
| 147 | } |
| 148 | |
| 149 | func (w *WorkerNode) CleanResources() { |
| 150 | keys := make([]string, 0) |
| 151 | for _, key := range w.SandboxManager.Metadata.Keys() { |
| 152 | keys = append(keys, key) |
| 153 | } |
| 154 | |
| 155 | for _, key := range keys { |
| 156 | _, err := w.SandboxRuntime.DeleteSandbox(context.Background(), &proto.SandboxID{ |
| 157 | ID: key, |
| 158 | }) |
| 159 | if err != nil { |
| 160 | logrus.Warn("Failed to clean resource (sandbox) - ", key) |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | func (w *WorkerNode) DeregisterNodeFromControlPlane(config config.WorkerNodeConfig, cpApi *proto.CpiInterfaceClient) { |
| 166 | logrus.Info("Trying to deregister the node with the control plane") |
no test coverage detected