mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
refactor: Make --context cli flag a global option (#174)
* Make `--context` flag a global option and remove duplication * Remove unused dns showOptions struct * First pass of refactoring "active context" determination and validation * Undo some refactoring in cli.go to keep diff more focused
This commit is contained in:
@@ -40,8 +40,6 @@ type BuildServicesOptions struct {
|
||||
PushRegistry bool
|
||||
|
||||
// Cluster-specific options (only used if PushCluster is true).
|
||||
// Context is the name of the cluster context.
|
||||
Context string
|
||||
// Machines is a list of machine names or IDs to push the image to. If empty, images are pushed to all machines.
|
||||
Machines []string
|
||||
}
|
||||
@@ -95,7 +93,7 @@ func (cli *CLI) BuildServices(ctx context.Context, project *composetypes.Project
|
||||
// Add a line break after the build output.
|
||||
fmt.Fprintln(cli.ProgressOut())
|
||||
|
||||
clusterClient, err := cli.ConnectCluster(ctx, opts.Context)
|
||||
clusterClient, err := cli.ConnectCluster(ctx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("connect to cluster: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user