From 168234598abd7f9272a9bfb117e9967caa90b3ed Mon Sep 17 00:00:00 2001 From: "M. Mert Yildiran" Date: Thu, 1 Dec 2022 02:31:05 +0300 Subject: [PATCH] :arrow_up: `github.com/kubeshark/base@v0.1.3` --- cmd/deployRunner.go | 16 ++++++++-------- go.mod | 2 +- go.sum | 4 ++-- internal/connect/hub.go | 6 +++--- kubernetes/errors.go | 2 +- kubernetes/kubesharkTapperSyncer.go | 8 ++++---- kubernetes/provider.go | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cmd/deployRunner.go b/cmd/deployRunner.go index a94abcc79..caf53707a 100644 --- a/cmd/deployRunner.go +++ b/cmd/deployRunner.go @@ -107,14 +107,14 @@ func finishDeployExecution(kubernetesProvider *kubernetes.Provider) { func getDeployConfig() *models.Config { conf := models.Config{ - MaxDBSizeBytes: config.Config.Deploy.MaxEntriesDBSizeBytes(), - InsertionFilter: config.Config.Deploy.GetInsertionFilter(), - PullPolicy: config.Config.ImagePullPolicyStr, - TapperResources: config.Config.Deploy.WorkerResources, - KubesharkResourcesNamespace: config.Config.ResourcesNamespace, - AgentDatabasePath: models.DataDirPath, - ServiceMap: config.Config.ServiceMap, - OAS: config.Config.OAS, + MaxDBSizeBytes: config.Config.Deploy.MaxEntriesDBSizeBytes(), + InsertionFilter: config.Config.Deploy.GetInsertionFilter(), + PullPolicy: config.Config.ImagePullPolicyStr, + WorkerResources: config.Config.Deploy.WorkerResources, + ResourcesNamespace: config.Config.ResourcesNamespace, + DatabasePath: models.DataDirPath, + ServiceMap: config.Config.ServiceMap, + OAS: config.Config.OAS, } return &conf diff --git a/go.mod b/go.mod index 75c20aea9..52b996110 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/creasty/defaults v1.5.2 github.com/docker/go-units v0.4.0 github.com/google/go-github/v37 v37.0.0 - github.com/kubeshark/base v0.1.1 + github.com/kubeshark/base v0.1.3 github.com/rs/zerolog v1.28.0 github.com/spf13/cobra v1.3.0 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 92fa33b50..c2b91b4da 100644 --- a/go.sum +++ b/go.sum @@ -407,8 +407,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubeshark/base v0.1.1 h1:HiYshnIATBc4WIPndj7OkS0xcdmsLn7idhLLZETGstg= -github.com/kubeshark/base v0.1.1/go.mod h1:8JVCnumWkO43+wkLjv1rQufTArm8ckoxVrFcmZsCyKc= +github.com/kubeshark/base v0.1.3 h1:VEiwMBMhl5q512WxpKIq3mtATMdQa8qZCMx7doD9Eug= +github.com/kubeshark/base v0.1.3/go.mod h1:65ju4+Mzl5eztP9ir2BUEOd1qhpOD7L0Zjj4PpZ2w6g= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= diff --git a/internal/connect/hub.go b/internal/connect/hub.go index eb740ad94..28425a3b8 100644 --- a/internal/connect/hub.go +++ b/internal/connect/hub.go @@ -62,8 +62,8 @@ func (connector *Connector) isReachable(path string) (bool, error) { } } -func (connector *Connector) ReportWorkerStatus(workerStatus models.TapperStatus) error { - workerStatusUrl := fmt.Sprintf("%s/status/tapperStatus", connector.url) +func (connector *Connector) ReportWorkerStatus(workerStatus models.WorkerStatus) error { + workerStatusUrl := fmt.Sprintf("%s/status/workerStatus", connector.url) if jsonValue, err := json.Marshal(workerStatus); err != nil { return fmt.Errorf("Failed Marshal the worker status %w", err) @@ -78,7 +78,7 @@ func (connector *Connector) ReportWorkerStatus(workerStatus models.TapperStatus) } func (connector *Connector) ReportTargettedPods(pods []core.Pod) error { - targettedPodsUrl := fmt.Sprintf("%s/status/tappedPods", connector.url) + targettedPodsUrl := fmt.Sprintf("%s/status/targettedPods", connector.url) if jsonValue, err := json.Marshal(pods); err != nil { return fmt.Errorf("Failed Marshal the targetted pods %w", err) diff --git a/kubernetes/errors.go b/kubernetes/errors.go index 6a71ab50b..b3bb2c930 100644 --- a/kubernetes/errors.go +++ b/kubernetes/errors.go @@ -3,7 +3,7 @@ package kubernetes type K8sDeployManagerErrorReason string const ( - DeployManagerWorkerUpdateError K8sDeployManagerErrorReason = "TAPPER_UPDATE_ERROR" + DeployManagerWorkerUpdateError K8sDeployManagerErrorReason = "WORKER_UPDATE_ERROR" DeployManagerPodWatchError K8sDeployManagerErrorReason = "POD_WATCH_ERROR" DeployManagerPodListError K8sDeployManagerErrorReason = "POD_LIST_ERROR" ) diff --git a/kubernetes/kubesharkTapperSyncer.go b/kubernetes/kubesharkTapperSyncer.go index f8a419b47..372b6a3af 100644 --- a/kubernetes/kubesharkTapperSyncer.go +++ b/kubernetes/kubesharkTapperSyncer.go @@ -30,7 +30,7 @@ type WorkerSyncer struct { config WorkerSyncerConfig kubernetesProvider *Provider DeployPodChangesOut chan TargettedPodChangeEvent - WorkerStatusChangedOut chan models.TapperStatus + WorkerStatusChangedOut chan models.WorkerStatus ErrorOut chan K8sDeployManagerError nodeToTargettedPodMap models.NodeToPodsMap targettedNodes []string @@ -58,7 +58,7 @@ func CreateAndStartWorkerSyncer(ctx context.Context, kubernetesProvider *Provide config: config, kubernetesProvider: kubernetesProvider, DeployPodChangesOut: make(chan TargettedPodChangeEvent, 100), - WorkerStatusChangedOut: make(chan models.TapperStatus, 100), + WorkerStatusChangedOut: make(chan models.WorkerStatus, 100), ErrorOut: make(chan K8sDeployManagerError, 100), } @@ -101,7 +101,7 @@ func (workerSyncer *WorkerSyncer) watchWorkerPods() { Interface("phase", pod.Status.Phase). Msg("Watching pod events...") if pod.Spec.NodeName != "" { - workerStatus := models.TapperStatus{TapperName: pod.Name, NodeName: pod.Spec.NodeName, Status: string(pod.Status.Phase)} + workerStatus := models.WorkerStatus{Name: pod.Name, NodeName: pod.Spec.NodeName, Status: string(pod.Status.Phase)} workerSyncer.WorkerStatusChangedOut <- workerStatus } @@ -166,7 +166,7 @@ func (workerSyncer *WorkerSyncer) watchWorkerEvents() { nodeName = pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms[0].MatchFields[0].Values[0] } - workerStatus := models.TapperStatus{TapperName: pod.Name, NodeName: nodeName, Status: string(pod.Status.Phase)} + workerStatus := models.WorkerStatus{Name: pod.Name, NodeName: nodeName, Status: string(pod.Status.Phase)} workerSyncer.WorkerStatusChangedOut <- workerStatus case err, ok := <-errorChan: diff --git a/kubernetes/provider.go b/kubernetes/provider.go index 177fefddb..201c3d79b 100644 --- a/kubernetes/provider.go +++ b/kubernetes/provider.go @@ -831,7 +831,7 @@ func (provider *Provider) ApplyWorkerDaemonSet(ctx context.Context, namespace st kubesharkCmd := []string{ "./worker", "-i", "any", - "--api-server-address", fmt.Sprintf("ws://%s/wsTapper", hubPodIp), + "--api-server-address", fmt.Sprintf("ws://%s/wsWorker", hubPodIp), "--nodefrag", "--max-live-streams", strconv.Itoa(maxLiveStreams), }