Skip to content

Block 'run' and 'debug' makefile rules if controller is not scaled to 0 - #883

Merged
amisevsk merged 1 commit into
devfile:mainfrom
amisevsk:block-run-if-not-scaled-down
Jul 4, 2022
Merged

Block 'run' and 'debug' makefile rules if controller is not scaled to 0#883
amisevsk merged 1 commit into
devfile:mainfrom
amisevsk:block-run-if-not-scaled-down

Conversation

@amisevsk

Copy link
Copy Markdown
Collaborator

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 dkwon17July 4, 2022 13:54
@amisevsk
amisevsk requested a review from ibuziuk as a code ownerJuly 4, 2022 13:54

@dkwon17dkwon17 left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown

[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

Details 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:mainJul 4, 2022
@amisevsk
amisevsk deleted the block-run-if-not-scaled-down branch July 4, 2022 19:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@amisevsk@dkwon17