From f1f66602c3ff12094607cf696ce8487fc4bbc181 Mon Sep 17 00:00:00 2001 From: Matthias De Vriendt Date: Fri, 21 Nov 2025 11:36:52 +0100 Subject: [PATCH] fix: connector copy command should not require a runtime version arg --- cli/connector_command.go | 4 +--- cli/connector_command_helpers.go | 2 +- cli/connector_command_test.go | 7 ++++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cli/connector_command.go b/cli/connector_command.go index 407a894..778e87d 100644 --- a/cli/connector_command.go +++ b/cli/connector_command.go @@ -47,7 +47,6 @@ type connectorCommand struct { targetId string runtime string - runtimeVersion string envFileSetByUser bool } @@ -72,7 +71,6 @@ func ConfigureConnectorCommand(parentCmd commandHost, opts *Options) { copyCmd := connectorCmd.Command("copy", "Copy a connector").Action(c.copyConnector) copyCmd.Arg("id", "The id of the connector to copy").Required().StringVar(&c.id) copyCmd.Arg("target-id", "The id of the new connector").Required().StringVar(&c.targetId) - copyCmd.Flag("runtime-version", "The runtime version for the new connector").Required().StringVar(&c.runtimeVersion) deleteCmd := connectorCmd.Command("delete", "Delete a connector").Alias("rm").Action(c.removeConnector) deleteCmd.Arg("connector", "The name of the connector").Required().StringVar(&c.id) @@ -432,7 +430,7 @@ func (c *connectorCommand) copyConnector(context *fisk.ParseContext) error { return nil } - _, err = appCtx.Client.CreateConnector(c.targetId, conn.Description, conn.RuntimeId, c.runtimeVersion, convert.ConvertStepsFromSpec(convert.ConvertStepsToSpec(conn.Steps)), c.opts.Timeout) + _, err = appCtx.Client.CreateConnector(c.targetId, conn.Description, conn.RuntimeId, conn.RuntimeVersion, convert.ConvertStepsFromSpec(convert.ConvertStepsToSpec(conn.Steps)), c.opts.Timeout) fisk.FatalIfError(err, "failed to create connector %s: %v", c.targetId, err) fmt.Printf("Created connector %s\n", color.GreenString(c.targetId)) diff --git a/cli/connector_command_helpers.go b/cli/connector_command_helpers.go index b3bcd95..5751ced 100644 --- a/cli/connector_command_helpers.go +++ b/cli/connector_command_helpers.go @@ -142,7 +142,7 @@ func (c *connectorCommand) copyConnectorWithClient(appCtx *AppContext) error { } // Create the copy - copied, err := appCtx.Client.CreateConnector(c.targetId, connector.Description, connector.RuntimeId, c.runtimeVersion, connector.Steps, c.opts.Timeout) + copied, err := appCtx.Client.CreateConnector(c.targetId, connector.Description, connector.RuntimeId, connector.RuntimeVersion, connector.Steps, c.opts.Timeout) if err != nil { return fmt.Errorf("failed to create connector copy: %w", err) } diff --git a/cli/connector_command_test.go b/cli/connector_command_test.go index 663cb6b..63af134 100644 --- a/cli/connector_command_test.go +++ b/cli/connector_command_test.go @@ -264,9 +264,10 @@ var _ = Describe("ConnectorCommand", func() { It("should copy a connector", func() { // First it gets the source connector mockCl.connector = &model.Connector{ - ConnectorId: "source-connector", - Description: "Source Connector", - RuntimeId: "synadia", + ConnectorId: "source-connector", + Description: "Source Connector", + RuntimeId: "synadia", + RuntimeVersion: "v1.0.0", Steps: model.Steps{ Source: &model.SourceStep{ Type: "generate",