Skip to content

[WIP] [Attestation-Manager] Adding drain node feature #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

prashant9394
Copy link
Contributor

Merge Checklist

All boxes should be checked before merging the PR

  • The changes in the PR have been built and tested
  • Ready to merge

Description

Fixes # (issue)

Any Newly Introduced Dependencies

How Has This Been Tested?

@lsubash lsubash changed the title [Attestation-Manager] Adding drain node feature [WIP] [Attestation-Manager] Adding drain node feature Apr 22, 2025
// }
config, err := rest.InClusterConfig()
if err != nil {
logging.Error("Error building in-cluster config: %s", err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return false due to error? also after line 46 also

} else {
return true
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete empty line

}
logging.Debug("Node cordoned successfully")
// Sleep for a while before the next attestation check
logging.Debug("Sleeping for 1 minutes and calling drainNode()")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there a need to sleep for 1 minute before draining the node? seems arbitrary

}

func cordonNode(clientset *kubernetes.Clientset, nodeName string) error {
node, err := clientset.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will these context.TODO() be replaced with other more appropriate context to handle cancellations, timeouts, and data passing, etc? It's recommended to never use context.TODO() in production code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants