v0.44.0: role-aware drive management — protected lockout + customer type-to-confirm wipe + drive-list restyle
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1022,12 +1022,19 @@ func (s *Server) countAppsUsingPath(storagePath string) int {
|
||||
}
|
||||
|
||||
func (s *Server) appsUsingPath(storagePath string) []string {
|
||||
return appsUsingPathIn(s.stackMgr.GetStacks(), s.stackMgr.LoadAppConfigByName, storagePath)
|
||||
}
|
||||
|
||||
// appsUsingPathIn is the pure core of appsUsingPath (testable without a live stacks.Manager): the
|
||||
// deployed apps whose data dir (app.yaml HDD_PATH) is exactly storagePath, by display name. This is
|
||||
// the "name the apps that break" list for the type-to-confirm wipe/eject UI.
|
||||
func appsUsingPathIn(allStacks []stacks.Stack, loadCfg func(string) *stacks.AppConfig, storagePath string) []string {
|
||||
var names []string
|
||||
for _, stack := range s.stackMgr.GetStacks() {
|
||||
for _, stack := range allStacks {
|
||||
if !stack.Deployed {
|
||||
continue
|
||||
}
|
||||
if appCfg := s.stackMgr.LoadAppConfigByName(stack.Name); appCfg != nil {
|
||||
if appCfg := loadCfg(stack.Name); appCfg != nil {
|
||||
if appCfg.Env["HDD_PATH"] == storagePath {
|
||||
names = append(names, stack.Meta.DisplayName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user