From b9f7cafb3dedd395edde75ab614c02b90ad38555 Mon Sep 17 00:00:00 2001 From: Evyatar Date: Tue, 5 Nov 2024 17:26:01 +0200 Subject: [PATCH] linter --- .../controllers/intents_reconcilers/linkerd_reconciler.go | 2 +- src/operator/controllers/linkerd/linkerd_manager.go | 4 ++-- src/operator/controllers/linkerd/utils.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/operator/controllers/intents_reconcilers/linkerd_reconciler.go b/src/operator/controllers/intents_reconcilers/linkerd_reconciler.go index b9a81f243..4210d9c86 100644 --- a/src/operator/controllers/intents_reconcilers/linkerd_reconciler.go +++ b/src/operator/controllers/intents_reconcilers/linkerd_reconciler.go @@ -94,7 +94,7 @@ func (r *LinkerdReconciler) applyLinkerdServiceEffectivePolicy( } if !ok { - return nil, errors.Wrap(err) + return nil, errors.Wrap(serviceidresolver.ErrPodNotFound) } pod := pods[0] diff --git a/src/operator/controllers/linkerd/linkerd_manager.go b/src/operator/controllers/linkerd/linkerd_manager.go index ab9c9d753..db849e486 100644 --- a/src/operator/controllers/linkerd/linkerd_manager.go +++ b/src/operator/controllers/linkerd/linkerd_manager.go @@ -185,7 +185,7 @@ func (ldm *LinkerdManager) CreateResources(ctx context.Context, ep effectivepoli if !shouldCreateLinkerdResources { ep.ClientIntentsEventRecorder.RecordWarningEvent(ReasonShouldNotCreatePolicy, "Enforcement is disabled globally and server is not explicitly protected, skipping linkerd policy creation for server %s in namespace %s") - logrus.Warning("Enforcement is disabled globally and server is not explicitly protected, skipping linkerd policy creation for server %s in namespace %s", target.GetTargetServerName(), target.GetTargetServerNamespace(clientNamespace)) + logrus.Warningf("Enforcement is disabled globally and server is not explicitly protected, skipping linkerd policy creation for server %s in namespace %s", target.GetTargetServerName(), target.GetTargetServerNamespace(clientNamespace)) continue } @@ -196,7 +196,7 @@ func (ldm *LinkerdManager) CreateResources(ctx context.Context, ep effectivepoli "Namespace %s was specified in intent, but is not allowed by configuration, Linkerd policy ignored", targetNamespace) - logrus.Warning( + logrus.Warningf( "Namespace %s was specified in intent, but is not allowed by configuration, Linkerd policy ignored", targetNamespace, ) diff --git a/src/operator/controllers/linkerd/utils.go b/src/operator/controllers/linkerd/utils.go index 6f279d4bb..5d7d535d1 100644 --- a/src/operator/controllers/linkerd/utils.go +++ b/src/operator/controllers/linkerd/utils.go @@ -44,9 +44,9 @@ func IsLinkerdInstalled(ctx context.Context, client client.Client) (bool, error) func generateRandomString(length int, seed ...int64) string { charset := "abcdefghijklmnopqrstuvwxyz0123456789" if len(seed) > 0 { - rand.Seed(seed[0]) + rand.New(rand.NewSource(seed[0])) } else { - rand.Seed(time.Now().UnixNano()) + rand.New(rand.NewSource(time.Now().UnixNano())) } b := make([]byte, length)