Skip to content

Commit

Permalink
dra scheduler: unit tests
Browse files Browse the repository at this point in the history
Coverage was checked with a cover profile. The biggest remaining gap is for
isSchedulableAfterClaimParametersChange and
isSchedulableAfterClassParametersChange which will get handled when refactoring
the
foreachPodResourceClaim (kubernetes#123697).
  • Loading branch information
pohly committed Mar 14, 2024
1 parent 6c567d1 commit 59f7e5f
Show file tree
Hide file tree
Showing 6 changed files with 2,284 additions and 28 deletions.
Expand Up @@ -1410,7 +1410,11 @@ func (pl *dynamicResources) Reserve(ctx context.Context, cs *framework.CycleStat
}
state.informationsForClaim[index].allocation = allocation
state.informationsForClaim[index].allocationDriverName = driverName
// Strictly speaking, we don't need to store the full modified object.
// The allocation would be enough. The full object is useful for
// debugging and testing, so let's make it realistic.
claim = claim.DeepCopy()
claim.Finalizers = append(claim.Finalizers, resourcev1alpha2.Finalizer)
claim.Status.DriverName = driverName
claim.Status.Allocation = allocation
pl.inFlightAllocations.Store(claim.UID, claim)
Expand Down

0 comments on commit 59f7e5f

Please sign in to comment.