kubectl: fix Flatten() when used without Latest()

pull/8/head
Michal Fojtik 2018-05-17 13:53:42 +02:00
parent a0b1d4de56
commit 390b60f103
No known key found for this signature in database
GPG Key ID: 172B61E538AAC0EE
1 changed files with 4 additions and 4 deletions

View File

@ -1022,12 +1022,12 @@ func (b *Builder) visitByPaths() *Result {
visitors = VisitorList(b.paths)
}
if b.flatten {
visitors = NewFlattenListVisitor(visitors, b.objectTyper, b.mapper)
}
// only items from disk can be refetched
if b.latest {
// must flatten lists prior to fetching
if b.flatten {
visitors = NewFlattenListVisitor(visitors, b.objectTyper, b.mapper)
}
// must set namespace prior to fetching
if b.defaultNamespace {
visitors = NewDecoratedVisitor(visitors, SetNamespace(b.namespace))