Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
evyatarmeged committed Nov 5, 2024
1 parent a7701e7 commit b9f7caf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (r *LinkerdReconciler) applyLinkerdServiceEffectivePolicy(
}

if !ok {
return nil, errors.Wrap(err)
return nil, errors.Wrap(serviceidresolver.ErrPodNotFound)
}
pod := pods[0]

Expand Down
4 changes: 2 additions & 2 deletions src/operator/controllers/linkerd/linkerd_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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,
)
Expand Down
4 changes: 2 additions & 2 deletions src/operator/controllers/linkerd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b9f7caf

Please sign in to comment.