-
Notifications
You must be signed in to change notification settings - Fork 307
Implement KubectlRollout with generic type parameters for deployment lifecycle management #1700
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
base: master
Are you sure you want to change the base?
Conversation
…, pause, and resume methods Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Copilot The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
|
@copilot please update this PR to use a single method signature with different typed parameters instead of a separate method name for Deployments, StatefulSets, etc. |
Changed API from separate methods per resource type to generic methods:
- RolloutRestart<T>, RolloutStatus<T>, RolloutHistory<T>
- RolloutPause<T>, RolloutResume<T>, RolloutUndo<T>
Usage example:
kubectl.RolloutRestart<V1Deployment>("my-app", "production");
kubectl.RolloutStatus<V1DaemonSet>("my-daemon", "default");
This provides a cleaner API that follows the pattern used by Get<T> and List<T>.
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
Done! Refactored to use generic type parameters instead of separate method names. The new API follows the same pattern as Get and List: kubectl.RolloutRestart<V1Deployment>("my-app", "production");
kubectl.RolloutStatus<V1DaemonSet>("my-daemon", "default");
kubectl.RolloutHistory<V1StatefulSet>("my-sts", "default");Changes in commit f820e76. |
Adds kubectl rollout operations to match Java client and kubectl CLI functionality for managing deployment, daemonset, and statefulset rollouts.
Implementation
Core operations (
AsyncKubectl.Rollout.cs):RolloutRestartAsync<T>- triggers rollout via restart annotation (supports V1Deployment, V1DaemonSet, V1StatefulSet)RolloutStatusAsync<T>- returns detailed rollout progress status for all workload typesRolloutHistoryAsync<T>- retrieves revision history with change-cause annotationsRolloutUndoAsync<T>- rolls back to specified or previous revision (Deployment only)RolloutPauseAsync<T>/RolloutResumeAsync<T>- controls deployment rollouts (Deployment only)Synchronous wrappers (
Kubectl.Rollout.cs):Tests (
KubectlTests.Rollout.cs):API Design
The API uses generic type parameters following the same pattern as existing
Get<T>andList<T>methods, providing a clean and consistent interface:Technical Details
RestartedAtAnnotation,RevisionAnnotation,ChangeCauseAnnotation)Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.