Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions internal/connector/common/common_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"slices"
"strings"
"text/template"
"time"

"github.com/pingidentity/pingcli/internal/connector"
"github.com/pingidentity/pingcli/internal/customtypes"
Expand Down Expand Up @@ -91,15 +90,9 @@ func writeHeader(format, outputFilePath string, outputFile *os.File) error {
return fmt.Errorf("failed to parse HCL import header template. err: %s", err.Error())
}

header := struct {
DateTime string
}{
DateTime: time.Now().Format(time.RFC1123),
}

switch format {
case customtypes.ENUM_EXPORT_FORMAT_HCL:
err := hclImportHeaderTemplate.Execute(outputFile, header)
err := hclImportHeaderTemplate.Execute(outputFile, nil)
if err != nil {
return fmt.Errorf("failed to write import template to file %q. err: %s", outputFilePath, err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion internal/connector/templates/hcl_import_header.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#######################################################################################################################
#
# Generated by Ping CLI: {{.DateTime}}
# Generated by Ping CLI:
# https://github.com/pingidentity/pingcli
#
# Using the Terraform import blocks generated in this file, Terraform HCL can be generated and resource
Expand Down