8000 e2e: support optional passive hub by parikshithb · Pull Request #2109 · RamenDR/ramen · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

e2e: support optional passive hub #2109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2025
Merged

e2e: support optional passive hub #2109

merged 1 commit into from
Jun 25, 2025

Conversation

parikshithb
Copy link
Member
@parikshithb parikshithb commented Jun 23, 2025

Adding support for passive hub in config and initialize its env if configured:

  • Added optional passive hub cluster configuration with new PassiveHub field in Env struct
  • Extended cluster creation logic to handle "passive-hub" cluster type
  • Include passive hub in distro detection when available

Testing

  1. With invalid passive hub kubeconfig path:
clusters:
  hub:
    kubeconfig: /Users/pari/.config/drenv/rdr/kubeconfigs/hub
  passive-hub:
    kubeconfig: "/does/not/exist/passive"
  c1:
    kubeconfig: /Users/pari/.config/drenv/rdr/kubeconfigs/dr1
  c2:
    kubeconfig: /Users/pari/.config/drenv/rdr/kubeconfigs/dr2

Does not exist:

./run.sh -test.run TestValidation
2025-06-24T15:59:33.452+0530	INFO	Using config file "config.yaml"
2025-06-24T15:59:33.453+0530	INFO	Using log file "ramen-e2e.log"
2025-06-24T15:59:33.454+0530	INFO	Using "hub" cluster name: "hub"
2025-06-24T15:59:33.461+0530	INFO	Detected "c1" managed cluster name: "dr1"
2025-06-24T15:59:33.469+0530	INFO	Detected "c2" managed cluster name: "dr2"
2025-06-24T15:59:33.469+0530	ERROR	Failed to create testing context: failed to create env: failed to create cluster "passive-hub": failed to build config from kubeconfig (/does/not/exist/passive): stat /does/not/exist/passive: no such file or directory
  1. With empty passive hub kubeconfig:
clusters:
  hub:
    kubeconfig: /Users/pari/.config/drenv/rdr/kubeconfigs/hub
  passive-hub:
    kubeconfig: 
  c1:
    kubeconfig: /Users/pari/.config/drenv/rdr/kubeconfigs/dr1
  c2:
    kubeconfig: /Users/pari/.config/drenv/rdr/kubeconfigs/dr2

Does not detect passive hub and continues without it:

--- PASS: TestValidation (0.02s)
    --- PASS: TestValidation/c1 (0.00s)
    --- PASS: TestValidation/c2 (0.00s)
    --- PASS: TestValidation/hub (0.00s)
PASS
  1. With valid passive hub kubeconfig (used hub kubeconfig for testing)
clusters:
  hub:
    kubeconfig: /Users/pari/.config/drenv/rdr/kubeconfigs/hub
  passive-hub:
    kubeconfig: /Users/pari/.config/drenv/rdr/kubeconfigs/hub
  c1:
    kubeconfig: /Users/pari/.config/drenv/rdr/kubeconfigs/dr1
  c2:
    kubeconfig: /Users/pari/.config/drenv/rdr/kubeconfigs/dr2

Detects the kubeconfig and sets default name, creates client:

./run.sh -test.run TestValidation
2025-06-24T16:05:19.180+0530	INFO	Using config file "config.yaml"
2025-06-24T16:05:19.181+0530	INFO	Using log file "ramen-e2e.log"
2025-06-24T16:05:19.182+0530	INFO	Using "hub" cluster name: "hub"
2025-06-24T16:05:19.190+0530	INFO	Detected "c1" managed cluster name: "dr1"
2025-06-24T16:05:19.198+0530	INFO	Detected "c2" managed cluster name: "dr2"
2025-06-24T16:05:19.198+0530	INFO	Using "passive-hub" cluster name: "passive-hub"
.... (PASS)

Fixes #2107

@parikshithb parikshithb marked this pull request as draft June 23, 2025 12:26
@parikshithb parikshithb removed the request for review from raghavendra-talur June 23, 2025 12:26
@nirs
Copy link
Member
nirs commented Jun 23, 2025

@parikshithb please rebase to fix the CI failures.

@parikshithb
Copy link
Member Author

Updated PR description with testing info.

Copy link
Member
@nirs nirs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! waiting until #2108 is merged and CI completes.

@nirs
Copy link
Member
nirs commented Jun 24, 2025

@parikshithb please rebase, #2108 was merged.

This change enables optional passive hub cluster configuration.

- Add PassiveHub field to Env struct when present
- Extend cluster creation logic to handle "passive-hub" cluster
- Include passive hub in distro detection when available

Signed-off-by: Parikshith <parikshithb@gmail.com>
@parikshithb parikshithb marked this pull request as ready for review June 25, 2025 08:38
@nirs nirs merged commit abf706d into RamenDR:main Jun 25, 2025
22 of 23 checks passed
parikshithb added a commit to parikshithb/ramenctl that referenced this pull request Jun 26, 2025
Consuming fix for supporting optional passive hub:
- RamenDR/ramen#2109

Issues fixed in ramen e2e:
- RamenDR/ramen#2107

Signed-off-by: Parikshith <parikshithb@gmail.com>
nirs pushed a commit to RamenDR/ramenctl that referenced this pull request Jun 26, 2025
Consuming fix for supporting optional passive hub:
- RamenDR/ramen#2109

Issues fixed in ramen e2e:
- RamenDR/ramen#2107

Signed-off-by: Parikshith <parikshithb@gmail.com>
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.

e2e: add passive hub cluster support
4 participants
0