func (reconciler *FlinkClusterReconciler) Reconcile(
	request ctrl.Request) (ctrl.Result, error) {
	var log = reconciler.Log.WithValues(
		"cluster", request.NamespacedName)
	var handler = FlinkClusterHandler{
		k8sClient: reconciler.Client,
		flinkClient: flinkclient.FlinkClient{
			Log:        log,
			HTTPClient: flinkclient.HTTPClient{Log: log},
		},
		request:  request,
		context:  context.Background(),
		log:      log,
		recorder: reconciler.Mgr.GetEventRecorderFor("FlinkOperator"),
		observed: ObservedClusterState{},
	}
	return handler.reconcile(request)
}
+kubebuilder:rbac:groups=flinkoperator.k8s.io,resources=flinkclusters,verbs=get;list;watch;create;update;patch;delete
+kubebuilder:rbac:groups=flinkoperator.k8s.io,resources=flinkclusters/status,verbs=get;update;patch
+kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete
+kubebuilder:rbac:groups=apps,resources=deployments/status,verbs=get
+kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get;list;watch;create;update;patch;delete
+kubebuilder:rbac:groups=apps,resources=statefulsets/status,verbs=get
+kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;watch
+kubebuilder:rbac:groups=core,resources=pods/status,verbs=get
+kubebuilder:rbac:groups=core,resources=services,verbs=get;list;watch;create;update;patch;delete
+kubebuilder:rbac:groups=core,resources=services/status,verbs=get
+kubebuilder:rbac:groups=core,resources=events,verbs=get;list;watch;create;update;patch;delete
+kubebuilder:rbac:groups=core,resources=events/status,verbs=get
+kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete
+kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete
+kubebuilder:rbac:groups=batch,resources=jobs/status,verbs=get
+kubebuilder:rbac:groups=extensions,resources=ingresses,verbs=get;list;watch;create;update;patch;delete
+kubebuilder:rbac:groups=extensions,resources=ingresses/status,verbs=get
Reconcile the observed state towards the desired state for a FlinkCluster custom resource.
package controllers
import (
	"context"
	"github.com/googlecloudplatform/flink-operator/controllers/history"
	"time"
	"github.com/go-logr/logr"
	v1beta1 "github.com/googlecloudplatform/flink-operator/api/v1beta1"
	"github.com/googlecloudplatform/flink-operator/controllers/flinkclient"
	"github.com/googlecloudplatform/flink-operator/controllers/model"
	appsv1 "k8s.io/api/apps/v1"
	batchv1 "k8s.io/api/batch/v1"
	corev1 "k8s.io/api/core/v1"
	"k8s.io/client-go/tools/record"
	ctrl "sigs.k8s.io/controller-runtime"
	"sigs.k8s.io/controller-runtime/pkg/client"
)
var controllerKind = v1beta1.GroupVersion.WithKind("FlinkCluster")
type FlinkClusterReconciler struct {
	Client client.Client
	Log    logr.Logger
	Mgr    ctrl.Manager
}