feat: control systemd Docker daemon target
This commit is contained in:
+7
-3
@@ -44,9 +44,10 @@ type Snapshot struct {
|
||||
}
|
||||
|
||||
type Result struct {
|
||||
Snapshot Snapshot
|
||||
Notice string
|
||||
Err error
|
||||
Snapshot Snapshot
|
||||
Notice string
|
||||
Confirmation string
|
||||
Err error
|
||||
}
|
||||
|
||||
type Module interface {
|
||||
@@ -159,6 +160,9 @@ func (a *Application) setTargetDesired(intent Intent) Result {
|
||||
if intent.Enabled && active == nil {
|
||||
return Result{Snapshot: a.Snapshot(), Err: errors.New("no Active Profile; open Profile management before enabling a Target")}
|
||||
}
|
||||
if warning := selected.Confirmation(intent.Enabled); warning != "" && !intent.Confirm {
|
||||
return Result{Snapshot: a.Snapshot(), Confirmation: warning}
|
||||
}
|
||||
result := selected.SetDesired(context.Background(), intent.Enabled, active)
|
||||
a.inspections[selected.ID()] = result.Inspection
|
||||
notice := ""
|
||||
|
||||
Reference in New Issue
Block a user