Kubernetes - Operators and Custom Resources
Given this Operator controller snippet watching a custom resource, what will happen when a new resource instance is created?
func (r *MyOperatorReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
var app MyApp
if err := r.Get(ctx, req.NamespacedName, &app); err != nil {
return ctrl.Result{}, client.IgnoreNotFound(err)
}
// Logic to create or update deployment based on app spec
return ctrl.Result{}, nil
}