Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions cmd/grounds/commands/cluster/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func newUp() *cobra.Command {
var bundleRef string
var overridePath string
cmd := &cobra.Command{
Use: "up [--bundle=<ref>] [--override=<file>] [--profile=minigame|platform]",
Use: "up [--bundle=<ref>] [--override=<file>] [--profile=platform]",
Short: "Spawn or resume the workspace",
Example: " grounds cluster up\n grounds cluster up --bundle=0.6.4\n grounds cluster up --profile=minigame",
Example: " grounds cluster up\n grounds cluster up --bundle=0.6.4\n grounds cluster up --profile=platform",
Long: `Create the workspace if it doesn't exist, or resume it from a paused state.

By default ` + "`up`" + ` provisions a **platform-bundle** workspace: a per-developer
Expand All @@ -36,8 +36,7 @@ optional override file, and helm-installs each component.
grounds cluster up --bundle=0.6.4 # pin a bundle release
grounds cluster up --override=./me.yaml # local overrides (ref from file, else main)

Legacy profiles (opt in with ` + "`--profile`" + `):
minigame — namespace-scoped sandbox. Cheap, fast, isolated by RBAC.
Legacy profile (opt in with ` + "`--profile`" + `):
platform — bare per-developer vCluster with the Grounds platform chart,
without the bundle components.

Expand All @@ -52,11 +51,11 @@ changing profile, use ` + "`grounds cluster reset`" + `.`,
}

// platform-bundle is the default: a bare `up`, `--bundle`, or
// `--override` all drive bundle mode. Opt out to the legacy
// sandbox / vCluster profiles with --profile=minigame|platform.
// `--override` all drive bundle mode. Opt out to the bare
// vCluster profile with --profile=platform.
if profile == "" || profile == "platform-bundle" || bundleRef != "" || overridePath != "" {
if profile != "" && profile != "platform-bundle" {
return fmt.Errorf("--profile=%s can't be combined with --bundle/--override (those imply platform-bundle); drop --profile, or use --profile=minigame|platform for the legacy profiles", profile)
return fmt.Errorf("--profile=%s can't be combined with --bundle/--override (those imply platform-bundle); drop --profile, or use --profile=platform for a bare vCluster", profile)
}
body, err := loadBundleRequest(bundleRef, overridePath)
if err != nil {
Expand All @@ -81,8 +80,8 @@ changing profile, use ` + "`grounds cluster reset`" + `.`,
return nil
}

if profile != "minigame" && profile != "platform" {
return fmt.Errorf("invalid --profile %q: must be \"minigame\" or \"platform\" (omit --profile for the default platform-bundle)", profile)
if profile != "platform" {
return fmt.Errorf("invalid --profile %q: must be \"platform\" (omit --profile for the default platform-bundle)", profile)
}
w := cmd.OutOrStdout()
if _, err := c.ClusterUp(ctx, profile); err != nil {
Expand All @@ -104,7 +103,7 @@ changing profile, use ` + "`grounds cluster reset`" + `.`,
return nil
},
}
cmd.Flags().StringVar(&profile, "profile", "", "legacy profile: minigame (sandbox) or platform (bare vCluster); default is platform-bundle")
cmd.Flags().StringVar(&profile, "profile", "", "legacy profile: platform (bare vCluster); default is platform-bundle")
cmd.Flags().StringVar(&bundleRef, "bundle", "", "PlatformBundle ref (e.g. 0.6.4, main); default main")
cmd.Flags().StringVar(&overridePath, "override", "", "path to an Engineer-Override-File (YAML); implies platform-bundle profile")
return cmd
Expand Down
2 changes: 1 addition & 1 deletion internal/api/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (c *Client) GetCluster(ctx context.Context) (*ClusterStatus, error) {
}

// ClusterUp spawns or resumes the workspace. `profile` may be empty
// (forge picks the default), "minigame", or "platform". Forge enforces
// (forge picks the default) or "platform". Forge enforces
// the immutable-profile rule: switching profiles on an existing
// workspace requires `grounds cluster delete` first.
func (c *Client) ClusterUp(ctx context.Context, profile string) (*ClusterStatus, error) {
Expand Down
6 changes: 3 additions & 3 deletions internal/api/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ func TestGetCluster(t *testing.T) {
t.Fatalf("got %s %s", r.Method, r.URL.Path)
}
json.NewEncoder(w).Encode(map[string]any{
"namespace": "user-test",
"namespace": "vcluster-test",
"state": "active",
"profile": "minigame",
"profile": "platform-bundle",
"deploymentsReady": 2,
"bundleProgress": map[string]any{
"bundleRef": "main",
Expand All @@ -39,7 +39,7 @@ func TestGetCluster(t *testing.T) {
if err != nil {
t.Fatalf("err: %v", err)
}
if s.Namespace != "user-test" || s.State != "active" || s.DeploymentsReady != 2 {
if s.Namespace != "vcluster-test" || s.State != "active" || s.DeploymentsReady != 2 {
t.Errorf("status = %+v", s)
}
if s.BundleProgress == nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/render/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestStatus_Active(t *testing.T) {
Status(buf, &api.ClusterStatus{
Namespace: "user-x",
State: "active",
Profile: "minigame",
Profile: "platform-bundle",
AutoPauseAt: &in,
Quota: map[string]string{"cpu": "4", "memory": "8Gi", "storage": "20Gi"},
DeploymentsReady: 1,
Expand All @@ -36,7 +36,7 @@ func TestStatus_PausedShowsWarning(t *testing.T) {
Status(buf, &api.ClusterStatus{
Namespace: "user-x",
State: "paused",
Profile: "minigame",
Profile: "platform-bundle",
AutoDeleteAt: &in,
})
out := buf.String()
Expand Down
Loading