pkg/terraform: Fix comments
@@ -12,14 +12,14 @@ import (
const backendFileName = "backend.tf"
-// Configure calls supporting menthods to create Teraform directories, modules
-// and create terraform backend file if user has provided.
+// Configure creates Terraform directories and modules as well as a Terraform backend file if
+// provided by the user.
func Configure(assetDir, renderedBackend string) error {
if err := PrepareTerraformDirectoryAndModules(assetDir); err != nil {
return errors.Wrapf(err, "Failed to create required terraform directory")
}
- // Create backend file only if there content in the backend rendered string.
+ // Create backend file only if the backend rendered string isn't empty.
if len(strings.TrimSpace(renderedBackend)) <= 0 {
return nil
}
@@ -31,8 +31,7 @@ func Configure(assetDir, renderedBackend string) error {
return nil
}
-// PrepareTerraformDirectoryAndModules creates terraform directory and downloads
-// required modules.
+// PrepareTerraformDirectoryAndModules creates a Terraform directory and downloads required modules.
func PrepareTerraformDirectoryAndModules(assetDir string) error {
terraformModuleDir := filepath.Join(assetDir, "lokomotive-kubernetes")
if err := install.PrepareLokomotiveTerraformModuleAt(terraformModuleDir); err != nil {
@@ -47,12 +46,12 @@ func PrepareTerraformDirectoryAndModules(assetDir string) error {
return nil
}
-// GetTerraformRootDir gets the terraform directory path
+// GetTerraformRootDir gets the Terraform directory path.
func GetTerraformRootDir(assetDir string) string {
return filepath.Join(assetDir, "terraform")
}
-// CreateTerraformBackendFile creates the terraform backend configuration file
+// CreateTerraformBackendFile creates the Terraform backend configuration file.
func CreateTerraformBackendFile(assetDir, data string) error {
backendString := fmt.Sprintf("terraform {%s}\n", data)
terraformRootDir := GetTerraformRootDir(assetDir)
