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

Init job creates from InstanceSpec image if specified #336

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

wilwell
Copy link
Contributor

@wilwell wilwell commented Sep 9, 2024

Before this change if resource(master/chyt/scheduler etc.) is updated the init job still uses outdated image from Spec.CoreImage.

This change corrects this behavior, and if the more relevant image exists it gonna be used instead (relevant image for each resource)

Closes #157

@wilwell wilwell changed the title Init job creates from PrimaryMasters.InstanceSpec image if specified Init job creates from InstanceSpec image if specified Sep 9, 2024
@wilwell
Copy link
Contributor Author

wilwell commented Sep 9, 2024

cc @l0kix2

pkg/components/init_job.go Outdated Show resolved Hide resolved
@wilwell wilwell requested a review from l0kix2 September 11, 2024 15:50
@@ -227,3 +227,10 @@ func AddInitContainersToPodSpec(initContainers []string, podSpec *corev1.PodSpec
podSpec.InitContainers = append(containers, podSpec.InitContainers...)
return nil
}

func SelectTrueImage(coreImage string, instanceImage *string) string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

suppose it can be non-exported since we are using it in the components package only

Copy link
Collaborator

Choose a reason for hiding this comment

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

And the name TrueImage sounds like some soft for windows. Let's maybe call It SelectEffectiveImage.
Also, I would expect a signature like getImageWithDefault(componentImage, defaultImage string)

@l0kix2 l0kix2 merged commit d211c4a into ytsaurus:main Sep 12, 2024
5 checks passed
@l0kix2
Copy link
Collaborator

l0kix2 commented Sep 13, 2024

I've realized that there is an issue with this change since all jobs require yt cli installed, but strawberry and UI have different images which can't be used for k8s job. I'll fix that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Jobs images must be in sync with component they updating
2 participants