Closed m-messiah closed 2 years ago
Looks reasonable to me.
@wondywang , can you take a look as well?
/lgtm thanks @m-messiah
@wondywang: changing LGTM is restricted to collaborators
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: christopherhein, m-messiah
The full list of commands accepted by this bot can be found here.
The pull request process is described here
What this PR does / why we need it: The PR converts PodMutators mechanism to Plugins, allowing any additional vc-syncer implementations to easily add their own pod mutator methods. The PR defines a simple mutatorplugin.Interface to implement and converts two existing mutators (ServiceLink and ServiceAccountToken) to plugins. The default pod mutator uses too many controller methods and caches, so it is not worth time to convert it to be a plugin, especially, while we want it to be executed first to be the actual "default". I could try to migrate it as a follow-up if you think it is needed.
I also extended PodMutateCtx to have vPod too, to simplify comparisons and mutations in the future plugins.
Relate: https://github.com/kubernetes-sigs/cluster-api-provider-nested/pull/311#issuecomment-1259073854