Description
What do you want to happen?
This issue proposes refactoring the CronJob and MultiVersion samples to follow the structure and best practices introduced by the DeployImage
plugin, which includes scaffolding to manage resources defined via command-line inputs, such as images.
Objectives
The main goals for this refactoring include ensure:
- Align the structure of the
CronJob
andMultiVersion
examples with the scaffolded layout used by theDeployImage
plugin. - Apply best practices, such as fetching the resource before updates, to prevent reconciliation conflicts due to intermediate changes.
- Integrate status conditions to better track resource states. (see that we have indeed a task for that: Update Cronjob and Multiversion Tutorials samples to Use Status Conditions #4019)
- Ensure that test implementations mirror the
DeployImage
scaffolded layout, with comprehensive tests for the controller logic.(see that we have indeed a task for that: Review and Improve Test Coverage and Alignment for Controller Tests in CronJob Tutorial #4140) - Retain the original logic and functionality of the
CronJob
andMultiVersion
examples. - Preserve the existing markers to ensure that documentation snippets are generated and rendered consistently in the docs.
Reference Materials
To align with DeployImage
scaffolding, please review the following examples:
- Controller Implementation: busybox_controller.go
- Controller Test: busybox_controller_test.go
Additional Notes
All sample updates should be implemented to ensure they match the DeployImage
plugin’s scaffold structure and best practices, while still fulfilling the unique requirements of each sample (i.e., CronJob
and MultiVersion
functionality).
Related tasks:
- Update Cronjob and Multiversion Tutorials samples to Use Status Conditions #4019
- Review and Improve Test Coverage and Alignment for Controller Tests in CronJob Tutorial #4140
Example of Motivation: #4290
Updating the Documentation Samples
Please note that these sample files are auto-generated for the documentation. Any changes made to these samples will be reflected in the documentation only when running make generate-docs
.
The sample generation process is managed through:
- Makefile configuration: See Makefile#L82-L84.
- Documentation generation scripts: Updates should be made within
Note: We can approach this refactoring with multiple smaller PRs or a single comprehensive one. For example, we could start by adding Status Conditions, then improve the tests, and so on.
Extra Labels
No response