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

Fix for sidecar installation failure if k8s worker nodes are not in ~/.ssh/known_hosts #60

Merged
merged 2 commits into from
Jan 10, 2022

Conversation

sharmilarama
Copy link
Contributor

Description

This PR addresses an issue with sidecar installation failure when the remote k8s worker nodes have not yet been added to the ~/.ssh/known_hosts file. While running SSH commands to check connectivity to the authorization proxy there is an additional message in the response "Warning: Permanently added '1.2.3.4' (ECDSA) to the list of known hosts.". This PR adds changes to ignore this warning message to get the response code in the next line.

GitHub Issues

GitHub Issue #
dell/csm#147

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration
Tested verify,sh script for driver installation.

@sharmilarama sharmilarama changed the title Add warning check Fix for sidecar installation failure if k8s worker nodes are not in ~/.ssh/known_hosts Jan 6, 2022
@@ -370,15 +370,24 @@ function verify_authorization_proxy_server() {
WGET=$(ssh ${NODEUSER}@"${node}" "which wget")
if [ -x "${WGET}" ]; then
log info "Running wget on "${node}""
nr=1
if [ "${insecure}" == "true" ]
then
resp=$(ssh ${NODEUSER}@"${node}" wget --no-check-certificate --server-response --spider --quiet https://"${proxyHost}" 2>&1)
Copy link
Contributor

Choose a reason for hiding this comment

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

why not set log level to get rid of warning line , then you dont need to look for second line in output ?
ssh -o LogLevel=error xxx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if that affects any of the other responses. This way seems the least intrusive.

Copy link
Collaborator

@JacobGros JacobGros left a comment

Choose a reason for hiding this comment

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

LGTM

@jooseppi-luna jooseppi-luna self-assigned this Jan 10, 2022
@jooseppi-luna jooseppi-luna removed their assignment Jan 10, 2022
@sharmilarama sharmilarama merged commit d7d522b into main Jan 10, 2022
@sharmilarama sharmilarama deleted the add-warning-check branch January 18, 2022 14:32
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.

4 participants