Skip to content

Commit

Permalink
cleanup the k0s join token creation pod after completion (#4091)
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya authored Oct 19, 2023
1 parent 4dbcbd3 commit f977068
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/helmvm/node_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ func runAddNodeCommandPod(ctx context.Context, client kubernetes.Interface, node
return "", fmt.Errorf("failed to get pod logs: %w", err)
}

// delete the completed pod
err = client.CoreV1().Pods("kube-system").Delete(ctx, podName, metav1.DeleteOptions{})
if err != nil {
return "", fmt.Errorf("failed to delete pod: %w", err)
}

// the logs are just a join token, which needs to be added to other things to get a join command
return string(podLogs), nil
}
Expand Down

0 comments on commit f977068

Please sign in to comment.