feat: deployed app removal + missing field injection (v0.19.0)
Add "Eltávolítás" to remove deployed (non-orphaned) stacks — reverts them to "Nincs telepítve" while preserving templates for redeploy. Modal offers HDD data and backup data cleanup choices. Auto-inject missing deploy fields (secrets, domains) into existing app.yaml when templates are updated via sync or on controller startup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,15 +18,16 @@ import (
|
||||
|
||||
// Syncer handles periodic git sync of the app catalog to the local stacks directory.
|
||||
type Syncer struct {
|
||||
cfg *config.Config
|
||||
logger *log.Logger
|
||||
cacheDir string // local git clone
|
||||
rescanFn func() error
|
||||
mu sync.Mutex
|
||||
lastSync time.Time
|
||||
lastErr error
|
||||
syncing bool
|
||||
stopCh chan struct{}
|
||||
cfg *config.Config
|
||||
logger *log.Logger
|
||||
cacheDir string // local git clone
|
||||
rescanFn func() error
|
||||
postSyncHook func(updated []string) // called after sync with names of updated stacks
|
||||
mu sync.Mutex
|
||||
lastSync time.Time
|
||||
lastErr error
|
||||
syncing bool
|
||||
stopCh chan struct{}
|
||||
}
|
||||
|
||||
// SyncStatus holds information about the last sync operation.
|
||||
@@ -46,14 +47,16 @@ type SyncResult struct {
|
||||
}
|
||||
|
||||
// New creates a new Syncer. rescanFn is called after a successful sync to trigger ScanStacks().
|
||||
func New(cfg *config.Config, logger *log.Logger, rescanFn func() error) *Syncer {
|
||||
// postSyncHook is called with names of updated stacks (may be nil).
|
||||
func New(cfg *config.Config, logger *log.Logger, rescanFn func() error, postSyncHook func([]string)) *Syncer {
|
||||
cacheDir := filepath.Join(cfg.Paths.DataDir, "catalog-cache")
|
||||
return &Syncer{
|
||||
cfg: cfg,
|
||||
logger: logger,
|
||||
cacheDir: cacheDir,
|
||||
rescanFn: rescanFn,
|
||||
stopCh: make(chan struct{}),
|
||||
cfg: cfg,
|
||||
logger: logger,
|
||||
cacheDir: cacheDir,
|
||||
rescanFn: rescanFn,
|
||||
postSyncHook: postSyncHook,
|
||||
stopCh: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,6 +190,11 @@ func (s *Syncer) doSync() SyncResult {
|
||||
}
|
||||
}
|
||||
|
||||
// Step 4: Inject missing deploy fields for updated stacks
|
||||
if len(updated) > 0 && s.postSyncHook != nil {
|
||||
s.postSyncHook(updated)
|
||||
}
|
||||
|
||||
// Build message
|
||||
parts := []string{}
|
||||
if len(newApps) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user