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

Bug 1844938: Migrate to DevWorkspace CR for the terminal #5687

Merged

Conversation

amisevsk
Copy link
Contributor

@amisevsk amisevsk commented Jun 8, 2020

Update the custom resource used for providing the OpenShift Web terminal to the DevWorkspace API to be more compatible going forward. This PR moves the GVK and spec used for terminals from

workspace.che.eclipse.org/v1alpha1/Workspaces

to

devfile.io/v1alpha1/DevWorkspaces

as is reflected in operator PR devfile/devworkspace-operator#92

There are additional compatibility changes included as well (e.g. required webhooks are renamed)

How to test

  1. Build image and deploy to cluster
  2. Deploy Workspace operator from changes in Switch to DevWorkspace ( devfile 2.0 ) API devfile/devworkspace-operator#92 (using built image)
    # In che-workspace-controller repo
    export WEBHOOK_ENABLED=true
    make deploy
    
  3. Start a terminal using a non-cluster-admin user

I've built the changes in this PR as image docker.io/amisevsk/console:devworkspace-api to simplify testing.

@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. label Jun 8, 2020
@openshift-ci-robot
Copy link
Contributor

@amisevsk: This pull request references Bugzilla bug 1844938, which is invalid:

  • expected the bug to target the "4.6.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1844938: Migrate to DevWorkspace CR for the terminal

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/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Jun 8, 2020
@openshift-ci-robot openshift-ci-robot added component/backend Related to backend component/core Related to console core functionality needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 8, 2020
@openshift-ci-robot
Copy link
Contributor

Hi @amisevsk. Thanks for your PR.

I'm waiting for a openshift 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/test-infra repository.

@christianvogt
Copy link
Contributor

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. labels Jun 8, 2020
@openshift-ci-robot
Copy link
Contributor

@christianvogt: This pull request references Bugzilla bug 1844938, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

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/test-infra repository.

@openshift-ci-robot openshift-ci-robot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Jun 8, 2020
kind: 'DevWorkspace',
label: 'Devworkspace',
labelPlural: 'workspaces',
apiGroup: 'apiextensions.k8s.io',

Choose a reason for hiding this comment

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

This change seems strange: from apiextensions.k8s.io to devfile.io. Is it a CR or a CRD ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm. Good point -- I'll look into it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The frontend needs to create/edit DevWorkspace instances, so devfile.io is the correct option here. You may be thinking of the earlier functionality that checked if the CRD was defined on the cluster for enabling/disabling the feature -- this has been replaced by a back-end endpoint.

Choose a reason for hiding this comment

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

Ah, OK

@christianvogt
Copy link
Contributor

/ok-to-test

@openshift-ci-robot openshift-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 9, 2020
@amisevsk
Copy link
Contributor Author

/retest

@openshift-ci-robot
Copy link
Contributor

@amisevsk: This pull request references Bugzilla bug 1844938, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1844938: Migrate to DevWorkspace CR for the terminal

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/test-infra repository.

1 similar comment
@openshift-ci-robot
Copy link
Contributor

@amisevsk: This pull request references Bugzilla bug 1844938, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1844938: Migrate to DevWorkspace CR for the terminal

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/test-infra repository.

@amisevsk
Copy link
Contributor Author

/retest

export const CLOUD_SHELL_CREATOR_LABEL = 'org.eclipse.che.workspace/creator';
export const CLOUD_SHELL_IMMUTABLE_ANNOTATION = 'org.eclipse.che.workspace/immutable';
export const CLOUD_SHELL_CREATOR_LABEL = 'controller.devfile.io/creator';
export const CLOUD_SHELL_IMMUTABLE_ANNOTATION = 'controller.devfile.io/restricted-access';
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Should it be better to name it CLOUD_SHELL_RESTRICTED_ANNOTATION ?
There are 2 other files to be changed in that case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While I'm renaming the constants, should I name them WEB_TERMINAL_* as well, given the naming change? (cloud-shell -> web-terminal)

Copy link
Contributor

Choose a reason for hiding this comment

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

@amisevsk i'd keep it as cloud shell right now for consistency in the code as the entire feature is using cloud shell.
We don't surface cloud shell to the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to CLOUD_SHELL_RESTRICTED_ANNOTATION

@christianvogt
Copy link
Contributor

front end changes lgtm

I tested the PR on cluster bot today and the DevWorkspace ran as expected.

@amisevsk
Copy link
Contributor Author

From testing with @christianvogt, using a Foreground propagation policy results in resources not being removed; I've updated the model to use Background.

Update the custom resource used for providing the OpenShift Web terminal
to the DevWorkspace API to be more compatible going forward.

Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

We should follow up about the propagation policy

apiVersion: 'v1alpha1',
abbr: 'DW',
namespaced: true,
crd: true,
plural: 'devworkspaces',
propagationPolicy: 'Foreground',
propagationPolicy: 'Background',
Copy link
Member

Choose a reason for hiding this comment

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

We should determine what isn't getting garbage collected. This doesn't necessarily fix the underlying problem since there's still some resource that isn't deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks to be related to kubernetes/kubernetes#90512

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created issue eclipse-che/che#17146 with more details, but I still have no idea what resource isn't being cleaned up here -- all owned objects are removed but e.g. the deployment is stuck with a foregroundDeletion finalizer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Figured this one out -- the workspace controller webhooks were blocking the removal of the foregroundDeletion finalizer. This is fixed by devfile/devworkspace-operator#107.

Is there a preference between foreground and background deletion here? The default for cli tools is background.

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 11, 2020
@christianvogt
Copy link
Contributor

/cherry-pick release-4.5.z

@openshift-cherrypick-robot

@christianvogt: once the present PR merges, I will cherry-pick it on top of release-4.5.z in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.5.z

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/test-infra repository.

Copy link
Contributor

@sleshchenko sleshchenko left a comment

Choose a reason for hiding this comment

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

Still LGTM =)

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amisevsk, sleshchenko, spadgett

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:

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

@openshift-merge-robot openshift-merge-robot merged commit 2715a74 into openshift:master Jun 11, 2020
@openshift-ci-robot
Copy link
Contributor

@amisevsk: All pull requests linked via external trackers have merged: openshift/console#5687. Bugzilla bug 1844938 has been moved to the MODIFIED state.

In response to this:

Bug 1844938: Migrate to DevWorkspace CR for the terminal

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/test-infra repository.

@openshift-cherrypick-robot

@christianvogt: cannot checkout release-4.5.z: error checking out release-4.5.z: exit status 1. output: error: pathspec 'release-4.5.z' did not match any file(s) known to git.

In response to this:

/cherry-pick release-4.5.z

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/test-infra repository.

@rohitkrai03
Copy link
Contributor

/cherry-pick release-4.5

@openshift-cherrypick-robot

@rohitkrai03: new pull request created: #5730

In response to this:

/cherry-pick release-4.5

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/test-infra repository.

@spadgett spadgett added this to the v4.6 milestone Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/backend Related to backend component/core Related to console core functionality lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants