Skip to content

Commit

Permalink
Support indexing of uppercase SystemUUID search
Browse files Browse the repository at this point in the history
  • Loading branch information
defo89 committed Aug 28, 2024
1 parent a7fa44d commit c1f1646
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/bootserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ func handleIgnitionIPXEBoot(w http.ResponseWriter, r *http.Request, k8sClient cl
}

if len(ipxeBootConfigList.Items) == 0 {
//Some OSes standardizes SystemUUIDs to lowercase, which may cause mismatches.
if err := k8sClient.List(ctx, ipxeBootConfigList, client.MatchingFields{bootv1alpha1.SystemUUIDIndexKey: strings.ToLower(uuid)}); err != nil {
//Some OSes standardizes SystemUUIDs to uppercase, which may cause mismatches.
if err := k8sClient.List(ctx, ipxeBootConfigList, client.MatchingFields{bootv1alpha1.SystemUUIDIndexKey: strings.ToUpper(uuid)}); err != nil {
http.Error(w, "Resource Not Found", http.StatusNotFound)
log.Info("Failed to find IPXEBootConfig", "error", err.Error())
return
Expand Down Expand Up @@ -232,8 +232,8 @@ func handleIgnitionHTTPBoot(w http.ResponseWriter, r *http.Request, k8sClient cl
}

if len(HTTPBootConfigList.Items) == 0 {
//Some OSes standardizes SystemUUIDs to lowercase, which may cause mismatches.
if err := k8sClient.List(ctx, HTTPBootConfigList, client.MatchingFields{bootv1alpha1.SystemUUIDIndexKey: strings.ToLower(uuid)}); err != nil {
//Some OSes standardizes SystemUUIDs to uppercase, which may cause mismatches.
if err := k8sClient.List(ctx, HTTPBootConfigList, client.MatchingFields{bootv1alpha1.SystemUUIDIndexKey: strings.ToUpper(uuid)}); err != nil {
http.Error(w, "Resource Not Found", http.StatusNotFound)
log.Info("Failed to find HTTPBootConfigList", "error", err.Error())
return
Expand Down

0 comments on commit c1f1646

Please sign in to comment.