func (r *MysqlReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
	_ = r.Log.WithValues("mysql", req.NamespacedName)

	// your logic here

	// Fetch the MySQL CR's yaml data.

	// First, create an empty variable that will hold the MySQL CR's yaml data
	instance := &cachev1alpha1.Mysql{}

	// Second, use the Client.Get method to populate the 'instance' variable
	err := r.Client.Get(context.TODO(), req.NamespacedName, instance)
	if err != nil {
		if errors.IsNotFound(err) {
			// Request object not found, could have been deleted after reconcile request.
			// Owned objects are automatically garbage collected. For additional cleanup logic use finalizers.
			// Return and don't requeue
			return reconcile.Result{}, nil
		}
		// Error reading the object - requeue the request.
		return reconcile.Result{}, err
	}
	// debugging: this should print out the mysql CR's yaml data:
	fmt.Println("mysql cr data:")
	fmt.Println(instance)

	// Define a new Pod object. This is the equivalent of writing a pod yaml file, but not applying it yet.
	var mysql_pod = pod.MysqlPodDef
	pod := mysql_pod(instance)

	// debugging: this should print out the mysql pod def that we're going to build:
	fmt.Println("New pod definition that will be used to create a new pod:")
	fmt.Println(pod)

	return ctrl.Result{}, nil
}
// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
// TODO(user): Modify the Reconcile function to compare the state specified by
// the Mysql object against the actual cluster state, and then
// perform operations to make the cluster state reflect the state specified by
// the user.
//
// For more details, check Reconcile and its Result here:
// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.7.0/pkg/reconcile
Reconcile is part of the main kubernetes reconciliation loop which aims to
move the current state of the cluster closer to the desired state.
TODO(user): Modify the Reconcile function to compare the state specified by
the Mysql object against the actual cluster state, and then
perform operations to make the cluster state reflect the state specified by
the user.


// Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state . // TODO ( user ) : Modify the Reconcile function to compare the state specified by // the Mysql object against the actual cluster state and then // perform operations to make the cluster state reflect the state specified by // the user . // // For more details check Reconcile and its Result here : // - https : // pkg . go . dev / sigs . k8s . io / controller - runtime@v0 . 7 . 0 / pkg / reconcile
func (r *MysqlReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
	_ = r.Log.WithValues("mysql", req.NamespacedName)
	instance := &cachev1alpha1.Mysql{}
	err := r.Client.Get(context.TODO(), req.NamespacedName, instance)
	if err != nil {
		if errors.IsNotFound(err) {
			return reconcile.Result{}, nil
		}
		return reconcile.Result{}, err
	}
	fmt.Println("mysql cr data:")
	fmt.Println(instance)
	var mysql_pod = pod.MysqlPodDef
	pod := mysql_pod(instance)
	fmt.Println("New pod definition that will be used to create a new pod:")
	fmt.Println(pod)
	return ctrl.Result{}, nil
}
func ( r * MysqlReconciler ) Reconcile ( ctx context . Context , req ctrl . Request ) ( ctrl . Result , error ) { _ = r . Log . WithValues ( " " , req . NamespacedName ) instance := & cachev1alpha1 . Mysql { } err := r . Client . Get ( context . TODO ( ) , req . NamespacedName , instance ) if err != nil { if errors . IsNotFound ( err ) { return reconcile . Result { } , nil } return reconcile . Result { } , err } fmt . Println ( " " ) fmt . Println ( instance ) var mysql_pod = pod . MysqlPodDef pod := mysql_pod ( instance ) fmt . Println ( " " ) fmt . Println ( pod ) return ctrl . Result { } , nil }
Reconcile is part of the main kubernetes reconciliation loop which aims to
move the current state of the cluster closer to the desired state.
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state .
// your logic here // Fetch the MySQL CR's yaml data. // First, create an empty variable that will hold the MySQL CR's yaml data // Second, use the Client.Get method to populate the 'instance' variable // Request object not found, could have been deleted after reconcile request. // Owned objects are automatically garbage collected. For additional cleanup logic use finalizers. // Return and don't requeue // Error reading the object - requeue the request. // debugging: this should print out the mysql CR's yaml data: // Define a new Pod object. This is the equivalent of writing a pod yaml file, but not applying it yet. // debugging: this should print out the mysql pod def that we're going to build: