mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 14:26:23 -04:00
Create Kubernetes clients from bytes instead of filepath (#2663)
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
4d6a7fa759
commit
a9cc9d8bbc
9 changed files with 94 additions and 33 deletions
|
@ -224,10 +224,18 @@ func runApply(cmd *cobra.Command, _ []string) error {
|
|||
return dialer.New(nil, validator, &net.Dialer{})
|
||||
}
|
||||
newKubeUpgrader := func(w io.Writer, kubeConfigPath string, log debugLog) (kubernetesUpgrader, error) {
|
||||
return kubecmd.New(w, kubeConfigPath, fileHandler, log)
|
||||
kubeConfig, err := fileHandler.Read(kubeConfigPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("reading kubeconfig: %w", err)
|
||||
}
|
||||
return kubecmd.New(w, kubeConfig, fileHandler, log)
|
||||
}
|
||||
newHelmClient := func(kubeConfigPath string, log debugLog) (helmApplier, error) {
|
||||
return helm.NewClient(kubeConfigPath, log)
|
||||
kubeConfig, err := fileHandler.Read(kubeConfigPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("reading kubeconfig: %w", err)
|
||||
}
|
||||
return helm.NewClient(kubeConfig, log)
|
||||
}
|
||||
|
||||
upgradeID := generateUpgradeID(upgradeCmdKindApply)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue