Skip to content

Commit

Permalink
fix: delete appcahce dir with error (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
hysyeah authored Nov 7, 2024
1 parent 25eef29 commit 7866af8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions controllers/appmgr_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,13 @@ func (r *ApplicationManagerController) uninstall(ctx context.Context, appMgr *ap
for _, n := range nodes.Items {
URL := fmt.Sprintf(constants.AppDataDirURL, appMgr.Spec.AppOwner, dir)
c.SetHeader("X-Terminus-Node", n.Name)
c.SetHeader("x-bfl-user", appMgr.Spec.AppOwner)
res, e := c.R().Delete(URL)
if e != nil {
klog.Errorf("Failed to delete dir err=%v", e)
}
if res.StatusCode() == http.StatusOK {
klog.Info("Success to delete appcache dir=%s", dir)
if res.StatusCode() != http.StatusOK {
klog.Infof("delete app cache failed with: %v", res.String())
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const (

DependencyTypeSystem = "system"
DependencyTypeApp = "application"
AppDataDirURL = "http://files-service.user-space-%s/api/resources/AppData/%s"
AppDataDirURL = "http://files-service.user-space-%s/api/resources/AppData/%s/"

UserSpaceDirKey = "userspace_hostpath"
UserAppDataDirKey = "appcache_hostpath"
Expand Down

0 comments on commit 7866af8

Please sign in to comment.