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, ) }