Skip to content
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

Merge CRD objects into each other #1107

Open
TrayserCassa opened this issue Dec 20, 2024 · 0 comments
Open

Merge CRD objects into each other #1107

TrayserCassa opened this issue Dec 20, 2024 · 0 comments

Comments

@TrayserCassa
Copy link

TrayserCassa commented Dec 20, 2024

Hi,

I’m currently working on reusing a struct that defines a container configuration for both jobs and deployments. Since these configurations can have different values (e.g., the image field), I structured it like this:

Container                                        ContainerSpec `json:"container"`
AdminDeploymentContainer      ContainerSpec `json:"adminDeploymentContainer"`
MigrationJobContainer                ContainerSpec `json:"migrationJobContainer"`

The goal is as follows:

If Container specifies image:abc and AdminDeploymentContainer specifies image: xyz, the admin deployment should run with xyz, while everything else uses abc.

I was considering adding a Merge function to handle these cases, in addition to the existing DeepCopyInto function.
Does this approach make sense, or is there an existing PR or issue I might have overlooked?

@TrayserCassa TrayserCassa changed the title Merg e CRD objects into each other Merge CRD objects into each other Dec 20, 2024
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

No branches or pull requests

1 participant