Skip to content

Commit

Permalink
Merge pull request #9 from synadia-io/fix/docker-metrics
Browse files Browse the repository at this point in the history
fixed default runtime
  • Loading branch information
calmera authored Jan 16, 2025
2 parents 4ecf4db + 7aebbe1 commit 3d281f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
13 changes: 2 additions & 11 deletions cli/connector_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func configureConnectorCommand(parentCmd commandHost) {
createCmd.Arg("id", "The id of the connector to create").Required().StringVar(&c.id)
createCmd.Arg("declaration", "The connector declaration").Default("!nil!").StringVar(&c.declaration)
createCmd.Flag("interactive", "Create/update the connector using your editor").Short('i').BoolVar(&c.interactive)
createCmd.Flag("runtime", "The runtime id").Default("vanilla").StringVar(&c.runtime)
createCmd.Flag("runtime", "The runtime id").Default("wombat").StringVar(&c.runtime)

editCmd := connectorCmd.Command("edit", "Edit a connector").Action(c.updateConnector)
editCmd.Arg("id", "The id of the connector to edit").Required().StringVar(&c.id)
Expand Down Expand Up @@ -362,15 +362,6 @@ func (c *connectorCommand) interactiveCreate(id string) {
os.Exit(1)
}

// -- get the runtime details from the library
v, err := libraryClient().GetLatestVersion(c.runtime)
if err != nil {
color.Red("Could not get the latest version of the runtime: %s", err)
os.Exit(1)
}
cfg.Workload = v.Workload.Location
cfg.Metrics = v.Workload.Metrics

ccfg, _ := c.interactiveEdit(model.Connector{
ConnectorConfig: *cfg,
Id: c.id,
Expand All @@ -385,7 +376,7 @@ func (c *connectorCommand) interactiveCreate(id string) {
}

func (c *connectorCommand) selectConnectorTemplate() (*model.ConnectorConfig, error) {
version, err := libraryClient().GetLatestVersion("vanilla")
version, err := libraryClient().GetLatestVersion(c.runtime)
if err != nil {
return nil, fmt.Errorf("could not get the latest vanilla version: %s", err)
}
Expand Down
4 changes: 2 additions & 2 deletions cli/library_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ func configureLibraryCommand(parentCmd commandHost) {
runtimeCmd.Arg("id", "The id of the runtime to describe").Required().StringVar(&c.runtime)

searchCmd := componentCmd.Command("search", "Search for components").Action(c.search)
searchCmd.Flag("runtime", "The runtime id").Default("vanilla").StringVar(&c.runtime)
searchCmd.Flag("runtime", "The runtime id").Required().StringVar(&c.runtime)
searchCmd.Flag("rev", "The version id or 'latest' to get the latest version").Default("latest").StringVar(&c.version)
searchCmd.Flag("kind", "The kind of the component to search for").EnumVar(&c.kind, kindOpts...)
searchCmd.Flag("status", "The status of the component to search for").EnumVar(&c.status, string(model.ComponentStatusActive), string(model.ComponentStatusPreview), string(model.ComponentStatusExperimental), string(model.ComponentStatusDeprecated))

infoCmd := componentCmd.Command("show", "Show information about a component").Alias("get").Action(c.info)
infoCmd.Flag("runtime", "The runtime id").Default("vanilla").StringVar(&c.runtime)
infoCmd.Flag("runtime", "The runtime id").Required().StringVar(&c.runtime)
infoCmd.Flag("rev", "The version id or 'latest' to get the latest version").Default("latest").StringVar(&c.version)
infoCmd.Arg("kind", "The kind of the component").EnumVar(&c.kind, kindOpts...)
infoCmd.Arg("name", "The name of the component").StringVar(&c.component)
Expand Down

0 comments on commit 3d281f9

Please sign in to comment.