Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
Signed-off-by: weizhoublue <[email protected]>
  • Loading branch information
weizhoublue committed Dec 25, 2024
1 parent 067af7c commit 474527a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/template/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package template
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"text/template"

Expand All @@ -30,7 +30,7 @@ func NewManager(templateDir string) *Manager {
// RenderYAML renders a YAML template with the given data
func (m *Manager) RenderYAML(templateName string, data map[string]interface{}) (*unstructured.Unstructured, error) {
templatePath := filepath.Join(m.templateDir, templateName)
content, err := ioutil.ReadFile(templatePath)
content, err := os.ReadFile(templatePath)
if err != nil {
return nil, fmt.Errorf("failed to read template %s: %v", templatePath, err)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/controller/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package template
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -53,7 +52,7 @@ func RenderTemplate(templateName string, data *TemplateData) (*unstructured.Unst
log.Logger.Infof("Starting template rendering: %s", templateName)

templatePath := filepath.Join("/etc/bmc/templates", templateName)
templateContent, err := ioutil.ReadFile(templatePath)
templateContent, err := os.ReadFile(templatePath)
if err != nil {
log.Logger.Errorf("Failed to read template file %s: %v", templatePath, err)
return nil, fmt.Errorf("failed to read template file %s: %v", templatePath, err)
Expand Down

0 comments on commit 474527a

Please sign in to comment.