123456789101112131415161718192021222324252627282930313233 |
- package argo
- import "git.sxidc.com/go-tools/argo-api/client"
- var clientInstance *client.Client
- func Init(kubeConfig string) error {
- if clientInstance != nil {
- return nil
- }
- c, err := client.NewClient(kubeConfig)
- if err != nil {
- return err
- }
- clientInstance = c
- return nil
- }
- func Destroy() {
- if clientInstance == nil {
- return
- }
- client.Destroy(clientInstance)
- clientInstance = nil
- }
- func GetInstance() *client.Client {
- return clientInstance
- }
|