mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-20 12:14:23 -04:00
This reverts commit 5267ad0f08
.
This commit is contained in:
parent
8f2f8bdbbd
commit
56ab3e9e04
1 changed files with 2 additions and 6 deletions
|
@ -93,7 +93,7 @@ func (r *PendingNodeReconciler) Reconcile(ctx context.Context, req ctrl.Request)
|
||||||
|
|
||||||
if done {
|
if done {
|
||||||
logr.Info("Reached goal", "pendingNodeGoal", pendingNode.Spec.Goal, "cspNodeState", nodeState)
|
logr.Info("Reached goal", "pendingNodeGoal", pendingNode.Spec.Goal, "cspNodeState", nodeState)
|
||||||
if pendingNode.Spec.Goal == updatev1alpha1.NodeGoalLeave || nodeState == updatev1alpha1.NodeStateTerminated {
|
if pendingNode.Spec.Goal == updatev1alpha1.NodeGoalLeave {
|
||||||
// delete self after pending node has been terminated successfully
|
// delete self after pending node has been terminated successfully
|
||||||
if err := r.deletePendingNode(ctx, req.NamespacedName); err != nil {
|
if err := r.deletePendingNode(ctx, req.NamespacedName); err != nil {
|
||||||
return ctrl.Result{}, err
|
return ctrl.Result{}, err
|
||||||
|
@ -213,17 +213,13 @@ func (r *PendingNodeReconciler) findObjectsForNode(ctx context.Context, rawNode
|
||||||
// - joining node: CSP reports the node instance as running and node has joined kubernetes cluster.
|
// - joining node: CSP reports the node instance as running and node has joined kubernetes cluster.
|
||||||
// - leaving node: CSP reports node instance as terminated.
|
// - leaving node: CSP reports node instance as terminated.
|
||||||
func (r *PendingNodeReconciler) reachedGoal(ctx context.Context, pendingNode updatev1alpha1.PendingNode, nodeState updatev1alpha1.CSPNodeState) (bool, error) {
|
func (r *PendingNodeReconciler) reachedGoal(ctx context.Context, pendingNode updatev1alpha1.PendingNode, nodeState updatev1alpha1.CSPNodeState) (bool, error) {
|
||||||
// Always return if the node is terminated so the resource can be cleaned up.
|
|
||||||
if nodeState == updatev1alpha1.NodeStateTerminated {
|
|
||||||
return true, nil
|
|
||||||
}
|
|
||||||
if pendingNode.Spec.Goal == updatev1alpha1.NodeGoalJoin {
|
if pendingNode.Spec.Goal == updatev1alpha1.NodeGoalJoin {
|
||||||
if err := r.Get(ctx, types.NamespacedName{Name: pendingNode.Spec.NodeName}, &corev1.Node{}); err != nil {
|
if err := r.Get(ctx, types.NamespacedName{Name: pendingNode.Spec.NodeName}, &corev1.Node{}); err != nil {
|
||||||
return false, client.IgnoreNotFound(err)
|
return false, client.IgnoreNotFound(err)
|
||||||
}
|
}
|
||||||
return nodeState == updatev1alpha1.NodeStateReady, nil
|
return nodeState == updatev1alpha1.NodeStateReady, nil
|
||||||
}
|
}
|
||||||
return false, nil
|
return nodeState == updatev1alpha1.NodeStateTerminated, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// deletePendingNode deletes a PendingNode resource.
|
// deletePendingNode deletes a PendingNode resource.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue