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

Mark the injection of the SSH agent postStart event as experimental feature #1344

Closed
wants to merge 1 commit into from

Conversation

vinokurig
Copy link
Contributor

What does this PR do?

Wrap the AddSshAgentPostStartEvent function into the EnableExperimentalFeatures condition.

What issues does this PR fix or reference?

#1337

Is it tested? How?

Create a workspace with a container without sh:

apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspace
metadata:
  name: plain-devworkspace
spec:
  routingClass: che
  started: true
  template:
    components:
      - container:
          image: 'quay.io/devfile/universal-developer-image:ubi8-latest'
        name: universal-developer-image
      - container:
          image: 'ghcr.io/l0rd/outyet@sha256:3ab91b5801ab2e2a6147cab5d4a959838d9318921298e84cf7b6d19a3359e496'
        name: test

See: workspace starts successfully.

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Copy link

openshift-ci bot commented Nov 6, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vinokurig
Once this PR has been reviewed and has the lgtm label, please assign dkwon17 for approval. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

openshift-ci bot commented Nov 6, 2024

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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@vinokurig vinokurig changed the title Mark the AddSshAgentPostStartEvent function as experimental feature Mark the injection of the SSH agent postStart event as experimental feature Nov 6, 2024
@vinokurig vinokurig force-pushed the dwo-1337_1 branch 4 times, most recently from 129b8c7 to 12352ab Compare November 6, 2024 14:39
Copy link
Collaborator

@AObuchow AObuchow left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @vinokurig :) I've left some comments, but it's worth noting that in #1341 I've also guarded the SSH agent initialization postStart event as an experimental feature.

Maybe we can take the documentation changes you've made here and add them to my existing PR (which I would appreciate your review of)?

if err != nil {
return r.failWorkspace(workspace, "Failed to add ssh-agent post start event", metrics.ReasonWorkspaceEngineFailure, reqLogger, &reconcileStatus), nil
// Include to experimental features list because it is not clear how to handle post start events in containers without sh.
if *workspace.Config.EnableExperimentalFeatures {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this could result in a null pointer exception since workspace.Config.EnableExperimentalFeatures might be null. Instead we should check if it's null beforehand:

if workspace.Config.EnableExperimentalFeatures != null && *workspace.Config.EnableExperimentalFeature

@@ -225,6 +225,7 @@ you must add the following in your `~/.bashrc`:
----
[ -f $HOME/ssh-environment ] && source $HOME/ssh-environment
----
*Note:* This is an experimental feature and is controlled by the `DevWorkspaceOperatorConfig.EnableExperimentalFeatures` option.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good call on documenting this! Maybe we should clarify that using an SSH passphrase is an experimental feature? Something like:

*Note:*  Specifying a passphrase for an SSH key is an experimental feature and is controlled by the `DevWorkspaceOperatorConfig.EnableExperimentalFeatures` option.

@vinokurig
Copy link
Contributor Author

@AObuchow sorry I did not see your pull request so I am closing mine in favour of yours.

@vinokurig vinokurig closed this Nov 6, 2024
@AObuchow
Copy link
Collaborator

AObuchow commented Nov 6, 2024

@vinokurig No need to apologize, I appreciate you working on this :) Sounds good with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants