feat: add cluster context support in Compose with x-context extension

This commit is contained in:
Pasha Sviderski
2026-03-13 18:37:36 +10:00
parent 8ae38cfd57
commit 1525d182b5
8 changed files with 121 additions and 0 deletions
+9
View File
@@ -561,6 +561,15 @@ func provisionOrConnectRemoteMachine(
return machineClient, nil
}
// SetClusterContextIfUnset sets the cluster context override only if no --context flag was used
// and no --connect direct connection is active.
func (cli *CLI) SetClusterContextIfUnset(name string) {
if name == "" || cli.contextOverride != "" || cli.conn != nil {
return
}
cli.contextOverride = name
}
// ProgressOut returns an output stream for progress writer.
func (cli *CLI) ProgressOut() *streams.Out {
return streams.NewOut(os.Stdout)