mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 11:38:15 +00:00
Generate empty cdi annotations
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
f0e3c32fe5
commit
db2a1edbdd
@ -45,6 +45,9 @@ func GenerateAnnotations(
|
|||||||
driverName string,
|
driverName string,
|
||||||
cdiDevices []string,
|
cdiDevices []string,
|
||||||
) ([]kubecontainer.Annotation, error) {
|
) ([]kubecontainer.Annotation, error) {
|
||||||
|
if len(cdiDevices) == 0 {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
annotations, err := updateAnnotations(map[string]string{}, driverName, string(claimUID), cdiDevices)
|
annotations, err := updateAnnotations(map[string]string{}, driverName, string(claimUID), cdiDevices)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("can't generate CDI annotations: %+v", err)
|
return nil, fmt.Errorf("can't generate CDI annotations: %+v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user