Skip to content

Conversation

amisevsk
Copy link
Collaborator

@amisevsk amisevsk commented Jul 4, 2022

What does this PR do?

Blocks using make run and make debug if the controller is still running in cluster.

What issues does this PR fix or reference?

Avoids issues like #879 (comment)

Is it tested? How?

  1. Install controller to cluster normally (make install)
  2. Attempt make run and make debug commands. Should exit with
    Controller is already running in cluster, cannot run locally. Scale controller to 0 first.
    make: *** [build/make/deploy.mk:71: _check_controller_running] Error 1
    
  3. Scale controller to zero pods: oc scale deploy devworkspace-controller-manager -n $NAMESPACE --replicas=0
  4. Verify that make run and make debug work as normal.

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

In order to prevent potentially confusing errors, block running the
controller locally if the in-cluster deployment is not scaled to 0. This
is necessary as running two instances of the controller can result in
conflicting reconcile outputs, causing each instance to compete against
the other.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
@amisevsk amisevsk requested review from AObuchow and dkwon17 July 4, 2022 13:54
@amisevsk amisevsk requested a review from ibuziuk as a code owner July 4, 2022 13:54
@openshift-ci openshift-ci bot added the approved label Jul 4, 2022
Copy link
Collaborator

@dkwon17 dkwon17 left a comment

Choose a reason for hiding this comment

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

Working as expected 👍

@openshift-ci
Copy link

openshift-ci bot commented Jul 4, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amisevsk, dkwon17

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

@amisevsk amisevsk merged commit 3d892a0 into devfile:main Jul 4, 2022
@amisevsk amisevsk deleted the block-run-if-not-scaled-down branch July 4, 2022 19:21
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