Skip to content
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

[crmsh-4.5] Dev: bootstrap: more robust implementation for ssh_merge (bsc#1230530) #1575

Merged

Conversation

nicholasyang2022
Copy link
Collaborator

  • Do not use legacy write_remote_file, which does not work well with _guess_user_for_ssh.
  • Implement deduplication when merging known_hosts

* Do not use legacy `write_remote_file`, which does not work well with
  `_guess_user_for_ssh`.
* Implement deduplication when merging known_hosts
Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 65.78%. Comparing base (80d011e) to head (85ace09).
Report is 12 commits behind head on crmsh-4.5.

Files with missing lines Patch % Lines
crmsh/bootstrap.py 86.66% 2 Missing ⚠️
Additional details and impacted files
Flag Coverage Δ
integration 51.83% <86.66%> (+0.01%) ⬆️
unit 47.47% <20.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
crmsh/utils.py 68.75% <ø> (-0.03%) ⬇️
crmsh/bootstrap.py 82.12% <86.66%> (+0.41%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nicholasyang2022
Copy link
Collaborator Author

nicholasyang2022 commented Oct 9, 2024

How to reproduce

We need to emulate a cluster with key-based ssh authentication set up in advance, and ensure there are at least 2 existing nodes in the cluster, so that ssh_merge has some host keys to merge.

  1. on node1: crm cluster init -N node2 -y
  2. on node3:
    1. ssh-keygen
    2. ssh-copy-id node2
    3. crm cluster join ssh_merge -c node2 -y

@liangxin1300
Copy link
Collaborator

How to reproduce

We need to emulate a cluster with key-based ssh authentication set up in advance, and ensure there are at least 2 existing nodes in the cluster, so that ssh_merge has some host keys to merge.

  1. on node1: crm cluster init -N node2 -y

  2. on node3:

    1. ssh-keygen
    2. ssh-copy-id node2
    3. crm cluster init ssh_merge -c node2 -y

I can reproduce following above steps.
btw, the third step should be crm cluster join ssh_merge -c node2 -y

@liangxin1300
Copy link
Collaborator

As the user still using stages to setup cluster, I suggest we backport #1384 to crmsh-4.5 and crmsh-4.4

@nicholasyang2022 nicholasyang2022 marked this pull request as ready for review November 12, 2024 07:11
@nicholasyang2022 nicholasyang2022 merged commit 05da45b into ClusterLabs:crmsh-4.5 Nov 13, 2024
30 checks passed
@nicholasyang2022 nicholasyang2022 deleted the bsc_1230530_20241008 branch November 26, 2024 06:15
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