Skip to content

Commit

Permalink
move debug apply files at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
jarededwards committed Dec 7, 2024
1 parent b3edfe9 commit 1ed84be
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions cmd/addipmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/konstructio/colony/internal/constants"
"github.com/konstructio/colony/internal/exec"
"github.com/konstructio/colony/internal/k8s"
"github.com/konstructio/colony/internal/logger"
"github.com/konstructio/colony/manifests"
"github.com/spf13/cobra"
Expand All @@ -27,6 +28,7 @@ type IPMIAuth struct {

func getAddIPMICommand() *cobra.Command {
var ipmiAuthFile string
var templateFiles []string

getAddIPMICmd := &cobra.Command{
Use: "add-ipmi",
Expand Down Expand Up @@ -86,8 +88,6 @@ func getAddIPMICommand() *cobra.Command {
}
}

var templateFiles []string

files, err := os.ReadDir(filepath.Join(homeDir, constants.ColonyDir, "ipmi"))
if err != nil {
return fmt.Errorf("failed to open directory: %w", err)
Expand All @@ -101,18 +101,19 @@ func getAddIPMICommand() *cobra.Command {
templateFiles = append(templateFiles, string(content))
}
log.Info(templateFiles)
// k8sClient, err := k8s.New(log, filepath.Join(homeDir, constants.ColonyDir, constants.KubeconfigHostPath))
// if err != nil {
// return fmt.Errorf("failed to create k8s client: %w", err)
// }

// if err := k8sClient.LoadMappingsFromKubernetes(); err != nil {
// return fmt.Errorf("error loading dynamic mappings from kubernetes: %w", err)
// }

// if err := k8sClient.ApplyManifests(ctx, templateFiles); err != nil {
// return fmt.Errorf("error applying templates: %w", err)
// }

}

Check failure on line 105 in cmd/addipmi.go

View workflow job for this annotation

GitHub Actions / run-tests

unnecessary trailing newline (whitespace)
k8sClient, err := k8s.New(log, filepath.Join(homeDir, constants.ColonyDir, constants.KubeconfigHostPath))
if err != nil {
return fmt.Errorf("failed to create k8s client: %w", err)
}

if err := k8sClient.LoadMappingsFromKubernetes(); err != nil {
return fmt.Errorf("error loading dynamic mappings from kubernetes: %w", err)
}

if err := k8sClient.ApplyManifests(ctx, templateFiles); err != nil {
return fmt.Errorf("error applying templates: %w", err)
}

return nil
Expand Down

0 comments on commit 1ed84be

Please sign in to comment.