mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-25 11:59:35 +00:00
Set the entry namespace to the source namespace if the destination is not resolved (#950)
* Set the entry namespace to the source namespace if the destination is not resolved * Overwrite src namespace with dst namespace only if dst non-empty
This commit is contained in:
parent
2427955aa4
commit
a49443f101
@ -168,6 +168,7 @@ func resolveIP(connectionInfo *tapApi.ConnectionInfo) (resolvedSource string, re
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
resolvedSource = resolvedSourceObject.FullAddress
|
resolvedSource = resolvedSourceObject.FullAddress
|
||||||
|
namespace = resolvedSourceObject.Namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
unresolvedDestination := fmt.Sprintf("%s:%s", connectionInfo.ServerIP, connectionInfo.ServerPort)
|
unresolvedDestination := fmt.Sprintf("%s:%s", connectionInfo.ServerIP, connectionInfo.ServerPort)
|
||||||
@ -179,9 +180,13 @@ func resolveIP(connectionInfo *tapApi.ConnectionInfo) (resolvedSource string, re
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
resolvedDestination = resolvedDestinationObject.FullAddress
|
resolvedDestination = resolvedDestinationObject.FullAddress
|
||||||
|
// Overwrite namespace (if it was set according to the source)
|
||||||
|
// Only overwrite if non-empty
|
||||||
|
if resolvedDestinationObject.Namespace != "" {
|
||||||
namespace = resolvedDestinationObject.Namespace
|
namespace = resolvedDestinationObject.Namespace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return resolvedSource, resolvedDestination, namespace
|
return resolvedSource, resolvedDestination, namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user