kubernetes-sigs / cli-utils

This repo contains binaries that built from libraries in cli-runtime.
Apache License 2.0
155 stars 77 forks source link

Allow to pass watcher strategy #617

Closed ash2k closed 1 year ago

ash2k commented 1 year ago

Currently strategy is not specified and is always RESTScopeAutomatic. I have a case where I need to set it to RESTScopeNamespace, but there is no way to set it. This PR exposes an option to make it possible.

See https://github.com/kubernetes-sigs/cli-utils/pull/572#issuecomment-1111604485 and the following conversation for the background.

ash2k commented 1 year ago

/retest

ash2k commented 1 year ago

@karlkfi @seans3 @mortent PTAL

k8s-ci-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ash2k, seans3

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/cli-utils/blob/master/OWNERS)~~ [seans3] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
karlkfi commented 1 year ago

I probably would have suggested dropping the Watcher- prefix and just making it the scope for the whole Applier/Destroyer. Then make a new higher level scope enum and translate it into the watch enum as needed. Then we could add some up front validation to validate scope.