Update e2e tests for recent changes to resource.k8s.io/v1alpha2

Signed-off-by: Kevin Klues <kklues@nvidia.com>
This commit is contained in:
Kevin Klues 2023-03-07 15:13:13 +00:00
parent 74d634a028
commit 6ba9b91604

View File

@ -159,7 +159,7 @@ func (c *ExampleController) Allocate(ctx context.Context, claim *resourcev1alpha
return c.allocate(ctx, claim, claimParameters, class, classParameters, selectedNode)
}
// allocate simply copies parameters as JSON map into ResourceHandle.
// allocate simply copies parameters as JSON map into a ResourceHandle.
func (c *ExampleController) allocate(ctx context.Context, claim *resourcev1alpha2.ResourceClaim, claimParameters interface{}, class *resourcev1alpha2.ResourceClass, classParameters interface{}, selectedNode string) (result *resourcev1alpha2.AllocationResult, err error) {
logger := klog.LoggerWithValues(klog.LoggerWithName(klog.FromContext(ctx), "Allocate"), "claim", klog.KObj(claim), "uid", claim.UID)
defer func() {
@ -223,7 +223,12 @@ func (c *ExampleController) allocate(ctx context.Context, claim *resourcev1alpha
if err != nil {
return nil, fmt.Errorf("encode parameters: %w", err)
}
allocation.ResourceHandle = string(data)
allocation.ResourceHandles = []resourcev1alpha2.ResourceHandle{
{
DriverName: c.driverName,
Data: string(data),
},
}
var nodes []string
if node != "" {
nodes = append(nodes, node)