Skip to content

💥 Reject conflicting namespace update flags - #1187

Open
qyc5937 wants to merge 3 commits into
mainfrom
qian/namespace-update-active-cluster-validation
Open

💥 Reject conflicting namespace update flags#1187
qyc5937 wants to merge 3 commits into
mainfrom
qian/namespace-update-active-cluster-validation

Conversation

@qyc5937

@qyc5937 qyc5937 commented Sep 1, 2026

Copy link
Copy Markdown

Related issues

None.

What changed?

  • Reject operator namespace update --active-cluster when it is combined with another namespace mutation flag.
  • Validate before dialing the server so invalid commands cannot issue an RPC.
  • Preserve the existing --promote-global/--active-cluster error and remove the misleading "other flag will be omitted" message from active-cluster updates.
  • Document that namespace configuration and active-cluster changes must be separate commands.

💥 Breaking change

Commands that combine --active-cluster with another namespace mutation flag previously exited successfully after silently discarding the other requested updates. They now fail before issuing an RPC in both text and JSON output modes.

Apply namespace configuration first, then change the active cluster in a separate command. Active-cluster-only updates are unchanged.

Checklist

Stability

  • Breaking changes are marked with 💥 in the PR title and release notes
  • Changes to JSON output (-o json / -o jsonl) are treated as breaking changes

Design

  • This feature does not depend on Cloud-only APIs or behavior (it works against an OSS server)

Help text

  • All flags shown in help text and examples are implemented and functional
  • Long descriptions end with a period and include at least one example invocation
  • Examples use long flags, one flag per line
  • Placeholder values use YourXxx form

Behavior

  • Results go to stdout; errors and warnings go to stderr
  • Error messages are lowercase with no trailing punctuation

Tests

  • Added functional test(s) (SharedServerSuite)
  • Added unit test(s) (func TestXxx) where applicable

Manual tests

Setup

Used two OSS clusters at 127.0.0.1:7233 and 127.0.0.1:8233 with a global namespace initially active in cluster-a and replicated only to cluster-a.

Happy path

$ temporal operator namespace update \
    --address 127.0.0.1:7233 \
    --namespace YourNamespace \
    --active-cluster cluster-b
Namespace YourNamespace update succeeded.

Error case

$ temporal operator namespace update \
    --address 127.0.0.1:7233 \
    --namespace YourNamespace \
    --active-cluster cluster-a \
    --cluster cluster-a \
    --cluster cluster-b
Error: --active-cluster cannot be combined with --cluster; update namespace configuration before changing the active cluster
$ echo $?
1

The same command with --output json returns the same error and exit status. Namespace state remains unchanged.

Composition

$ temporal operator namespace update \
    --address 127.0.0.1:7233 \
    --namespace YourNamespace \
    --cluster cluster-a \
    --cluster cluster-b
Namespace YourNamespace update succeeded.

$ temporal operator namespace update \
    --address 127.0.0.1:7233 \
    --namespace YourNamespace \
    --active-cluster cluster-b
Namespace YourNamespace update succeeded.

Both clusters subsequently reported cluster-b as active.

Automated tests

  • go test -tags test_dep ./internal/temporalcli -run "TestNamespaceUpdate_ActiveCluster|TestSharedServerSuite/TestNamespaceUpdate_ActiveClusterAlone" -count=1
  • go test -tags test_dep ./... (namespace tests passed; unrelated TestDeployment_List propagation assertion flaked once and passed on isolated retry)
  • go vet -tags test_dep ./... (reports existing warnings in task queue and command context code)
  • make gen
  • git diff --check

@qyc5937
qyc5937 requested a review from a team as a code owner September 1, 2026 22:43
@CLAassistant

CLAassistant commented Sep 1, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@qyc5937
qyc5937 marked this pull request as draft September 1, 2026 23:17
@qyc5937
qyc5937 marked this pull request as ready for review September 1, 2026 23:17
@qyc5937 qyc5937 changed the title Reject conflicting namespace update flags 💥 Reject conflicting namespace update flags Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants