Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 0 additions & 63 deletions bindata/tnfdeployment/cert-watcher-daemonset.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions docs/tnf/job-controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ RunNodeJobController(jobType, node, retries, ...)
│ ├─ Check node readiness via checkNodesReadinessAndSetCondition
│ │ ├─ Not ready < 10min → Return (skip job, retry on next sync)
│ │ ├─ Not ready ≥ 10min → Return error (triggers Degraded via WithSyncDegradedOnError)
│ │ └─ Ready → Clear Degraded condition (if was blocked), continue
│ │ └─ Ready → Continue (Degraded clears naturally when job succeeds/completes)
│ │
│ └─ Create job spec:
│ - Fetch fresh node from informer (handles node replacement)
Expand Down Expand Up @@ -208,11 +208,11 @@ RunClusterJobController(jobType, schedulableNodesFunc, affectedNodesFunc, jobCon
│ │ │
│ │ ├─ Check affectedNodesFunc() → any nodes not ready?
│ │ │ ├─ YES → Return error after 10min (triggers Degraded via WithSyncDegradedOnError)
│ │ │ └─ NO → Clear Degraded condition (if was blocked), continue
│ │ │ └─ NO → Continue (Degraded clears naturally when job succeeds/completes)
│ │ │
│ │ ├─ Check schedulableNodesFunc() → any nodes available?
│ │ │ ├─ NO → Return error after 10min (triggers Degraded via WithSyncDegradedOnError)
│ │ │ └─ YES → Clear Degraded condition (if was blocked), continue
│ │ │ └─ YES → Continue (Degraded clears naturally when job succeeds/completes)
│ │ │
│ │ ├─ Get or initialize retry state (AttemptNumber, NodeIndex, config)
│ │ │
Expand All @@ -224,12 +224,12 @@ RunClusterJobController(jobType, schedulableNodesFunc, affectedNodesFunc, jobCon
│ │ │
│ │ ├─ Get current job from cluster
│ │ │ │
│ │ │ ├─ Complete? → Clear degraded, preserve state, return
│ │ │ ├─ Complete? → Return success (Degraded clears naturally via syncManaged flow)
│ │ │ │
│ │ │ └─ Failed?
│ │ │ ├─ Move to next node (NodeIndex++)
│ │ │ ├─ All nodes tried? → Increment attempt (AttemptNumber++)
│ │ │ ├─ Max attempts exhausted? → Set Degraded, reset to attempt 1
│ │ │ ├─ Max attempts exhausted? → Return error (triggers Degraded via WithSyncDegradedOnError), reset to attempt 1
│ │ │ └─ Update retry state (ApplyJob will detect retry field drift and delete/recreate)
│ │ │
│ │ └─ ApplyJob detects drift (NodeName, node-index, or attempt labels changed) → Deletes and recreates job
Expand Down
5 changes: 4 additions & 1 deletion docs/tnf/lifecycle-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ startJobControllers()
└─ YES (Runtime Mode):
├─ Ensure auth/after-setup controllers running (per-node)
├─ Ensure setup job controller running (maintains conditions)
├─ Ensure update-setup controller running (if 2 nodes)
└─ Ensure fencing controller running (cluster-wide)
├─ Ensure fencing controller running (cluster-wide)
├─ Start status collector CronJob
└─ Start Pacemaker health check controller
```

See [Job Controllers](job-controllers.md) for details on job execution patterns and retry logic.
Expand Down
6 changes: 6 additions & 0 deletions pkg/tnf/operator/cert_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -38,6 +39,11 @@ func (c *pacemakerLifecycleManager) ensureCertWatcherDaemonSet(ctx context.Conte
return fmt.Errorf("failed to get cert-watcher DaemonSet: %w", err)
}

if equality.Semantic.DeepEqual(existing.Spec.Template, desired.Spec.Template) {
// Already in the desired state; avoid a no-op write and log churn on every sync.
return nil
}

existing.Spec.Template = desired.Spec.Template
klog.Infof("Updating cert-watcher DaemonSet")
_, err = c.kubeClient.AppsV1().DaemonSets(operatorclient.TargetNamespace).Update(ctx, existing, metav1.UpdateOptions{})
Expand Down
Loading