Skip to content

Commit

Permalink
NEOS-1713: fixes run logs automatically turning on in k8s (#3138)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickzelei authored Jan 13, 2025
1 parent c59da24 commit 5cff568
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions backend/internal/cmds/mgmt/serve/connect/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -1018,27 +1018,6 @@ func getPromApiKey() *string {
func getRunLogConfig() (*v1alpha1_jobservice.RunLogConfig, error) {
isRunLogsEnabled := viper.GetBool("RUN_LOGS_ENABLED")
if !isRunLogsEnabled {
// look for fallback variables
isKubernetes := getIsKubernetes()
ksNs := getKubernetesNamespace()
ksWorkerAppName := getKubernetesWorkerAppName()
if isKubernetes {
if ksNs == "" {
ksNs = "neosync"
}
if ksWorkerAppName == "" {
ksWorkerAppName = "neosync-worker"
}
runlogtype := v1alpha1_jobservice.KubePodRunLogType
return &v1alpha1_jobservice.RunLogConfig{
IsEnabled: true,
RunLogType: &runlogtype,
RunLogPodConfig: &v1alpha1_jobservice.KubePodRunLogConfig{
Namespace: ksNs,
WorkerAppName: ksWorkerAppName,
},
}, nil
}
return &v1alpha1_jobservice.RunLogConfig{
IsEnabled: false,
}, nil
Expand Down Expand Up @@ -1105,6 +1084,10 @@ func getRunLogType() *v1alpha1_jobservice.RunLogType {
rt := v1alpha1_jobservice.LokiRunLogType
return &rt
default:
if getIsKubernetes() {
rt := v1alpha1_jobservice.KubePodRunLogType
return &rt
}
return nil
}
}
Expand Down

0 comments on commit 5cff568

Please sign in to comment.