Use proper object to create cmdutil factory
MatchVersionFalgs object should be used instead as cli-utils library suggests, particularly it will allow us to avoid the issue when airshipctl apply process stuck after Unknown state. Change-Id: Id6d6ca69a67cb4a500b150a00df538ffffa11eb3 Signed-off-by: Ruslan Aliev <raliev@mirantis.com> Closes: #552
This commit is contained in:
parent
466c7892dc
commit
16e5e9f06a
@ -25,6 +25,7 @@ import (
|
||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
||||
"sigs.k8s.io/cli-utils/pkg/manifestreader"
|
||||
"sigs.k8s.io/cli-utils/pkg/util/factory"
|
||||
|
||||
"opendev.org/airship/airshipctl/pkg/document"
|
||||
)
|
||||
@ -35,7 +36,9 @@ func FactoryFromKubeConfig(path, context string) cmdutil.Factory {
|
||||
kf := genericclioptions.NewConfigFlags(false)
|
||||
kf.KubeConfig = &path
|
||||
kf.Context = &context
|
||||
return cmdutil.NewFactory(kf)
|
||||
return cmdutil.NewFactory(cmdutil.NewMatchVersionFlags(&factory.CachingRESTClientGetter{
|
||||
Delegate: kf,
|
||||
}))
|
||||
}
|
||||
|
||||
// Streams returns default IO streams object, like stdout, stdin, stderr
|
||||
|
Loading…
x
Reference in New Issue
Block a user