Add pcap command to capture from a PCAP file

This commit is contained in:
M. Mert Yildiran
2022-12-27 07:31:04 +03:00
parent 65cea05fad
commit afbd6963b8
12 changed files with 273 additions and 12 deletions

View File

@@ -389,7 +389,7 @@ func (provider *Provider) CreatePod(ctx context.Context, namespace string, podSp
return provider.clientSet.CoreV1().Pods(namespace).Create(ctx, podSpec, metav1.CreateOptions{})
}
func (provider *Provider) CreateService(ctx context.Context, namespace string, serviceName string, appLabelValue string, targetPort int, port int32, nodePort int32) (*core.Service, error) {
func (provider *Provider) CreateService(ctx context.Context, namespace string, serviceName string, appLabelValue string, targetPort int, port int32) (*core.Service, error) {
service := core.Service{
ObjectMeta: metav1.ObjectMeta{
Name: serviceName,

View File

@@ -21,12 +21,11 @@ import (
const k8sProxyApiPrefix = "/"
const kubesharkServicePort = 80
func StartProxy(kubernetesProvider *Provider, proxyHost string, srcPort uint16, dstPort uint16, kubesharkNamespace string, kubesharkServiceName string, cancel context.CancelFunc) (*http.Server, error) {
func StartProxy(kubernetesProvider *Provider, proxyHost string, srcPort uint16, kubesharkNamespace string, kubesharkServiceName string, cancel context.CancelFunc) (*http.Server, error) {
log.Info().
Str("namespace", kubesharkNamespace).
Str("service", kubesharkServiceName).
Int("src-port", int(srcPort)).
Int("dst-port", int(dstPort)).
Msg("Starting proxy...")
filter := &proxy.FilterServer{