Skip to content

Commit

Permalink
Fix fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
l0kix2 committed Jan 9, 2025
1 parent d7d7827 commit 8e15756
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions pkg/components/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,20 @@ 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(),
ytsaurus,
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(
Expand All @@ -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(
Expand All @@ -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{
Expand Down Expand Up @@ -121,6 +124,7 @@ func (m *Master) Fetch(ctx context.Context) error {
return resources.Fetch(ctx,
m.server,
m.initJob,
m.enableRealChunksJob,
m.exitReadOnlyJob,
)
}
Expand Down

0 comments on commit 8e15756

Please sign in to comment.