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

feat: don't take control over DWO which is not managed by Che #1085

Merged
merged 17 commits into from
Oct 1, 2021
Merged

Conversation

sleshchenko
Copy link
Member

@sleshchenko sleshchenko commented Sep 23, 2021

What does this PR do?

It's really annoying when you do make install from DWO repo, and expect your custom DWO be installed, but then Che operator takes control over DWO.
There is a weird way to workaround it - cluster DWO CSV, but I believe the proper solution is not to take control over DWO which is not managed by Che.

Initially, it was supposed to be simple PR, but then I noticed a few bugs and inaccuracies, so it also brings refactoring to the whole devworkspace package.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

N/A

How to test this PR?

unit tests pretty everything, but for manual test you may:

  1. Checkout https://github.com/devfile/devworkspace-operator and execute make install from there.
  2. Deploy the with operator installer.
  3. Check that DWO from 1 is not overridden.

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@sleshchenko
Copy link
Member Author

/test v7-devworkspace-happy-path

@sleshchenko
Copy link
Member Author

v7-devworkspace-happy-path and the only failure I see, Che Operator reports:

"error":"no version "" has been registered in scheme "/che-operator/main.go:76

pkg/deploy/dev-workspace/dev_workspace_test.go Outdated Show resolved Hide resolved
@sleshchenko
Copy link
Member Author

/test v7-devworkspace-happy-path

@openshift-ci openshift-ci bot removed the lgtm label Sep 24, 2021
@sleshchenko sleshchenko changed the title feat: don't take control over DWO which is not managed by Che WIP feat: don't take control over DWO which is not managed by Che Sep 24, 2021
@sleshchenko

This comment has been minimized.

@codecov

This comment has been minimized.

@sleshchenko sleshchenko force-pushed the managedDWO branch 4 times, most recently from 282f7e8 to 1659d59 Compare September 30, 2021 11:35
@openshift-ci openshift-ci bot added the lgtm label Sep 30, 2021
Copy link

@JPinkney JPinkney left a comment

Choose a reason for hiding this comment

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

Other then Angel's comments it looks good to me

Dockerfile Outdated Show resolved Hide resolved
pkg/deploy/dev-workspace/dev_workspace.go Outdated Show resolved Hide resolved
Comment on lines 21 to 26
isCreated, err := CreateIfNotExists(deployContext, saSpec)
if err != nil {
return false, err
}
// we're done if SA already exist
return !isCreated, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
isCreated, err := CreateIfNotExists(deployContext, saSpec)
if err != nil {
return false, err
}
// we're done if SA already exist
return !isCreated, nil
_, err := CreateIfNotExists(deployContext, saSpec)
return err == nil, err

Copy link
Member Author

Choose a reason for hiding this comment

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

well, it depends on policy whether we should do reconcile after object is created/modified or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

let's discuss it

@openshift-ci openshift-ci bot added the lgtm label Oct 1, 2021
@openshift-ci
Copy link

openshift-ci bot commented Oct 1, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: amisevsk, JPinkney, mmorhun, sleshchenko, tolusha

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

@openshift-ci openshift-ci bot removed the lgtm label Oct 1, 2021
@openshift-ci
Copy link

openshift-ci bot commented Oct 1, 2021

New changes are detected. LGTM label has been removed.

@sleshchenko
Copy link
Member Author

/retest

2 similar comments
@tolusha
Copy link
Contributor

tolusha commented Oct 1, 2021

/retest

@tolusha
Copy link
Contributor

tolusha commented Oct 1, 2021

/retest

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.

6 participants