Skip to content

Commit

Permalink
fix: ignore case for folder names in grafana responses (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
weisdd committed Oct 5, 2022
1 parent 54a5592 commit f568ea8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion controllers/grafanadashboard/grafana_client.go
Expand Up @@ -7,6 +7,7 @@ import (
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"

"sigs.k8s.io/controller-runtime/pkg/log"
Expand Down Expand Up @@ -206,7 +207,7 @@ func (r *GrafanaClientImpl) CreateOrUpdateFolder(folderInputName string) (Grafan
}

for _, folder := range allfolders {
if folder.Title == folderInputName {
if strings.EqualFold(folder.Title, folderInputName) {
return folder, nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/grafanadashboardfolder/grafana_client.go
Expand Up @@ -132,7 +132,7 @@ func (r *GrafanaClientImpl) FindOrCreateFolder(folderName string) (GrafanaFolder
}

for _, folder := range existingFolders {
if folder.Title == folderName {
if strings.EqualFold(folder.Title, folderName) {
return folder, nil
}
}
Expand Down

0 comments on commit f568ea8

Please sign in to comment.