Generate empty cdi annotations

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2023-07-07 17:38:48 +02:00
parent f0e3c32fe5
commit db2a1edbdd

View File

@ -45,6 +45,9 @@ func GenerateAnnotations(
driverName string,
cdiDevices []string,
) ([]kubecontainer.Annotation, error) {
if len(cdiDevices) == 0 {
return nil, nil
}
annotations, err := updateAnnotations(map[string]string{}, driverName, string(claimUID), cdiDevices)
if err != nil {
return nil, fmt.Errorf("can't generate CDI annotations: %+v", err)