Skip to content

Commit

Permalink
DRA: fix processing of external resource claims
Browse files Browse the repository at this point in the history
Container claim name was incorrect. It resulted in not setting
CDI annotations for it and CDI injection was not triggered.
  • Loading branch information
bart0sh authored and pohly committed Aug 9, 2022
1 parent a33b90d commit ca95a8a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/kubelet/cm/dra/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,7 @@ func (m *ManagerImpl) prepareContainerResources(pod *v1.Pod, container *v1.Conta
// Process resources for each resource claim referenced by container
for _, containerClaim := range container.Resources.Claims {
for _, podResourceClaim := range pod.Spec.ResourceClaims {
containerClaimName := podResourceClaim.Name
if podResourceClaim.Claim.ResourceClaimName != nil {
containerClaimName = *podResourceClaim.Claim.ResourceClaimName
}

if containerClaim != containerClaimName {
if containerClaim != podResourceClaim.Name {
continue
}

Expand Down Expand Up @@ -199,7 +194,7 @@ func (m *ManagerImpl) prepareContainerResources(pod *v1.Pod, container *v1.Conta
m.podResources.insert(
pod.UID,
container.Name,
containerClaimName,
containerClaim,
&resource{
driverName: driverName,
name: resourceName,
Expand Down

0 comments on commit ca95a8a

Please sign in to comment.