Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
  • Loading branch information
AleksZimin committed Aug 12, 2024
1 parent ee332ab commit 3d47e35
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const (
defaultDivisor = 1
defaultListenAddr = ":8000"
defaultCacheSize = 10
defaultcertFile = "/etc/sds-local-volume-scheduler-extender/certs/tls.crt"
defaultkeyFile = "/etc/sds-local-volume-scheduler-extender/certs/tls.key"
)

type Config struct {
Expand All @@ -67,13 +69,17 @@ type Config struct {
LogLevel string `json:"log-level"`
CacheSize int `json:"cache-size"`
HealthProbeBindAddress string `json:"health-probe-bind-address"`
CertFile string `json:"cert-file"`
KeyFile string `json:"key-file"`
}

var config = &Config{
ListenAddr: defaultListenAddr,
DefaultDivisor: defaultDivisor,
LogLevel: "2",
CacheSize: defaultCacheSize,
CertFile: defaultcertFile,
KeyFile: defaultkeyFile,
}

var rootCmd = &cobra.Command{
Expand Down Expand Up @@ -205,7 +211,7 @@ func subMain(parentCtx context.Context) error {
}()

log.Info(fmt.Sprintf("[subMain] starts serving on: %s", config.ListenAddr))
err = serv.ListenAndServeTLS("/etc/sds-local-volume-scheduler-extender/certs/tls.crt", "/etc/sds-local-volume-scheduler-extender/certs/tls.key")
err = serv.ListenAndServeTLS(config.CertFile, config.KeyFile)
if !errors.Is(err, http.ErrServerClosed) {
log.Error(err, "[subMain] unable to run the server")
return err
Expand Down

0 comments on commit 3d47e35

Please sign in to comment.