Skip to content

Commit

Permalink
Always search for lowercase SystemUUID (#22)
Browse files Browse the repository at this point in the history
* nodeInfo.SystemUUID will always be in lowercase but for some vendors server.Spec.UUID is uppercase.
  • Loading branch information
defo89 authored Sep 4, 2024
1 parent 8e297c5 commit f2d7ad2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
LABEL source_repository="https://github.com/ironcore-dev/cloud-provider-metal"
WORKDIR /
COPY --from=builder /workspace/manager /metal-cloud-controller-manager
USER 65532:65532
Expand Down
3 changes: 2 additions & 1 deletion pkg/cloudprovider/metal/instances_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ func (o *metalInstancesV2) getServerClaimForNode(ctx context.Context, node *core
if err := o.metalClient.Get(ctx, client.ObjectKey{Name: claim.Spec.ServerRef.Name}, server); err != nil {
return nil, fmt.Errorf("failed to get server object for node %s: %w", node.Name, err)
}
if nodeInfo := node.Status.NodeInfo; nodeInfo.SystemUUID == server.Spec.UUID {
//Avoid case mismatch by converting to lower case
if nodeInfo := node.Status.NodeInfo; nodeInfo.SystemUUID == strings.ToLower(server.Spec.UUID) {
return &claim, nil
}
}
Expand Down

0 comments on commit f2d7ad2

Please sign in to comment.