diff --git a/pkg/controller/template/manager.go b/pkg/controller/template/manager.go index 80c8bd3d..0747ab6c 100644 --- a/pkg/controller/template/manager.go +++ b/pkg/controller/template/manager.go @@ -3,7 +3,7 @@ package template import ( "bytes" "fmt" - "io/ioutil" + "os" "path/filepath" "text/template" @@ -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) } diff --git a/pkg/controller/template/template.go b/pkg/controller/template/template.go index e6f3f14f..1a414817 100644 --- a/pkg/controller/template/template.go +++ b/pkg/controller/template/template.go @@ -3,7 +3,6 @@ package template import ( "bytes" "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -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)