mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-26 13:04:13 +00:00
💡 Better log messages
This commit is contained in:
@@ -316,10 +316,10 @@ func (tapperSyncer *KubesharkTapperSyncer) updateCurrentlyTappedPods() (err erro
|
||||
podsToTap := excludeKubesharkPods(matchingPods)
|
||||
addedPods, removedPods := getPodArrayDiff(tapperSyncer.CurrentlyTappedPods, podsToTap)
|
||||
for _, addedPod := range addedPods {
|
||||
log.Info().Str("pod", addedPod.Name).Msg("Tapping new pod.")
|
||||
log.Info().Str("pod", addedPod.Name).Msg("Currently targetting:")
|
||||
}
|
||||
for _, removedPod := range removedPods {
|
||||
log.Info().Str("pod", removedPod.Name).Msg("Pod is no longer running. Tapping is stopped.")
|
||||
log.Info().Str("pod", removedPod.Name).Msg("Pod is no longer running. Targetting is stopped.")
|
||||
}
|
||||
if len(addedPods) > 0 || len(removedPods) > 0 {
|
||||
tapperSyncer.CurrentlyTappedPods = podsToTap
|
||||
|
@@ -816,7 +816,7 @@ func (provider *Provider) ApplyKubesharkTapperDaemonSet(ctx context.Context, nam
|
||||
Str("namespace", namespace).
|
||||
Str("daemonset-name", daemonSetName).
|
||||
Str("image", podImage).
|
||||
Str("pod-name", tapperPodName).
|
||||
Str("pod", tapperPodName).
|
||||
Msg("Applying tapper DaemonSets.")
|
||||
|
||||
if len(nodeNames) == 0 {
|
||||
|
@@ -24,7 +24,7 @@ const kubesharkServicePort = 80
|
||||
func StartProxy(kubernetesProvider *Provider, proxyHost string, srcPort uint16, dstPort uint16, kubesharkNamespace string, kubesharkServiceName string, cancel context.CancelFunc) (*http.Server, error) {
|
||||
log.Info().
|
||||
Str("namespace", kubesharkNamespace).
|
||||
Str("service-name", kubesharkServiceName).
|
||||
Str("service", kubesharkServiceName).
|
||||
Int("src-port", int(srcPort)).
|
||||
Int("dst-port", int(dstPort)).
|
||||
Msg("Starting proxy...")
|
||||
@@ -112,7 +112,7 @@ func NewPortForward(kubernetesProvider *Provider, namespace string, podRegex *re
|
||||
|
||||
log.Info().
|
||||
Str("namespace", namespace).
|
||||
Str("pod-name", podName).
|
||||
Str("pod", podName).
|
||||
Int("src-port", int(srcPort)).
|
||||
Int("dst-port", int(dstPort)).
|
||||
Msg("Starting proxy using port-forward method...")
|
||||
|
Reference in New Issue
Block a user