correct storage class selection message

The function does not necessarily choose class based on the creation
timestamp but can also pick alphabetically first if the timestamps are
equal. The info message should not say it's choosing the newest because
it is misleading.
This commit is contained in:
Roman Bednar 2023-04-03 11:27:59 +02:00
parent d89d5ab268
commit 731068288e

View File

@ -64,7 +64,7 @@ func GetDefaultClass(lister storagev1listers.StorageClassLister) (*storagev1.Sto
return defaultClasses[i].CreationTimestamp.UnixNano() > defaultClasses[j].CreationTimestamp.UnixNano()
})
if len(defaultClasses) > 1 {
klog.V(4).Infof("%d default StorageClasses were found, choosing the newest: %s", len(defaultClasses), defaultClasses[0].Name)
klog.V(4).Infof("%d default StorageClasses were found, choosing: %s", len(defaultClasses), defaultClasses[0].Name)
}
return defaultClasses[0], nil