Skip to content

Comments

Add imagePullSecrets support to JobConfig for backup and restore jobs#887

Open
shunki-fujita wants to merge 1 commit intomainfrom
issue-848
Open

Add imagePullSecrets support to JobConfig for backup and restore jobs#887
shunki-fujita wants to merge 1 commit intomainfrom
issue-848

Conversation

@shunki-fujita
Copy link
Contributor

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ImagePullSecrets field to JobConfig API type
  • Propagated imagePullSecrets to 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>
@shunki-fujita shunki-fujita marked this pull request as ready for review February 18, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for imagePullSecrets for Backup and Restore

1 participant