Skip to content

Commit d9a591f

Browse files
committed
fix: use non-caching client to get pod in getPodPrivateIP also in EIP controller
1 parent 8c10c8c commit d9a591f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

controllers/eip_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func (r *EIPReconciler) releaseEIP(ctx context.Context, eip *awsv1alpha1.EIP, lo
270270

271271
func (r *EIPReconciler) getPodPrivateIP(ctx context.Context, namespace, podName string) (string, error) {
272272
pod := &corev1.Pod{}
273-
if err := r.Client.Get(ctx, client.ObjectKey{
273+
if err := r.NonCachingClient.Get(ctx, client.ObjectKey{
274274
Namespace: namespace,
275275
Name: podName,
276276
}, pod); err != nil {

main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ func main() {
9191
}
9292

9393
err = (&controllers.EIPReconciler{
94-
Client: cachingClient,
95-
Log: ctrl.Log.WithName("controllers").WithName("EIP"),
96-
EC2: ec2,
94+
Client: cachingClient,
95+
NonCachingClient: nonCachingClient,
96+
Log: ctrl.Log.WithName("controllers").WithName("EIP"),
97+
EC2: ec2,
9798
}).SetupWithManager(mgr)
9899
if err != nil {
99100
setupLog.Error(err, "unable to create controller", "controller", "EIP")

0 commit comments

Comments
 (0)