-
Notifications
You must be signed in to change notification settings - Fork 3
feat(cli): Add lifecycle management commands (pause, resume, disable, enable) #127
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
Conversation
| - script: | ||
| timeout: 30s | ||
| content: | | ||
| echo "Waiting for Skyhook to be created..." | ||
| for i in $(seq 1 15); do | ||
| if kubectl get skyhook cli-lifecycle-test 2>/dev/null; then | ||
| echo "Skyhook created" | ||
| exit 0 | ||
| fi | ||
| sleep 2 | ||
| done | ||
| echo "Timeout waiting for Skyhook" | ||
| exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - script: | ||
| timeout: 60s | ||
| content: | | ||
| NODE=$(kubectl get nodes -l skyhook.nvidia.com/test-node=skyhooke2e -o jsonpath='{.items[0].metadata.name}') | ||
| echo "Waiting for Skyhook activity on node $NODE..." | ||
| for i in $(seq 1 30); do | ||
| ANNOTATION=$(kubectl get node "$NODE" -o jsonpath='{.metadata.annotations.skyhook\.nvidia\.com/nodeState_cli-node-test}' 2>/dev/null) | ||
| if [ -n "$ANNOTATION" ]; then | ||
| echo "Skyhook activity detected" | ||
| exit 0 | ||
| fi | ||
| sleep 2 | ||
| done | ||
| echo "Timeout waiting for activity" | ||
| exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before
| - script: | ||
| timeout: 60s | ||
| content: | | ||
| NODE=$(kubectl get nodes -l skyhook.nvidia.com/test-node=skyhooke2e -o jsonpath='{.items[0].metadata.name}') | ||
| echo "Waiting for Skyhook activity on node $NODE..." | ||
| for i in $(seq 1 30); do | ||
| ANNOTATION=$(kubectl get node "$NODE" -o jsonpath='{.metadata.annotations.skyhook\.nvidia\.com/nodeState_cli-package-test}' 2>/dev/null) | ||
| if [ -n "$ANNOTATION" ]; then | ||
| echo "Skyhook activity detected" | ||
| exit 0 | ||
| fi | ||
| sleep 2 | ||
| done | ||
| echo "Timeout waiting for activity" | ||
| exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
| delete(node.Labels, v1alpha1.NodeIgnoreLabel) | ||
| } | ||
|
|
||
| _, err := kubeClient.Kubernetes().CoreV1().Nodes().Update(ctx, node, metav1.UpdateOptions{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should do a patch for this change.
| // Remove the Skyhook annotation | ||
| delete(node.Annotations, annotationKey) | ||
|
|
||
| _, err := kubeClient.Kubernetes().CoreV1().Nodes().Update(ctx, node, metav1.UpdateOptions{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do a merge for this as well. merge is more efficient.
* feat(cli): Add node management commands and ignore label support * feat: Consolidate CLI e2e tests with proper assertions and CI integration * feat(cli): Add lifecycle management commands (pause, resume, disable, enable) (#127) * feat(cli): Add lifecycle management commands (pause, resume, disable, enable) * update k8s tests * change to patch
* feat(cli): Add node management commands and ignore label support * feat: Consolidate CLI e2e tests with proper assertions and CI integration * feat(cli): Add lifecycle management commands (pause, resume, disable, enable) (#127) * feat(cli): Add lifecycle management commands (pause, resume, disable, enable) * update k8s tests * change to patch
Summary
Adds CLI commands to control Skyhook lifecycle via annotations:
skyhook pause <name>- Stops processing new nodes (setsskyhook.nvidia.com/pause)skyhook resume <name>- Resumes a paused Skyhookskyhook disable <name>- Completely disables a Skyhook (setsskyhook.nvidia.com/disable)skyhook enable <name>- Re-enables a disabled SkyhookChanges
operator/internal/cli/utils/utils.gok8s-tests/chainsaw/cli/lifecycle/