-
Notifications
You must be signed in to change notification settings - Fork 458
/
v1alpha1_schedulerconfig.go
39 lines (30 loc) · 1.13 KB
/
v1alpha1_schedulerconfig.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package v1alpha1
import (
"fmt"
"github.com/talos-systems/talos/pkg/machinery/config"
"github.com/talos-systems/talos/pkg/machinery/constants"
"github.com/talos-systems/talos/pkg/machinery/generic/slices"
)
// Image implements the config.Scheduler interface.
func (s *SchedulerConfig) Image() string {
image := s.ContainerImage
if image == "" {
image = fmt.Sprintf("%s:v%s", constants.KubernetesSchedulerImage, constants.DefaultKubernetesVersion)
}
return image
}
// ExtraArgs implements the config.Scheduler interface.
func (s *SchedulerConfig) ExtraArgs() map[string]string {
return s.ExtraArgsConfig
}
// ExtraVolumes implements the config.Scheduler interface.
func (s *SchedulerConfig) ExtraVolumes() []config.VolumeMount {
return slices.Map(s.ExtraVolumesConfig, func(v VolumeMountConfig) config.VolumeMount { return v })
}
// Env implements the config.Scheduler interface.
func (s *SchedulerConfig) Env() Env {
return s.EnvConfig
}