Add imagePullSecrets support to JobConfig for backup and restore jobs#887
Open
shunki-fujita wants to merge 1 commit intomainfrom
Open
Add imagePullSecrets support to JobConfig for backup and restore jobs#887shunki-fujita wants to merge 1 commit intomainfrom
shunki-fujita wants to merge 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for imagePullSecrets to the JobConfig specification, enabling users with private container registries to authenticate when pulling backup and restore images. This addresses issue #848, which requested this feature to avoid manual patching of CronJobs and Jobs created by the MOCO operator.
Changes:
- Added
ImagePullSecretsfield toJobConfigAPI type - Propagated
imagePullSecretsto both backup CronJob and restore Job PodSpecs in the controller - Updated CRD definitions for MySQLCluster and BackupPolicy resources
- Added comprehensive test coverage for both backup and restore scenarios
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| api/v1beta2/job_types.go | Added ImagePullSecrets field to JobConfig struct and implemented LocalObjectReferenceApplyConfiguration type with DeepCopy method; also fixed comment on line 218 |
| api/v1beta2/zz_generated.deepcopy.go | Auto-generated DeepCopy methods for ImagePullSecrets field and LocalObjectReferenceApplyConfiguration type |
| controllers/mysqlcluster_controller.go | Added WithImagePullSecrets calls to both backup CronJob and restore Job PodSpec construction, following established patterns for slice conversion |
| controllers/mysqlcluster_controller_test.go | Added test data for imagePullSecrets and assertions to verify proper propagation in both backup and restore scenarios |
| config/crd/bases/moco.cybozu.com_mysqlclusters.yaml | Added CRD schema for imagePullSecrets field in MySQLCluster JobConfig |
| config/crd/bases/moco.cybozu.com_backuppolicies.yaml | Added CRD schema for imagePullSecrets field in BackupPolicy JobConfig |
| config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_mysqlclusters.moco.cybozu.com.yaml | Test CRD updated with imagePullSecrets schema |
| config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_backuppolicies.moco.cybozu.com.yaml | Test CRD updated with imagePullSecrets schema |
| charts/moco/templates/generated/crds/moco_crds.yaml | Helm chart CRD updated with imagePullSecrets schema for both MySQLCluster and BackupPolicy |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Users with private container registries can now specify imagePullSecrets in JobConfig, which is propagated to both backup CronJob and restore Job PodSpecs. This enables pulling backup/restore images from authenticated registries without manual intervention. Signed-off-by: shunki-fujita <shunki-fujita@cybozu.co.jp>
2065254 to
b2a141e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close: #848
Users with private container registries can now specify imagePullSecrets in JobConfig, which is propagated to both backup CronJob and restore Job PodSpecs. This enables pulling backup/restore images from authenticated registries without manual intervention.