mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
feat: add cluster context support in Compose with x-context extension
This commit is contained in:
@@ -98,6 +98,8 @@ func runBuild(ctx context.Context, uncli *cli.CLI, opts buildOptions) error {
|
||||
return fmt.Errorf("load compose file(s): %w", err)
|
||||
}
|
||||
|
||||
uncli.SetClusterContextIfUnset(compose.ClusterContext(project))
|
||||
|
||||
servicesToBuild, err := cli.ServicesThatNeedBuild(project, opts.Services, opts.Deps)
|
||||
if err != nil {
|
||||
return fmt.Errorf("determine services to build: %w", err)
|
||||
|
||||
@@ -83,6 +83,8 @@ func runDeploy(ctx context.Context, uncli *cli.CLI, opts deployOptions) error {
|
||||
return fmt.Errorf("load compose file(s): %w", err)
|
||||
}
|
||||
|
||||
uncli.SetClusterContextIfUnset(compose.ClusterContext(project))
|
||||
|
||||
if len(opts.services) > 0 {
|
||||
// Includes service dependencies by default. This is the default docker compose behavior.
|
||||
project, err = project.WithSelectedServices(opts.services)
|
||||
|
||||
@@ -107,6 +107,9 @@ func runLogs(ctx context.Context, uncli *cli.CLI, serviceNames []string, opts lo
|
||||
if err != nil {
|
||||
return fmt.Errorf("load Compose file(s): %w", err)
|
||||
}
|
||||
|
||||
uncli.SetClusterContextIfUnset(compose.ClusterContext(project))
|
||||
|
||||
// View logs for all services, including disabled by inactive profiles.
|
||||
serviceNames = append(project.ServiceNames(), project.DisabledServiceNames()...)
|
||||
if len(serviceNames) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user