Recommended changes from review of #1568
- Make Resources an `interface{}` to support arbitrary yaml
- Remove `wwctl resource` as incompatible with arbitrary yaml
- Revert changes to host overlay templates
- Remove NFS mount options from warewulf.conf
- Replace NFS support / resource prefix with "fstab" resource
- Move resources to profiles
- Migrate warewulf.conf mounts to nodes.conf with `wwctl upgrade`
- Add documentation
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -154,13 +154,16 @@ func recursiveFlatten(obj interface{}) (hasContent bool) {
|
||||
case reflect.Map:
|
||||
mapIter := valObj.Elem().Field(i).MapRange()
|
||||
for mapIter.Next() {
|
||||
if mapIter.Value().Kind() == reflect.String {
|
||||
if mapIter.Value().String() != "" {
|
||||
hasContent = true
|
||||
switch mapIter.Value().Kind() {
|
||||
case reflect.Map, reflect.Pointer, reflect.Slice:
|
||||
if mapIter.Value().Type().Elem().Kind() == reflect.Struct {
|
||||
ret := recursiveFlatten(mapIter.Value().Interface())
|
||||
hasContent = ret || hasContent
|
||||
} else {
|
||||
hasContent = !mapIter.Value().IsZero() || hasContent
|
||||
}
|
||||
} else {
|
||||
ret := recursiveFlatten(mapIter.Value().Interface())
|
||||
hasContent = ret || hasContent
|
||||
default:
|
||||
hasContent = !mapIter.Value().IsZero() || hasContent
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user