From 8e1575659ae24a2d6c1698f2241383c8b13e2f5b Mon Sep 17 00:00:00 2001 From: Kirill Sibirev Date: Thu, 9 Jan 2025 12:14:37 +0100 Subject: [PATCH] Fix fetch --- pkg/components/master.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkg/components/master.go b/pkg/components/master.go index 7f7ddd37..04682369 100644 --- a/pkg/components/master.go +++ b/pkg/components/master.go @@ -55,6 +55,9 @@ func NewMaster(cfgen *ytconfig.Generator, ytsaurus *apiproxy.Ytsaurus) *Master { }), ) + jobImage := getImageWithDefault(resource.Spec.PrimaryMasters.InstanceSpec.Image, resource.Spec.CoreImage) + jobTolerations := getTolerationsWithDefault(resource.Spec.PrimaryMasters.Tolerations, resource.Spec.Tolerations) + jobNodeSelector := getNodeSelectorWithDefault(resource.Spec.PrimaryMasters.NodeSelector, resource.Spec.NodeSelector) initJob := NewInitJob( l, ytsaurus.APIProxy(), @@ -62,10 +65,10 @@ func NewMaster(cfgen *ytconfig.Generator, ytsaurus *apiproxy.Ytsaurus) *Master { resource.Spec.ImagePullSecrets, "default", consts.ClientConfigFileName, - getImageWithDefault(resource.Spec.PrimaryMasters.InstanceSpec.Image, resource.Spec.CoreImage), + jobImage, cfgen.GetNativeClientConfig, - getTolerationsWithDefault(resource.Spec.PrimaryMasters.Tolerations, resource.Spec.Tolerations), - getNodeSelectorWithDefault(resource.Spec.PrimaryMasters.NodeSelector, resource.Spec.NodeSelector), + jobTolerations, + jobNodeSelector, ) enableRealChunksJob := NewInitJob( @@ -75,10 +78,10 @@ func NewMaster(cfgen *ytconfig.Generator, ytsaurus *apiproxy.Ytsaurus) *Master { resource.Spec.ImagePullSecrets, "enable-real-chunks", consts.ClientConfigFileName, - getImageWithDefault(resource.Spec.PrimaryMasters.InstanceSpec.Image, resource.Spec.CoreImage), + jobImage, cfgen.GetNativeClientConfig, - getTolerationsWithDefault(resource.Spec.PrimaryMasters.Tolerations, resource.Spec.Tolerations), - getNodeSelectorWithDefault(resource.Spec.PrimaryMasters.NodeSelector, resource.Spec.NodeSelector), + jobTolerations, + jobNodeSelector, ) exitReadOnlyJob := NewInitJob( @@ -88,10 +91,10 @@ func NewMaster(cfgen *ytconfig.Generator, ytsaurus *apiproxy.Ytsaurus) *Master { resource.Spec.ImagePullSecrets, "exit-read-only", consts.ClientConfigFileName, - getImageWithDefault(resource.Spec.PrimaryMasters.InstanceSpec.Image, resource.Spec.CoreImage), + jobImage, cfgen.GetNativeClientConfig, - getTolerationsWithDefault(resource.Spec.PrimaryMasters.Tolerations, resource.Spec.Tolerations), - getNodeSelectorWithDefault(resource.Spec.PrimaryMasters.NodeSelector, resource.Spec.NodeSelector), + jobTolerations, + jobNodeSelector, ) return &Master{ @@ -121,6 +124,7 @@ func (m *Master) Fetch(ctx context.Context) error { return resources.Fetch(ctx, m.server, m.initJob, + m.enableRealChunksJob, m.exitReadOnlyJob, ) }