Fix problems that golang inspection reported (#1158)

This commit is contained in:
gadotroee
2022-06-23 16:49:56 +03:00
committed by GitHub
parent 8c187179b0
commit a96072623f
37 changed files with 233 additions and 791 deletions

View File

@@ -28,7 +28,7 @@ func UpdateTapTargets(tls *TlsTapper, pods *[]v1.Pod, procfs string) error {
tls.ClearPids()
for pid, pod := range containerPids {
if err := tls.AddSsllibPid(procfs, pid, pod.Namespace); err != nil {
if err := tls.AddSSLLibPid(procfs, pid, pod.Namespace); err != nil {
LogError(err)
}
@@ -90,14 +90,14 @@ func buildContainerIdsMap(pods *[]v1.Pod) map[string]v1.Pod {
for _, pod := range *pods {
for _, container := range pod.Status.ContainerStatuses {
url, err := url.Parse(container.ContainerID)
parsedUrl, err := url.Parse(container.ContainerID)
if err != nil {
logger.Log.Warningf("Expecting URL like container ID %v", container.ContainerID)
continue
}
result[url.Host] = pod
result[parsedUrl.Host] = pod
}
}