savegame controllers
This commit is contained in:
@@ -19,6 +19,7 @@ package controller
|
||||
import (
|
||||
"context"
|
||||
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
ctrl "sigs.k8s.io/controller-runtime"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
@@ -47,7 +48,29 @@ type TDSetReconciler struct {
|
||||
// For more details, check Reconcile and its Result here:
|
||||
// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.21.0/pkg/reconcile
|
||||
func (r *TDSetReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
|
||||
_ = logf.FromContext(ctx)
|
||||
log := logf.FromContext(ctx)
|
||||
|
||||
log.Info("starting reconciliation of TDSet")
|
||||
|
||||
tdSet := &schedulev1.TDSet{}
|
||||
|
||||
err := r.GetTDSet(ctx, req, tdSet)
|
||||
if err != nil {
|
||||
if apierrors.IsNotFound(err) {
|
||||
log.Info("TDSet resource not found. Ignoring since object must be deleted")
|
||||
return ctrl.Result{}, nil
|
||||
}
|
||||
log.Error(err, "unable to fetch TDSet")
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
|
||||
// set condition status
|
||||
err = r.SetInitialCondition(ctx, req, tdSet)
|
||||
|
||||
if err != nil {
|
||||
log.Error(err, "unable to set initial condition for TDSet")
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
|
||||
// TODO(user): your logic here
|
||||
|
||||
|
||||
Reference in New Issue
Block a user