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

Add image override #355

Merged
merged 10 commits into from
Sep 20, 2023
Merged

Add image override #355

merged 10 commits into from
Sep 20, 2023

Conversation

agouin
Copy link
Member

@agouin agouin commented Sep 18, 2023

Allow user to override the image for a specific pod, useful if pods are at different sync heights during initial sync.

@agouin agouin marked this pull request as ready for review September 18, 2023 22:53
Copy link
Contributor

@DavidNix DavidNix left a comment

Choose a reason for hiding this comment

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

You wouldn't know this.

You have to run make generate manifests and commit the generated yaml and code. Otherwise, the kube api won't pick up the new field.

Ideally, CICD step catches this one day.

@@ -0,0 +1,22 @@
name: Kube Manifests
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

Comment on lines 32 to 34
if o.Image != "" {
pod.Spec.Containers[0].Image = o.Image
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Using the first image in the slice is the natural logic.

But I've gotten in trouble with this in the past. The user is able to patch and add whatever containers they want. This possibility is a tradeoff of the operator's flexibility. Therefore, if the user patches, there is no guarantee the node container will be the first one. So, I suggest finding the specific node container vs. using the slice index.

I'll push a commit tomorrow morning.

@DavidNix DavidNix merged commit 48f30b6 into main Sep 20, 2023
3 checks passed
@DavidNix DavidNix deleted the andrew/override_image branch September 20, 2023 15:27
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.

2 participants