2016-10-14 03:36:52 +08:00
|
|
|
/*
|
2018-08-25 03:03:55 +08:00
|
|
|
Copyright The Helm Authors.
|
2016-10-14 03:36:52 +08:00
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-10-04 02:27:05 +08:00
|
|
|
package kube // import "helm.sh/helm/v3/pkg/kube"
|
2016-10-14 03:36:52 +08:00
|
|
|
|
2018-10-18 03:53:10 +08:00
|
|
|
import "k8s.io/cli-runtime/pkg/genericclioptions"
|
2016-10-14 03:36:52 +08:00
|
|
|
|
2018-04-24 03:05:45 +08:00
|
|
|
// GetConfig returns a Kubernetes client config.
|
2020-04-24 03:20:14 +08:00
|
|
|
//
|
|
|
|
|
// Deprecated
|
2018-08-23 00:51:19 +08:00
|
|
|
func GetConfig(kubeconfig, context, namespace string) *genericclioptions.ConfigFlags {
|
2019-03-26 05:01:01 +08:00
|
|
|
cf := genericclioptions.NewConfigFlags(true)
|
2018-08-23 00:51:19 +08:00
|
|
|
cf.Namespace = &namespace
|
|
|
|
|
cf.Context = &context
|
|
|
|
|
cf.KubeConfig = &kubeconfig
|
|
|
|
|
return cf
|
2016-10-14 03:36:52 +08:00
|
|
|
}
|