savegame controllers
Some checks failed
Lint / Run on Ubuntu (push) Has been cancelled
E2E Tests / Run on Ubuntu (push) Has been cancelled
Tests / Run on Ubuntu (push) Has been cancelled

This commit is contained in:
baschno
2026-01-13 20:57:27 +01:00
parent b07ab65fce
commit 207dd63421
2 changed files with 93 additions and 1 deletions

View File

@@ -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