Skip to content

Commit b164c93

Browse files
committed
fix the loglevel command
Signed-off-by: Abdul Hameed <ahameed@redhat.com>
1 parent e2b0b8f commit b164c93

File tree

3 files changed

+35
-11
lines changed

3 files changed

+35
-11
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: feast.dev/v1alpha1
2+
kind: FeatureStore
3+
metadata:
4+
name: sample-services-loglevel
5+
spec:
6+
feastProject: my_project
7+
services:
8+
onlineStore:
9+
logLevel: debug
10+
offlineStore:
11+
logLevel: debug
12+
registry:
13+
logLevel: info
14+
local:
15+
persistence:
16+
file:
17+
path: /data/registry.db

infra/feast-operator/internal/controller/services/services.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,29 +355,36 @@ func (feast *FeastServices) setDeployment(deploy *appsv1.Deployment, feastType F
355355
}
356356

357357
func (feast *FeastServices) getContainerCommand(feastType FeastServiceType) []string {
358-
deploySettings := FeastServiceConstants[feastType]
359-
targetPort := deploySettings.TargetHttpPort
358+
baseCommand := "feast"
359+
options := []string{}
360360
logLevel := feast.getLogLevelForType(feastType)
361361
if logLevel != nil {
362-
deploySettings.Command = append(deploySettings.Command, []string{"--log-level", strings.ToUpper(*logLevel)}...)
362+
options = append(options, "--log-level", strings.ToUpper(*logLevel))
363363
}
364+
365+
deploySettings := FeastServiceConstants[feastType]
366+
targetPort := deploySettings.TargetHttpPort
364367
tls := feast.getTlsConfigs(feastType)
365368
if tls.IsTLS() {
366369
targetPort = deploySettings.TargetHttpsPort
367370
feastTlsPath := GetTlsPath(feastType)
368-
deploySettings.Command = append(deploySettings.Command, []string{"--key", feastTlsPath + tls.SecretKeyNames.TlsKey,
371+
deploySettings.Args = append(deploySettings.Args, []string{"--key", feastTlsPath + tls.SecretKeyNames.TlsKey,
369372
"--cert", feastTlsPath + tls.SecretKeyNames.TlsCrt}...)
370373
}
371-
deploySettings.Command = append(deploySettings.Command, []string{"-p", strconv.Itoa(int(targetPort))}...)
374+
deploySettings.Args = append(deploySettings.Args, []string{"-p", strconv.Itoa(int(targetPort))}...)
372375

373376
if feastType == OfflineFeastType {
374377
if tls.IsTLS() && feast.Handler.FeatureStore.Status.Applied.Services.OfflineStore.TLS.VerifyClient != nil {
375-
deploySettings.Command = append(deploySettings.Command,
378+
deploySettings.Args = append(deploySettings.Args,
376379
[]string{"--verify_client", strconv.FormatBool(*feast.Handler.FeatureStore.Status.Applied.Services.OfflineStore.TLS.VerifyClient)}...)
377380
}
378381
}
379382

380-
return deploySettings.Command
383+
// Combine base command, options, and arguments
384+
feastCommand := append([]string{baseCommand}, options...)
385+
feastCommand = append(feastCommand, deploySettings.Args...)
386+
387+
return feastCommand
381388
}
382389

383390
func (feast *FeastServices) offlineClientPodConfigs(podSpec *corev1.PodSpec) {

infra/feast-operator/internal/controller/services/services_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ var (
7878

7979
FeastServiceConstants = map[FeastServiceType]deploymentSettings{
8080
OfflineFeastType: {
81-
Command: []string{"feast", "serve_offline", "-h", "0.0.0.0"},
81+
Args: []string{"serve_offline", "-h", "0.0.0.0"},
8282
TargetHttpPort: 8815,
8383
TargetHttpsPort: 8816,
8484
},
8585
OnlineFeastType: {
86-
Command: []string{"feast", "serve", "-h", "0.0.0.0"},
86+
Args: []string{"serve", "-h", "0.0.0.0"},
8787
TargetHttpPort: 6566,
8888
TargetHttpsPort: 6567,
8989
},
9090
RegistryFeastType: {
91-
Command: []string{"feast", "serve_registry"},
91+
Args: []string{"serve_registry"},
9292
TargetHttpPort: 6570,
9393
TargetHttpsPort: 6571,
9494
},
@@ -218,7 +218,7 @@ type AuthzConfig struct {
218218
}
219219

220220
type deploymentSettings struct {
221-
Command []string
221+
Args []string
222222
TargetHttpPort int32
223223
TargetHttpsPort int32
224224
}

0 commit comments

Comments
 (0)