Skip to content

Commit

Permalink
fix(bug): Encode name in filter by name FIQL Query
Browse files Browse the repository at this point in the history
Not encoding the name can cause errors when non-standard characters
are present in the name.
  • Loading branch information
thunderboltsid committed Oct 2, 2024
1 parent 78f61d1 commit 0a9b12b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"errors"
"fmt"
"net/url"
"reflect"
"strconv"
"strings"
Expand Down Expand Up @@ -664,7 +665,8 @@ func GetProjectUUID(ctx context.Context, client *prismclientv3.Client, projectNa
}

func getFilterForName(name string) string {
return fmt.Sprintf("name==%s", name)
encodedName := url.QueryEscape(name)
return fmt.Sprintf("name==%s", encodedName)

Check warning on line 669 in controllers/helpers.go

View check run for this annotation

Codecov / codecov/patch

controllers/helpers.go#L668-L669

Added lines #L668 - L669 were not covered by tests
}

func hasPEClusterServiceEnabled(peCluster *prismclientv3.ClusterIntentResponse, serviceName string) bool {
Expand Down

0 comments on commit 0a9b12b

Please sign in to comment.