From 6c69fb6bc4baccd5e12d524aa0aacb24c21d1fe2 Mon Sep 17 00:00:00 2001 From: "M. Mert Yildiran" Date: Sun, 22 Jan 2023 04:33:30 +0300 Subject: [PATCH] :zap: POST pod regex to Hub if Kubeshark is still running --- cmd/tapRunner.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/tapRunner.go b/cmd/tapRunner.go index 3457614c8..3f7d29c70 100644 --- a/cmd/tapRunner.go +++ b/cmd/tapRunner.go @@ -85,7 +85,9 @@ func tap() { if state.selfServiceAccountExists, err = resources.CreateHubResources(ctx, kubernetesProvider, config.Config.IsNsRestrictedMode(), config.Config.SelfNamespace, config.Config.Tap.Resources.Hub, config.Config.ImagePullPolicy(), config.Config.ImagePullSecrets(), config.Config.Tap.Debug); err != nil { var statusError *k8serrors.StatusError if errors.As(err, &statusError) && (statusError.ErrStatus.Reason == metav1.StatusReasonAlreadyExists) { - log.Warn().Msg(fmt.Sprintf("%s is already running in this namespace, change the `selfnamespace` configuration or run `%s clean` to remove the currently running %s instance", misc.Software, misc.Program, misc.Software)) + log.Info().Msg(fmt.Sprintf("%s is already running in this namespace, change the `selfnamespace` configuration or run `%s clean` to remove the currently running %s instance.", misc.Software, misc.Program, misc.Software)) + connector.PostRegexToHub(config.Config.Tap.PodRegexStr, state.targetNamespaces) + log.Info().Msg("Updated the targeted pods. Exiting.") } else { defer resources.CleanUpSelfResources(ctx, cancel, kubernetesProvider, config.Config.IsNsRestrictedMode(), config.Config.SelfNamespace) log.Error().Err(errormessage.FormatError(err)).Msg("Error creating resources!")