Create Kubernetes clients from bytes instead of filepath (#2663)

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2023-12-01 09:00:44 +01:00 committed by GitHub
parent 4d6a7fa759
commit a9cc9d8bbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 94 additions and 33 deletions

View file

@ -61,12 +61,12 @@ type Client struct {
}
// NewClient returns a new Helm client.
func NewClient(kubeConfigPath string, log debugLog) (*Client, error) {
kubeClient, err := kubectl.NewFromConfig(kubeConfigPath)
func NewClient(kubeConfig []byte, log debugLog) (*Client, error) {
kubeClient, err := kubectl.NewFromConfig(kubeConfig)
if err != nil {
return nil, fmt.Errorf("initializing kubectl: %w", err)
}
actionConfig, err := newActionConfig(kubeConfigPath, log)
actionConfig, err := newActionConfig(kubeConfig, log)
if err != nil {
return nil, fmt.Errorf("creating action config: %w", err)
}