Skip to content

Commit

Permalink
Merge pull request #123 from JoelSpeed/fix-delegating-client
Browse files Browse the repository at this point in the history
Bug 1956609: Use a direct client for uncached reads
  • Loading branch information
openshift-merge-robot committed Jun 12, 2021
2 parents d183efc + 04a29d7 commit 724abd2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion main.go
Expand Up @@ -80,11 +80,18 @@ func main() {
klog.Fatal("unable to add Machines to scheme")
}

directClient, err := client.New(mgr.GetConfig(), client.Options{
Scheme: mgr.GetScheme(),
Mapper: mgr.GetRESTMapper(),
})
if err != nil {
klog.Fatal("unable to set up client")
}
// Prevent the controller from caching node and machine objects.
// Stale nodes and machines can cause the approver to not approve certificates
// within a timely manner, leading to failed node bootstraps.
approverClient, err := client.NewDelegatingClient(client.NewDelegatingClientInput{
Client: mgr.GetClient(),
Client: directClient,
CacheReader: mgr.GetClient(),
UncachedObjects: []client.Object{
&machinev1.Machine{},
Expand Down

0 comments on commit 724abd2

Please sign in to comment.