Skip to content
Merged
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
2 changes: 1 addition & 1 deletion operator/internal/controller/pod_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (r *SkyhookReconciler) UpdateNodeState(ctx context.Context, pod *corev1.Pod
return true, fmt.Errorf("error updating node with state from pod: %w", err)
}

r.recorder.Eventf(&node, nil, EventTypeNormal, EventsReasonSkyhookApply, "UpdateNodeState", "Package [%s:%s] state %s on [skyhook:%s]", packagePtr.Name, packagePtr.Version, state, packagePtr.Skyhook)
r.recorder.Eventf(&node, nil, EventTypeNormal, EventsReasonSkyhookApply, "UpdateNodeState", "Package [%s:%s] state %s on [nodewright:%s]", packagePtr.Name, packagePtr.Version, state, packagePtr.Skyhook)
}

return false, nil
Expand Down
26 changes: 13 additions & 13 deletions operator/internal/controller/skyhook_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ func (r *SkyhookReconciler) SaveNodesAndSkyhook(ctx context.Context, clusterStat
}

if node.IsComplete() {
r.recorder.Eventf(node.GetNode(), nil, EventTypeNormal, EventsReasonSkyhookStateChange, "MarkComplete", "Skyhook [%s] complete.", skyhook.GetSkyhook().Name)
r.recorder.Eventf(node.GetNode(), nil, EventTypeNormal, EventsReasonSkyhookStateChange, "MarkComplete", "NodeWright [%s] complete.", skyhook.GetSkyhook().Name)

// since node is complete remove from priority
skyhook.GetSkyhook().RemoveNodePriority(node.GetNode().Name)
Expand Down Expand Up @@ -1253,7 +1253,7 @@ func (r *SkyhookReconciler) SaveNodesAndSkyhook(ctx context.Context, clusterStat

if skyhook.GetPriorStatus() != "" && skyhook.GetPriorStatus() != skyhook.Status() {
// we transitioned, fire event
r.recorder.Eventf(skyhook.GetSkyhook(), nil, EventTypeNormal, EventsReasonSkyhookStateChange, "Transition", "Skyhook transitioned [%s] -> [%s]", skyhook.GetPriorStatus(), skyhook.Status())
r.recorder.Eventf(skyhook.GetSkyhook(), nil, EventTypeNormal, EventsReasonSkyhookStateChange, "Transition", "NodeWright transitioned [%s] -> [%s]", skyhook.GetPriorStatus(), skyhook.Status())
}
}

Expand Down Expand Up @@ -1903,7 +1903,7 @@ func (r *SkyhookReconciler) HandleFinalizer(ctx context.Context, skyhook Skyhook
ObservedGeneration: skyhook.GetSkyhook().Generation,
LastTransitionTime: metav1.Now(),
Reason: "MalformedNodeState",
Message: "Cannot safely delete Skyhook: malformed nodeState on one or more nodes. " +
Message: "Cannot safely delete NodeWright: malformed nodeState on one or more nodes. " +
"Repair the nodeState annotation before deletion.",
})
r.recorder.Eventf(
Expand All @@ -1912,7 +1912,7 @@ func (r *SkyhookReconciler) HandleFinalizer(ctx context.Context, skyhook Skyhook
corev1.EventTypeWarning,
"DeletionBlocked",
"BlockDelete",
"Cannot delete Skyhook %s: malformed nodeState. Repair and retry.",
"Cannot delete NodeWright %s: malformed nodeState. Repair and retry.",
skyhook.GetSkyhook().Name,
)
if _, errs := r.SaveNodesAndSkyhook(ctx, clusterState, skyhook); len(errs) > 0 {
Expand All @@ -1931,7 +1931,7 @@ func (r *SkyhookReconciler) HandleFinalizer(ctx context.Context, skyhook Skyhook
ObservedGeneration: skyhook.GetSkyhook().Generation,
LastTransitionTime: metav1.Now(),
Reason: "PausedWithPendingUninstall",
Message: "Skyhook is paused with uninstall-enabled packages still tracked in nodeState. " +
Message: "NodeWright is paused with uninstall-enabled packages still tracked in nodeState. " +
"Unpause to let uninstall complete before deletion.",
})
r.recorder.Eventf(
Expand All @@ -1940,7 +1940,7 @@ func (r *SkyhookReconciler) HandleFinalizer(ctx context.Context, skyhook Skyhook
corev1.EventTypeWarning,
"DeletionBlocked",
"BlockDelete",
"Cannot delete Skyhook %s: paused with uninstall work pending. Unpause to proceed.",
"Cannot delete NodeWright %s: paused with uninstall work pending. Unpause to proceed.",
skyhook.GetSkyhook().Name,
)
if _, errs := r.SaveNodesAndSkyhook(ctx, clusterState, skyhook); len(errs) > 0 {
Expand All @@ -1962,16 +1962,16 @@ func (r *SkyhookReconciler) HandleFinalizer(ctx context.Context, skyhook Skyhook
ObservedGeneration: skyhook.GetSkyhook().Generation,
LastTransitionTime: metav1.Now(),
Reason: "DisabledWithPendingUninstall",
Message: "Skyhook is disabled with uninstall-enabled packages still tracked in nodeState. " +
"Re-enable the Skyhook to let uninstall complete before deletion.",
Message: "NodeWright is disabled with uninstall-enabled packages still tracked in nodeState. " +
"Re-enable the NodeWright to let uninstall complete before deletion.",
})
r.recorder.Eventf(
skyhook.GetSkyhook().NodeWright,
nil,
corev1.EventTypeWarning,
"DeletionBlocked",
"BlockDelete",
"Cannot delete Skyhook %s: disabled with uninstall work pending. Re-enable to proceed.",
"Cannot delete NodeWright %s: disabled with uninstall work pending. Re-enable to proceed.",
skyhook.GetSkyhook().Name,
)
if _, errs := r.SaveNodesAndSkyhook(ctx, clusterState, skyhook); len(errs) > 0 {
Expand Down Expand Up @@ -2113,7 +2113,7 @@ func (r *SkyhookReconciler) DrainNode(ctx context.Context, skyhookNode wrapper.S
skyhookNode.SetStatus(v1alpha1.StatusInProgress)
} else if drainConfig != nil && drain.TimedOut(drainStartedAt, drainConfig.Timeout, now.Time) {
r.recorder.Eventf(skyhookNode.GetNode(), nil, corev1.EventTypeWarning, EventsReasonSkyhookDrain, "DrainTimeout",
"drain timed out after [%s] for node [%s] package [%s:%s] from [skyhook:%s]",
"drain timed out after [%s] for node [%s] package [%s:%s] from [nodewright:%s]",
drainConfig.Timeout.Duration,
skyhookNode.GetNode().Name,
_package.Name,
Expand Down Expand Up @@ -2143,7 +2143,7 @@ func (r *SkyhookReconciler) DrainNode(ctx context.Context, skyhookNode wrapper.S
}

r.recorder.Eventf(skyhookNode.GetNode(), nil, EventTypeNormal, EventsReasonSkyhookDrain, "DrainNode",
"draining node [%s] package [%s:%s] from [skyhook:%s]",
"draining node [%s] package [%s:%s] from [nodewright:%s]",
skyhookNode.GetNode().Name,
_package.Name,
_package.Version,
Expand Down Expand Up @@ -2231,7 +2231,7 @@ func (r *SkyhookReconciler) Interrupt(ctx context.Context, skyhookNode wrapper.S
_ = skyhookNode.Upsert(_package.PackageRef, _package.Image, v1alpha1.StateInProgress, stage, 0, _package.ContainerSHA)

r.recorder.Eventf(skyhookNode.GetSkyhook().NodeWright, nil, EventTypeNormal, EventsReasonSkyhookInterrupt, "InterruptNode",
"Interrupting node [%s] package [%s:%s] from [skyhook:%s]",
"Interrupting node [%s] package [%s:%s] from [nodewright:%s]",
skyhookNode.GetNode().Name,
_package.Name,
_package.Version,
Expand Down Expand Up @@ -3229,7 +3229,7 @@ func (r *SkyhookReconciler) ApplyPackage(ctx context.Context, logger logr.Logger
Message: fmt.Sprintf("Applying package [%s:%s] to node [%s]", _package.Name, _package.Version, skyhookNode.GetNode().Name),
})

r.recorder.Eventf(skyhookNode.GetNode(), nil, EventTypeNormal, EventsReasonSkyhookApply, "ApplyPackage", "Applying package [%s:%s] from [skyhook:%s] stage [%s]", _package.Name, _package.Version, skyhookNode.GetSkyhook().Name, stage)
r.recorder.Eventf(skyhookNode.GetNode(), nil, EventTypeNormal, EventsReasonSkyhookApply, "ApplyPackage", "Applying package [%s:%s] from [nodewright:%s] stage [%s]", _package.Name, _package.Version, skyhookNode.GetSkyhook().Name, stage)
r.recorder.Eventf(skyhookNode.GetSkyhook(), nil, EventTypeNormal, EventsReasonSkyhookApply, "ApplyPackage", "Applying package [%s:%s] to node [%s] stage [%s]", _package.Name, _package.Version, skyhookNode.GetNode().Name, stage)

skyhookNode.GetSkyhook().Updated = true
Expand Down
2 changes: 1 addition & 1 deletion operator/internal/controller/skyhook_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ var _ = Describe("skyhook controller tests", func() {
Expect(err).ToNot(HaveOccurred())
Expect(drained).To(BeFalse())
Expect(skyhookNode.Status()).To(Equal(v1alpha1.StatusErroring))
Eventually(recorder.Events).Should(Receive(ContainSubstring("Warning Drain drain timed out after [1s] for node [node-a] package [pkg:1.0.0] from [skyhook:drain-timeout]")))
Eventually(recorder.Events).Should(Receive(ContainSubstring("Warning Drain drain timed out after [1s] for node [node-a] package [pkg:1.0.0] from [nodewright:drain-timeout]")))
Eventually(recorder.Events).Should(Receive(ContainSubstring("Warning Drain drain timed out after [1s] for node [node-a] package [pkg:1.0.0]")))
})
})
Expand Down
4 changes: 2 additions & 2 deletions operator/internal/wrapper/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ func (node *skyhookNode) UpdateCondition() {
LastHeartbeatTime: metav1.Now(),
LastTransitionTime: metav1.Now(),
Reason: readyReason,
Message: fmt.Sprintf("Skyhook %s Ready", node.skyhookName),
Message: fmt.Sprintf("NodeWright %s Ready", node.skyhookName),
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}

errorCond := corev1.NodeCondition{
Expand All @@ -677,7 +677,7 @@ func (node *skyhookNode) UpdateCondition() {
}
case cond.Type:
condFound = true
if condition.Reason != cond.Reason && condition.Message == cond.Message {
if condition.Reason != cond.Reason || condition.Message != cond.Message {
node.Node.Status.Conditions[i] = cond // update it with the new condition
node.updated = true
}
Expand Down
Loading