Skip to content

Commit 114c81b

Browse files
committed
examples: fix access to reconcile.Request
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
1 parent 15b968c commit 114c81b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/kind/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func main() {
8484

8585
// Retrieve the pod from the cluster.
8686
pod := &corev1.Pod{}
87-
if err := client.Get(ctx, req.NamespacedName, pod); err != nil {
87+
if err := client.Get(ctx, req.Request.NamespacedName, pod); err != nil {
8888
if !apierrors.IsNotFound(err) {
8989
return reconcile.Result{}, err
9090
}

examples/namespace/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ func main() {
139139

140140
// Retrieve the service account from the namespace.
141141
cm := &corev1.ConfigMap{}
142-
if err := client.Get(ctx, req.NamespacedName, cm); err != nil {
142+
if err := client.Get(ctx, req.Request.NamespacedName, cm); err != nil {
143143
return reconcile.Result{}, err
144144
}
145-
log.Info("Reconciling configmap", "cluster", req.ClusterName, "ns", req.Namespace, "name", cm.Name, "uuid", cm.UID)
145+
log.Info("Reconciling configmap", "cluster", req.ClusterName, "ns", req.Request.Namespace, "name", cm.Name, "uuid", cm.UID)
146146

147147
return ctrl.Result{}, nil
148148
},

0 commit comments

Comments
 (0)