Created
November 11, 2021 22:15
-
-
Save nakamasato/5befe621053a29e67ad713686d7b9e12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (r *MemcachedReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { | |
log := r.Log.WithValues("memcached", req.NamespacedName) | |
// 1. Fetch the Memcached instance | |
memcached := &cachev1alpha1.Memcached{} | |
err := r.Get(ctx, req.NamespacedName, memcached) | |
if err != nil { | |
if errors.IsNotFound(err) { | |
log.Info("1. Fetch the Memcached instance. Memcached resource not found. Ignoring since object must be deleted") | |
return ctrl.Result{}, nil | |
} | |
// Error reading the object - requeue the request. | |
log.Error(err, "1. Fetch the Memcached instance. Failed to get Mmecached") | |
return ctrl.Result{}, err | |
} | |
log.Info("1. Fetch the Memcached instance. Memchached resource found", "memcached.Name", memcached.Name, "memcached.Namespace", memcached.Namespace) | |
return ctrl.Result{}, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment