Skip to content

Commit

Permalink
fix duplicate file apply
Browse files Browse the repository at this point in the history
  • Loading branch information
jarededwards committed Dec 7, 2024
1 parent 1ed84be commit 04bda4e
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions cmd/addipmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,21 @@ func getAddIPMICommand() *cobra.Command {
return fmt.Errorf("error executing template: %w", err)
}
}
}

files, err := os.ReadDir(filepath.Join(homeDir, constants.ColonyDir, "ipmi"))
if err != nil {
return fmt.Errorf("failed to open directory: %w", err)
}
files, err := os.ReadDir(filepath.Join(homeDir, constants.ColonyDir, "ipmi"))
if err != nil {
return fmt.Errorf("failed to open directory: %w", err)
}

for _, file := range files {
content, err := os.ReadFile(filepath.Join(homeDir, constants.ColonyDir, "ipmi", file.Name()))
if err != nil {
return fmt.Errorf("failed to read file: %w", err)
}
templateFiles = append(templateFiles, string(content))
for _, file := range files {
content, err := os.ReadFile(filepath.Join(homeDir, constants.ColonyDir, "ipmi", file.Name()))
if err != nil {
return fmt.Errorf("failed to read file: %w", err)
}
log.Info(templateFiles)

templateFiles = append(templateFiles, string(content))
}

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)
Expand Down

0 comments on commit 04bda4e

Please sign in to comment.