Conversation
tsaishawn
commented
Mar 11, 2026
- Add deployment mount path
- Add CronJob workload
- Add Job workload
1. Add deployment mount path 2. Add CronJob workload 3. Add Job workload
There was a problem hiding this comment.
Pull request overview
Adds support for additional workload types and deployment storage configuration in the workload-operator’s Application controller, expanding beyond Deployment-only reconciliation.
Changes:
- Introduces CronJob and Job workload reconciliation paths, including status observation and transition cleanup.
- Moves Deployment-related config (Deployment/Service/PVC + MountPath) under
spec.deploymentConfigand injects PVC volume mounts into Deployments. - Updates controller tests and RBAC to cover/manage the new resources.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/controller/application_controller.go | Adds workload-type dispatch, cleanup on transitions, status observation for CronJob/Job, and watches/RBAC annotations. |
| internal/controller/application_controller_test.go | Updates tests for deploymentConfig and adds CronJob/Job workload test coverage. |
| internal/application/deployment.go | Reads Deployment from deploymentConfig and injects PVC volume mounts; adds deployment cleanup. |
| internal/application/service.go | Reads Service from deploymentConfig, preserves ClusterIP/NodePorts, and adds service cleanup. |
| internal/application/pvc.go | Reads PVC from deploymentConfig and adds PVC cleanup. |
| internal/application/cronjob.go | Adds CronJob reconcile + cleanup implementation. |
| internal/application/job.go | Adds Job reconcile + cleanup implementation (spec set only on create). |
| internal/application/helpers.go | Removes unused condition constant. |
| config/rbac/role.yaml | Grants controller permissions for batch CronJobs and Jobs. |
| go.mod / go.sum | Bumps github.com/otterscale/api dependency to include new API fields/types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the application's capabilities by expanding the types of workloads it can manage. It introduces support for Kubernetes CronJobs and Jobs, alongside the existing Deployment functionality. The changes also include a structural refactor of deployment-related configurations, improving how persistent storage is integrated, and ensuring that the system intelligently manages and cleans up resources when an application's workload type changes. This provides greater flexibility in defining and operating diverse application patterns. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces significant enhancements by adding support for CronJob and Job workloads, alongside the existing Deployment workload. The changes are well-structured, including the necessary RBAC updates, API dependency changes, and extensive refactoring of the main controller logic to handle different workload types and their cleanup during transitions. The tests have also been expanded to cover these new features. My review focuses on improving maintainability by reducing code duplication in a few areas.