diff --git a/pkg/cmd/render/render.go b/pkg/cmd/render/render.go index 4a4c74517..e48806f56 100644 --- a/pkg/cmd/render/render.go +++ b/pkg/cmd/render/render.go @@ -2,7 +2,6 @@ package render import ( "fmt" - "io/ioutil" "os" "path/filepath" @@ -123,7 +122,7 @@ func (r *renderOpts) Run() error { renderConfig := TemplateData{} if len(r.clusterConfigFile) > 0 { - _, err := ioutil.ReadFile(r.clusterConfigFile) + _, err := os.ReadFile(r.clusterConfigFile) if err != nil { return err } @@ -158,7 +157,7 @@ func (r *renderOpts) Run() error { if err := os.MkdirAll(filepath.Dir(r.cloudProviderConfigOutputFile), 0755); err != nil { return fmt.Errorf("failed to create %v: %w", r.cloudProviderConfigOutputFile, err) } - if err := ioutil.WriteFile(r.cloudProviderConfigOutputFile, targetCloudConfigMapData, 0644); err != nil { + if err := os.WriteFile(r.cloudProviderConfigOutputFile, targetCloudConfigMapData, 0644); err != nil { return fmt.Errorf("failed to write merged config to %q: %v", r.cloudProviderConfigOutputFile, err) } } diff --git a/pkg/operator/kube_cloud_config/bootstrap.go b/pkg/operator/kube_cloud_config/bootstrap.go index 09f5baa03..64c134295 100644 --- a/pkg/operator/kube_cloud_config/bootstrap.go +++ b/pkg/operator/kube_cloud_config/bootstrap.go @@ -2,7 +2,6 @@ package kubecloudconfig import ( "fmt" - "io/ioutil" "os" corev1 "k8s.io/api/core/v1" @@ -34,7 +33,7 @@ func BootstrapTransform(infrastructureFile string, cloudProviderFile string) ([] // Read, parse, and save the infrastructure object var clusterInfrastructure configv1.Infrastructure - fileData, err := ioutil.ReadFile(infrastructureFile) + fileData, err := os.ReadFile(infrastructureFile) if err != nil { return nil, fmt.Errorf("failed to read infrastructure file: %w", err) } @@ -46,7 +45,7 @@ func BootstrapTransform(infrastructureFile string, cloudProviderFile string) ([] // Read, parse, and save the user provided cloud configmap var cloudProviderConfigInput corev1.ConfigMap if len(cloudProviderFile) > 0 { - fileData, err = ioutil.ReadFile(cloudProviderFile) + fileData, err = os.ReadFile(cloudProviderFile) if err != nil { return nil, fmt.Errorf("failed to read cloud provider file: %w", err) }