Skip to content

Commit c94c301

Browse files
michaely520claude
andauthored
Wire enableReplication into CLI (#919)
Add --enable-replication flag to the cluster upsert command and display IsReplicationEnabled in cluster list output. Cherry-picked from #881 (next-server branch). https://github.com/temporalio/cli/pull/881/changes Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 64fa7fa commit c94c301

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

internal/temporalcli/commands.gen.go

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

12261226
type TemporalOperatorClusterUpsertCommand struct {
1227-
Parent *TemporalOperatorClusterCommand
1228-
Command cobra.Command
1229-
FrontendAddress string
1230-
EnableConnection bool
1227+
Parent *TemporalOperatorClusterCommand
1228+
Command cobra.Command
1229+
FrontendAddress string
1230+
EnableConnection bool
1231+
EnableReplication bool
12311232
}
12321233

12331234
func NewTemporalOperatorClusterUpsertCommand(cctx *CommandContext, parent *TemporalOperatorClusterCommand) *TemporalOperatorClusterUpsertCommand {
@@ -1245,6 +1246,7 @@ func NewTemporalOperatorClusterUpsertCommand(cctx *CommandContext, parent *Tempo
12451246
s.Command.Flags().StringVar(&s.FrontendAddress, "frontend-address", "", "Remote endpoint. Required.")
12461247
_ = cobra.MarkFlagRequired(s.Command.Flags(), "frontend-address")
12471248
s.Command.Flags().BoolVar(&s.EnableConnection, "enable-connection", false, "Set the connection to \"enabled\".")
1249+
s.Command.Flags().BoolVar(&s.EnableReplication, "enable-replication", false, "Set the replication to \"enabled\".")
12481250
s.Command.Run = func(c *cobra.Command, args []string) {
12491251
if err := s.run(cctx, args); err != nil {
12501252
cctx.Options.Fail(err)

internal/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)

internal/temporalcli/commands.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,6 +1642,9 @@ commands:
16421642
- name: enable-connection
16431643
type: bool
16441644
description: Set the connection to "enabled".
1645+
- name: enable-replication
1646+
type: bool
1647+
description: Set the replication to "enabled".
16451648

16461649
- name: temporal operator namespace
16471650
summary: Namespace operations

0 commit comments

Comments
 (0)