(config *Config)
| 79 | } |
| 80 | |
| 81 | func NewClient(config *Config) (*Client, error) { |
| 82 | client := Client{ |
| 83 | Architectures: config.Architectures, |
| 84 | } |
| 85 | client.settings = GetSettings(config.ClusterName) |
| 86 | cf := genericclioptions.NewConfigFlags(true) |
| 87 | apiServer := config.Host |
| 88 | cf.APIServer = &apiServer |
| 89 | kubeConfig := config.KubeConfig |
| 90 | cf.WrapConfigFn = func(config *rest.Config) *rest.Config { |
| 91 | return kubeConfig |
| 92 | } |
| 93 | cf.CacheDir = nil |
| 94 | if config.Namespace != "" { |
| 95 | client.Namespace = config.Namespace |
| 96 | cf.Namespace = &client.Namespace |
| 97 | } |
| 98 | client.ClusterName = config.ClusterName |
| 99 | actionConfig := new(action.Configuration) |
| 100 | if err := actionConfig.Init(cf, config.Namespace, helmDriver, nolog); err != nil { |
| 101 | return nil, err |
| 102 | } |
| 103 | client.actionConfig = actionConfig |
| 104 | |
| 105 | return &client, nil |
| 106 | } |
| 107 | |
| 108 | func (c Client) List(limit, offset int, pattern string) ([]*release.Release, int, error) { |
| 109 | client := action.NewList(c.actionConfig) |
no test coverage detected