Skip to content

Commit

Permalink
Remove runtime, drop support for new nodeproxy apps
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldwan committed Aug 7, 2019
1 parent f3af5c3 commit a583bab
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 40 deletions.
6 changes: 2 additions & 4 deletions api/client.go
Expand Up @@ -228,7 +228,6 @@ func (c *Client) GetApps() ([]App, error) {
organization {
slug
}
runtime
}
}
}
Expand Down Expand Up @@ -373,7 +372,7 @@ func (c *Client) GetAppSecrets(appName string) ([]Secret, error) {
return data.App.Secrets, nil
}

func (c *Client) CreateApp(name string, runtime string, orgId string) (*App, error) {
func (c *Client) CreateApp(name string, orgId string) (*App, error) {
query := `
mutation($input: CreateAppInput!) {
createApp(input: $input) {
Expand All @@ -383,7 +382,6 @@ func (c *Client) CreateApp(name string, runtime string, orgId string) (*App, err
organization {
slug
}
runtime
}
}
}
Expand All @@ -393,7 +391,7 @@ func (c *Client) CreateApp(name string, runtime string, orgId string) (*App, err

req.Var("input", CreateAppInput{
Name: name,
Runtime: runtime,
Runtime: "FIRECRACKER",
OrganizationID: orgId,
})

Expand Down
1 change: 0 additions & 1 deletion api/types.go
Expand Up @@ -36,7 +36,6 @@ type Query struct {
type App struct {
ID string
Name string
Runtime string
Status string
Version int
AppURL string
Expand Down
34 changes: 1 addition & 33 deletions cmd/appCreate.go
Expand Up @@ -3,10 +3,8 @@ package cmd
import (
"fmt"
"os"
"strings"

"github.com/manifoldco/promptui"
"github.com/superfly/flyctl/api"
"github.com/superfly/flyctl/cmd/presenters"
"github.com/superfly/flyctl/flyctl"
)
Expand All @@ -17,10 +15,6 @@ func newAppCreateCommand() *Command {
Name: "name",
Description: "the app name to use",
})
cmd.AddStringFlag(StringFlagOpts{
Name: "runtime",
Description: `the runtime to use ("container" or "javascript")`,
})
cmd.AddStringFlag(StringFlagOpts{
Name: "org",
Description: `the organization that will own the app`,
Expand All @@ -29,14 +23,6 @@ func newAppCreateCommand() *Command {
return cmd
}

type appCreateCommand struct {
client *api.Client
appName string
runtime string
orgID string
orgSlug string
}

func runAppCreate(ctx *CmdContext) error {
name, _ := ctx.Config.GetString("name")
if name == "" {
Expand All @@ -46,30 +32,12 @@ func runAppCreate(ctx *CmdContext) error {
name, _ = prompt.Run()
}

runtime, _ := ctx.Config.GetString("runtime")
if runtime == "" {
prompt := promptui.Select{
Label: "Select Runtime",
Items: []string{"Container", "JavaScript"},
}
_, runtime, _ = prompt.Run()
}

switch strings.ToLower(runtime) {
case "container":
runtime = "FIRECRACKER"
case "javascript":
runtime = "NODEPROXY"
default:
return fmt.Errorf("Invalid runtime: %s", runtime)
}

org, err := setTargetOrg(ctx)
if err != nil {
return fmt.Errorf("Error setting organization: %s", err)
}

app, err := ctx.FlyClient.CreateApp(name, runtime, org)
app, err := ctx.FlyClient.CreateApp(name, org)
if err != nil {
return err
}
Expand Down
2 changes: 0 additions & 2 deletions cmd/status.go
Expand Up @@ -22,7 +22,6 @@ func runAppStatus(ctx *CmdContext) error {
id
name
version
runtime
status
appUrl
organization {
Expand Down Expand Up @@ -75,7 +74,6 @@ func renderAppInfo(app api.App) {
[]string{"Name", app.Name},
[]string{"Owner", app.Organization.Slug},
[]string{"Version", strconv.Itoa(app.Version)},
[]string{"Runtime", app.Runtime},
[]string{"Status", app.Status},
})
if app.AppURL == "" {
Expand Down

0 comments on commit a583bab

Please sign in to comment.