Skip to content

Commit

Permalink
handle unknown programming language in odiglet (#1331)
Browse files Browse the repository at this point in the history
address #1330

Co-authored-by: esara <esara@causely.io>
Co-authored-by: Amir Blum <amirgiraffe@gmail.com>
  • Loading branch information
3 people authored Jul 7, 2024
1 parent 3ef98e7 commit 412b216
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions odiglet/pkg/kube/runtime_details/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ func runtimeInspection(pods []corev1.Pod, ignoredContainers []string) ([]odigosv
}
}

envs := make([]odigosv1.EnvVar, 0)
if inspectProc == nil {
log.Logger.V(0).Info("unable to detect language for any process", "pod", pod.Name, "container", container.Name, "namespace", pod.Namespace)
lang = common.UnknownProgrammingLanguage
} else if len(processes) > 1 {
log.Logger.V(0).Info("multiple processes found in pod container, only taking the first one with detected language into account", "pod", pod.Name, "container", container.Name, "namespace", pod.Namespace)
}

// Convert map to slice for k8s format
envs := make([]odigosv1.EnvVar, 0, len(inspectProc.Envs))
for envName, envValue := range inspectProc.Envs {
envs = append(envs, odigosv1.EnvVar{Name: envName, Value: envValue})
// Convert map to slice for k8s format
envs = make([]odigosv1.EnvVar, 0, len(inspectProc.Envs))
for envName, envValue := range inspectProc.Envs {
envs = append(envs, odigosv1.EnvVar{Name: envName, Value: envValue})
}
}

resultsMap[container.Name] = odigosv1.RuntimeDetailsByContainer{
Expand Down

0 comments on commit 412b216

Please sign in to comment.