Closed AObuchow closed 2 weeks ago
Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all
@vinokurig: changing LGTM is restricted to collaborators
It would be nice to add a documentation note e.g.
*Note:* Specifying a passphrase for an SSH key is an experimental feature and is controlled by the `DevWorkspaceOperatorConfig.EnableExperimentalFeatures` option.
It would be nice to add a documentation note e.g.
*Note:* Specifying a passphrase for an SSH key is an experimental feature and is controlled by the `DevWorkspaceOperatorConfig.EnableExperimentalFeatures` option.
+1 will add an extra commit for this
@dkwon17 thank you for the review :) will squash my fixup commits tomorrow & have this merged
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: AObuchow, dkwon17, ibuziuk, vinokurig
The full list of commands accepted by this bot can be found here.
The pull request process is described here
New changes are detected. LGTM label has been removed.
What does this PR do?
The SSH agent initialization postStart event is now only injected under the following conditions:
git-ssh-key
exists in the workspace's namespacegit-ssh-key
contains a data key calledpassphrase
config.enableExperimentalFeatures: true
is set in an external DWOC used by the workspace, or in the global DWOC.The intention of this PR is to ensure the SSH agent initialization postStart event is only injected if user's opt-in by configuring the DWOC accordingly, and provide a passphrase in their SSH key.
However, this is only a temporary workaround for DWO 0.31.2. After this PR, we should reconsider how this postStart event should be injected. I've mentioned 2 potential ideas in the long-term solution section of https://github.com/devfile/devworkspace-operator/issues/1340
What issues does this PR fix or reference?
1340
Is it tested? How?
First deploy DWO with the changes from this PR.
There are 4 scenarios to test:
I recommend testing all 4 scenarios in order.
Scenario 1: no SSH secret configured; experimental features disabled
oc get pod <workspace-pod-name> -n $NAMESPACE -o json | jq '.spec.containers[0].lifecycle.postStart'
should benull
.oc delete dw plain-devworkspace -n $NAMESPACE
Scenario 2: SSH secret configured with no passphrase; experimental features disabled
$PASSPHRASE
environment variable when creating the SSH secret.oc delete dw plain-devworkspace -n $NAMESPACE
Scenario 3: SSH secret configured with a passphrase; experimental features disabled
oc delete secret git-ssh-key -n $NAMESPACE
$PASSPHRASE
environment variable when creating the SSH secret.oc delete dw plain-devworkspace -n $NAMESPACE
Scenario 4: SSH secret configured with a passphrase; experimental features enabled
oc edit dwoc -n $NAMESPACE
oc get pod <workspace-pod-name> -n $NAMESPACE -o json | jq '.spec.containers[0].lifecycle.postStart'
PR Checklist
/test v8-devworkspace-operator-e2e, v8-che-happy-path
to trigger)v8-devworkspace-operator-e2e
: DevWorkspace e2e testv8-che-happy-path
: Happy path for verification integration with Che