UPSTREAM: 63966: kubectl: fix Flatten() when used without Latest()
@@ -933,12 +933,12 @@ func (b *Builder) visitByPaths() *Result {
visitors = VisitorList(b.paths)
}
- // only items from disk can be refetched
- if b.latest {
- // must flatten lists prior to fetching
if b.flatten {
visitors = NewFlattenListVisitor(visitors, b.mapper)
}
+
+ // only items from disk can be refetched
+ if b.latest {
// must set namespace prior to fetching
if b.defaultNamespace {
visitors = NewDecoratedVisitor(visitors, SetNamespace(b.namespace))
