Skip to content

Replace watch with builder.ControllerManagedBy #17028

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

Merged
merged 1 commit into from
Mar 27, 2023

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Mar 24, 2023

Description

Switch to a controller to not use the low-level watch abstraction.

A side effect of this change is the reduction in ~20s to add the required node labels

Release Notes

NONE

Build Options:

  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish Options
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer Options
  • with-ee-license
  • with-dedicated-emulation
  • with-ws-manager-mk2
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated

Preview Environment Options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@werft-gitpod-dev-com
Copy link

cannot start job - please talk to whoever's in charge of your Werft installation

@werft-gitpod-dev-com
Copy link

cannot start job - please talk to whoever's in charge of your Werft installation

@aledbf aledbf force-pushed the aledbf/node-labeler-watch branch 6 times, most recently from 27ea764 to 454d502 Compare March 24, 2023 23:43
@roboquat roboquat added size/L and removed size/M labels Mar 25, 2023
@aledbf aledbf force-pushed the aledbf/node-labeler-watch branch from 670308e to 9a6fe23 Compare March 25, 2023 00:17
@aledbf aledbf marked this pull request as ready for review March 25, 2023 00:36
@aledbf aledbf requested a review from a team March 25, 2023 00:36
@github-actions github-actions bot added the team: workspace Issue belongs to the Workspace team label Mar 25, 2023
@aledbf aledbf marked this pull request as draft March 25, 2023 00:42
@aledbf aledbf force-pushed the aledbf/node-labeler-watch branch from d3b0724 to 000da2a Compare March 25, 2023 01:34
err = ctrl.NewControllerManagedBy(mgr).
Named("pod-watcher").
For(&corev1.Pod{}, builder.WithPredicates(filterPredicate)).
WithOptions(controller.Options{MaxConcurrentReconciles: 1}).
Copy link
Member Author

Choose a reason for hiding this comment

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

If we set RequeueAfter with MaxConcurrentReconciles > 1, the retry does not respect the wait time.
Now that we don't sleep in the reconcile loop, setting MaxConcurrentReconciles is not a problem

@aledbf aledbf marked this pull request as ready for review March 25, 2023 01:38
@aledbf aledbf marked this pull request as draft March 25, 2023 10:44
@aledbf aledbf force-pushed the aledbf/node-labeler-watch branch from 42e5c8d to 72c0f31 Compare March 25, 2023 11:18
@@ -258,11 +258,6 @@ func updateLabel(label string, add bool, nodeName string, client client.Client)
return err
}

_, hasLabel := node.Labels[label]
Copy link
Member Author

@aledbf aledbf Mar 25, 2023

Choose a reason for hiding this comment

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

This was not checking the value of the label and the check was done before calling this function

@aledbf aledbf marked this pull request as ready for review March 25, 2023 11:19
@aledbf aledbf force-pushed the aledbf/node-labeler-watch branch from 72c0f31 to 13de063 Compare March 25, 2023 11:21
@aledbf aledbf force-pushed the aledbf/node-labeler-watch branch from ccb426c to 9b199da Compare March 25, 2023 22:43
@roboquat roboquat merged commit 691e856 into main Mar 27, 2023
@roboquat roboquat deleted the aledbf/node-labeler-watch branch March 27, 2023 08:17
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note-none size/L team: workspace Issue belongs to the Workspace team
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants