HuangTing-Yao commented on a change in pull request #207:
URL:
https://github.com/apache/incubator-yunikorn-k8shim/pull/207#discussion_r530197641
##########
File path: pkg/cache/placeholder_manager.go
##########
@@ -70,10 +70,28 @@ func (mgr *PlaceholderManager) createAppPlaceholders(app
*Application) error {
return nil
}
-// recycle all the placeholders for an application
-func (mgr *PlaceholderManager) Recycle(appID string) {
- log.Logger().Info("start to recycle app placeholders",
- zap.String("appID", appID))
+// clean up all the placeholders for an application
+func (mgr *PlaceholderManager) CleanUp(app *Application) {
+ log.Logger().Info("start to clean up app placeholders",
+ zap.String("appID", app.GetApplicationID()))
+ for taskID, task := range app.taskMap {
+ if task.GetTaskPlaceholder() {
+ // remove pod
+ err := mgr.clients.KubeClient.Delete(task.pod)
+ if err != nil {
+ log.Logger().Error("failed to clean up
placeholder pod",
+ zap.Error(err))
+ }
+ // remove task from application
+ err = app.removeTask(taskID)
+ if err != nil {
+ log.Logger().Error("failed to remove task from
application",
+ zap.Error(err))
+ }
Review comment:
OK, done.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]