Skip to content

Commit a211263

Browse files
authored
Wire enableReplication into cli (#881)
## What was changed Wiring in new enableReplication flag into cluster upsert cli. Deleting sql pinning test as we no longer need this, see historical context: #784 temporalio/temporal#7333 then unpinning in OSS temporalio/temporal#8489 ## Why? Allows for users to leverage the new field ## Checklist 1. Closes 2. How was this tested: built locally and tested in conjunction with temporalio/temporal#8744, used the cli manually to make a replication based test pass
1 parent 9f61163 commit a211263

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/spf13/pflag v1.0.6
1717
github.com/stretchr/testify v1.10.0
1818
github.com/temporalio/ui-server/v2 v2.39.0
19-
go.temporal.io/api v1.58.1-0.20251128181858-703071215042
19+
go.temporal.io/api v1.59.1-0.20251203230651-7773526824c5
2020
go.temporal.io/sdk v1.36.0
2121
go.temporal.io/sdk/contrib/envconfig v0.1.0
2222
go.temporal.io/server v1.29.0-135.0.0.20251210204203-56cbfb9a643c

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt
378378
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
379379
go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4=
380380
go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4=
381-
go.temporal.io/api v1.58.1-0.20251128181858-703071215042 h1:44+nPe+rGhYUwA1oDi46rkXEYEVfoAxOmb0myvTm4Es=
382-
go.temporal.io/api v1.58.1-0.20251128181858-703071215042/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM=
381+
go.temporal.io/api v1.59.1-0.20251203230651-7773526824c5 h1:7lFIrLVM+NPVcqFMrEwv5d8D9meA7n/Xl9GtCl8Gyhc=
382+
go.temporal.io/api v1.59.1-0.20251203230651-7773526824c5/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM=
383383
go.temporal.io/sdk v1.36.0 h1:WO9zetpybBNK7xsQth4Z+3Zzw1zSaM9MOUGrnnUjZMo=
384384
go.temporal.io/sdk v1.36.0/go.mod h1:8BxGRF0LcQlfQrLLGkgVajbsKUp/PY7280XTdcKc18Y=
385385
go.temporal.io/sdk/contrib/envconfig v0.1.0 h1:s+G/Ujph+Xl2jzLiiIm2T1vuijDkUL4Kse49dgDVGBE=

temporalcli/commands.gen.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,10 +1256,11 @@ func NewTemporalOperatorClusterSystemCommand(cctx *CommandContext, parent *Tempo
12561256
}
12571257

12581258
type TemporalOperatorClusterUpsertCommand struct {
1259-
Parent *TemporalOperatorClusterCommand
1260-
Command cobra.Command
1261-
FrontendAddress string
1262-
EnableConnection bool
1259+
Parent *TemporalOperatorClusterCommand
1260+
Command cobra.Command
1261+
FrontendAddress string
1262+
EnableConnection bool
1263+
EnableReplication bool
12631264
}
12641265

12651266
func NewTemporalOperatorClusterUpsertCommand(cctx *CommandContext, parent *TemporalOperatorClusterCommand) *TemporalOperatorClusterUpsertCommand {
@@ -1277,6 +1278,7 @@ func NewTemporalOperatorClusterUpsertCommand(cctx *CommandContext, parent *Tempo
12771278
s.Command.Flags().StringVar(&s.FrontendAddress, "frontend-address", "", "Remote endpoint. Required.")
12781279
_ = cobra.MarkFlagRequired(s.Command.Flags(), "frontend-address")
12791280
s.Command.Flags().BoolVar(&s.EnableConnection, "enable-connection", false, "Set the connection to \"enabled\".")
1281+
s.Command.Flags().BoolVar(&s.EnableReplication, "enable-replication", false, "Set the replication to \"enabled\".")
12801282
s.Command.Run = func(c *cobra.Command, args []string) {
12811283
if err := s.run(cctx, args); err != nil {
12821284
cctx.Options.Fail(err)

temporalcli/commands.operator_cluster.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,14 @@ func (c *TemporalOperatorClusterListCommand) run(cctx *CommandContext, args []st
126126
"HistoryShardCount": cluster.HistoryShardCount,
127127
"InitialFailoverVersion": cluster.InitialFailoverVersion,
128128
"IsConnectionEnabled": cluster.IsConnectionEnabled,
129+
"IsReplicationEnabled": cluster.IsReplicationEnabled,
129130
})
130131
}
131132
}
132133
// Print table, headers only on first table
133134
if len(textTable) > 0 {
134135
_ = cctx.Printer.PrintStructured(textTable, printer.StructuredOptions{
135-
Fields: []string{"Name", "ClusterId", "Address", "HistoryShardCount", "InitialFailoverVersion", "IsConnectionEnabled"},
136+
Fields: []string{"Name", "ClusterId", "Address", "HistoryShardCount", "InitialFailoverVersion", "IsConnectionEnabled", "IsReplicationEnabled"},
136137
Table: &printer.TableOptions{NoHeader: pageIndex > 0},
137138
})
138139
}
@@ -153,6 +154,7 @@ func (c *TemporalOperatorClusterUpsertCommand) run(cctx *CommandContext, args []
153154
_, err = cl.OperatorService().AddOrUpdateRemoteCluster(cctx, &operatorservice.AddOrUpdateRemoteClusterRequest{
154155
FrontendAddress: c.FrontendAddress,
155156
EnableRemoteClusterConnection: c.EnableConnection,
157+
EnableReplication: c.EnableReplication,
156158
})
157159
if err != nil {
158160
return fmt.Errorf("unable to upsert cluster: %w", err)

temporalcli/commandsgen/commands.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,9 @@ commands:
15551555
- name: enable-connection
15561556
type: bool
15571557
description: Set the connection to "enabled".
1558+
- name: enable-replication
1559+
type: bool
1560+
description: Set the replication to "enabled".
15581561

15591562
- name: temporal operator namespace
15601563
summary: Namespace operations

0 commit comments

Comments
 (0)