Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions internal/temporalcli/commands.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -1224,10 +1224,11 @@ func NewTemporalOperatorClusterSystemCommand(cctx *CommandContext, parent *Tempo
}

type TemporalOperatorClusterUpsertCommand struct {
Parent *TemporalOperatorClusterCommand
Command cobra.Command
FrontendAddress string
EnableConnection bool
Parent *TemporalOperatorClusterCommand
Command cobra.Command
FrontendAddress string
EnableConnection bool
EnableReplication bool
}

func NewTemporalOperatorClusterUpsertCommand(cctx *CommandContext, parent *TemporalOperatorClusterCommand) *TemporalOperatorClusterUpsertCommand {
Expand All @@ -1245,6 +1246,7 @@ func NewTemporalOperatorClusterUpsertCommand(cctx *CommandContext, parent *Tempo
s.Command.Flags().StringVar(&s.FrontendAddress, "frontend-address", "", "Remote endpoint. Required.")
_ = cobra.MarkFlagRequired(s.Command.Flags(), "frontend-address")
s.Command.Flags().BoolVar(&s.EnableConnection, "enable-connection", false, "Set the connection to \"enabled\".")
s.Command.Flags().BoolVar(&s.EnableReplication, "enable-replication", false, "Set the replication to \"enabled\".")
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
Expand Down
4 changes: 3 additions & 1 deletion internal/temporalcli/commands.operator_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ func (c *TemporalOperatorClusterListCommand) run(cctx *CommandContext, args []st
"HistoryShardCount": cluster.HistoryShardCount,
"InitialFailoverVersion": cluster.InitialFailoverVersion,
"IsConnectionEnabled": cluster.IsConnectionEnabled,
"IsReplicationEnabled": cluster.IsReplicationEnabled,
})
}
}
// Print table, headers only on first table
if len(textTable) > 0 {
_ = cctx.Printer.PrintStructured(textTable, printer.StructuredOptions{
Fields: []string{"Name", "ClusterId", "Address", "HistoryShardCount", "InitialFailoverVersion", "IsConnectionEnabled"},
Fields: []string{"Name", "ClusterId", "Address", "HistoryShardCount", "InitialFailoverVersion", "IsConnectionEnabled", "IsReplicationEnabled"},
Table: &printer.TableOptions{NoHeader: pageIndex > 0},
})
}
Expand All @@ -153,6 +154,7 @@ func (c *TemporalOperatorClusterUpsertCommand) run(cctx *CommandContext, args []
_, err = cl.OperatorService().AddOrUpdateRemoteCluster(cctx, &operatorservice.AddOrUpdateRemoteClusterRequest{
FrontendAddress: c.FrontendAddress,
EnableRemoteClusterConnection: c.EnableConnection,
EnableReplication: c.EnableReplication,
})
if err != nil {
return fmt.Errorf("unable to upsert cluster: %w", err)
Expand Down
3 changes: 3 additions & 0 deletions internal/temporalcli/commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,9 @@ commands:
- name: enable-connection
type: bool
description: Set the connection to "enabled".
- name: enable-replication
type: bool
description: Set the replication to "enabled".

- name: temporal operator namespace
summary: Namespace operations
Expand Down