Merge "Use proper object to create cmdutil factory"
This commit is contained in:
commit
4d88f1b2d1
@ -25,6 +25,7 @@ import (
|
|||||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||||
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
cmdutil "k8s.io/kubectl/pkg/cmd/util"
|
||||||
"sigs.k8s.io/cli-utils/pkg/manifestreader"
|
"sigs.k8s.io/cli-utils/pkg/manifestreader"
|
||||||
|
"sigs.k8s.io/cli-utils/pkg/util/factory"
|
||||||
|
|
||||||
"opendev.org/airship/airshipctl/pkg/document"
|
"opendev.org/airship/airshipctl/pkg/document"
|
||||||
)
|
)
|
||||||
@ -35,7 +36,9 @@ func FactoryFromKubeConfig(path, context string) cmdutil.Factory {
|
|||||||
kf := genericclioptions.NewConfigFlags(false)
|
kf := genericclioptions.NewConfigFlags(false)
|
||||||
kf.KubeConfig = &path
|
kf.KubeConfig = &path
|
||||||
kf.Context = &context
|
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
|
// Streams returns default IO streams object, like stdout, stdin, stderr
|
||||||
|
Loading…
x
Reference in New Issue
Block a user