devfile / devworkspace-operator

Apache License 2.0
67 stars 55 forks source link

Override the default ssh askpass flow on project clone step #1291

Closed vinokurig closed 3 months ago

vinokurig commented 3 months ago

What does this PR do?

We support project clone from ssh urls, but if the ssh key has a passphrase, the project clone step will fail because the default ssh askpass flow will be invoked, but it does not support any other input then a manual input from keyboard. To override the default flow, a script file is used. The passphrase file must be mounted to /etc/ssh/ folder. The SSH_ASKPASS env variables defines the script file for the ssh flow, see: https://man.openbsd.org/ssh-add#ENVIRONMENT. The current open-ssh version does not support the SSH_ASKPASS_REQUIRE key, so we need to set the DISPLAY env variable as the command process does not have an associated terminal.

What issues does this PR fix or reference?

https://issues.redhat.com/browse/CRW-6614 Fix https://github.com/devfile/devworkspace-operator/issues/1294

Is it tested? How?

  1. Setup ssh key with passphrase: https://github.com/devfile/devworkspace-operator/blob/main/docs/additional-configuration.adoc#configuring-devworkspaces-to-use-ssh-keys-for-git-operations.
  2. Try to start a workspace from an ssh url.

    PR Checklist

openshift-ci[bot] commented 3 months ago

Hi @vinokurig. Thanks for your PR.

I'm waiting for a devfile member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
vinokurig commented 3 months ago

/test v8-devworkspace-operator-e2e, v8-che-happy-path

openshift-ci[bot] commented 3 months ago

@vinokurig: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to [this](https://github.com/devfile/devworkspace-operator/pull/1291#issuecomment-2257978465): >/test v8-devworkspace-operator-e2e, v8-che-happy-path Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
AObuchow commented 3 months ago

/ok-to-test

AObuchow commented 3 months ago

Thanks for the PR @vinokurig :) I didn't get a chance to properly look at this today, but I should be able to tomorrow (Wednesday).

vinokurig commented 3 months ago

@AObuchow Thank you for the review. Looks like we need @dmytro-ndp approval after he verifies the functionality.

ibuziuk commented 3 months ago

@musienko-maxim please review, we need QA approval for that one

openshift-ci[bot] commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AObuchow, dkwon17, musienko-maxim, vinokurig

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/devfile/devworkspace-operator/blob/main/OWNERS)~~ [AObuchow,dkwon17] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment