Skip to content

Commit

Permalink
chore: improve naming in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abbas-gheydi committed Sep 7, 2024
1 parent 5c44add commit ccc1a9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions internal/controller/service/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ var (
)

func init() {
err := cilium_labelsfilter.ParseLabelPrefixCfg([]string{""}, "")
if err != nil {
if err := cilium_labelsfilter.ParseLabelPrefixCfg([]string{""}, ""); err != nil {
log.Log.Info("error preparing cilium label filters", "error", err)
}
}
Expand Down
6 changes: 3 additions & 3 deletions internal/controller/service/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ func TestBuildCNP_LabelFilter(t *testing.T) {
want map[string]string
}{

{name: "ShuoldNotBeFiltered",
{name: "ShouldNotBeFiltered",
given: map[string]string{"app": "test", "stack": "backend"},
want: map[string]string{"k8s.app": "test", "k8s.stack": "backend"}},

{name: "ShuoldBeFiltered",
{name: "ShouldBeFiltered_statefulset.kubernetes.io/pod-name",
given: map[string]string{"statefulset.kubernetes.io/pod-name": "test", "stack": "backend"},
want: map[string]string{"k8s.stack": "backend"}},

{name: "ShuoldBeFiltered",
{name: "ShouldBeFiltered_k8s.io",
given: map[string]string{"k8s.io/fake": "test", "stack": "backend"},
want: map[string]string{"k8s.stack": "backend"}},
}
Expand Down

0 comments on commit ccc1a9b

Please sign in to comment.