chore: rename cluster term to context in CLI and config, convert config toml -> yaml

This commit is contained in:
Pavel Sviderski
2025-04-01 21:29:32 +10:00
parent 0e80f2e5b2
commit f467fad84c
24 changed files with 197 additions and 163 deletions
+6 -5
View File
@@ -3,14 +3,15 @@ package service
import (
"context"
"fmt"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/go-units"
"os"
"text/tabwriter"
"time"
"github.com/spf13/cobra"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/go-units"
"github.com/psviderski/uncloud/internal/cli"
"github.com/spf13/cobra"
)
type inspectOptions struct {
@@ -31,8 +32,8 @@ func NewInspectCommand() *cobra.Command {
},
}
cmd.Flags().StringVarP(
&opts.cluster, "cluster", "c", "",
"Name of the cluster. (default is the current cluster)",
&opts.cluster, "context", "c", "",
"Name of the cluster context. (default is the current context)",
)
return cmd
}
+5 -4
View File
@@ -3,11 +3,12 @@ package service
import (
"context"
"fmt"
"github.com/psviderski/uncloud/internal/cli"
"github.com/spf13/cobra"
"os"
"strings"
"text/tabwriter"
"github.com/psviderski/uncloud/internal/cli"
"github.com/spf13/cobra"
)
func NewListCommand() *cobra.Command {
@@ -22,8 +23,8 @@ func NewListCommand() *cobra.Command {
},
}
cmd.Flags().StringVarP(
&cluster, "cluster", "c", "",
"Name of the cluster. (default is the current cluster)",
&cluster, "context", "c", "",
"Name of the cluster context. (default is the current context)",
)
return cmd
}
+4 -3
View File
@@ -3,11 +3,12 @@ package service
import (
"context"
"fmt"
"os"
"github.com/docker/cli/cli/streams"
"github.com/docker/compose/v2/pkg/progress"
"github.com/psviderski/uncloud/internal/cli"
"github.com/spf13/cobra"
"os"
)
type rmOptions struct {
@@ -29,8 +30,8 @@ func NewRmCommand() *cobra.Command {
},
}
cmd.Flags().StringVarP(
&opts.cluster, "cluster", "c", "",
"Name of the cluster. (default is the current cluster)",
&opts.cluster, "context", "c", "",
"Name of the cluster context. (default is the current context)",
)
return cmd
}
+5 -4
View File
@@ -3,13 +3,14 @@ package service
import (
"context"
"fmt"
"slices"
"strings"
"github.com/psviderski/uncloud/internal/cli"
"github.com/psviderski/uncloud/internal/machine/api/pb"
"github.com/psviderski/uncloud/pkg/api"
"github.com/psviderski/uncloud/pkg/client/deploy"
"github.com/spf13/cobra"
"slices"
"strings"
)
type runOptions struct {
@@ -79,8 +80,8 @@ func NewRunCommand() *cobra.Command {
"/host/path:/container/path[:ro]. Can be specified multiple times.")
cmd.Flags().StringVarP(
&opts.cluster, "cluster", "c", "",
"Name of the cluster to run the service in. (default is the current cluster)",
&opts.cluster, "context", "c", "",
"Name of the cluster context to run the service in. (default is the current context)",
)
return cmd
+2 -2
View File
@@ -40,8 +40,8 @@ func NewScaleCommand() *cobra.Command {
}
cmd.Flags().StringVarP(
&opts.cluster, "cluster", "c", "",
"Name of the cluster. (default is the current cluster)",
&opts.cluster, "context", "c", "",
"Name of the cluster context. (default is the current context)",
)
return cmd