From 9640af4556bc3c0b07a8aa138d2d61148a54c5e9 Mon Sep 17 00:00:00 2001 From: Yunkon Kim Date: Thu, 14 Nov 2024 21:45:17 +0900 Subject: [PATCH] Fix typo and remove unused field in OutputSQLDBInfo struct --- pkg/api/rest/handler/sql-db.go | 2 +- pkg/api/rest/model/sql-db.go | 1 - pkg/tofu/tofu.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/api/rest/handler/sql-db.go b/pkg/api/rest/handler/sql-db.go index b430dbd..cf57f26 100644 --- a/pkg/api/rest/handler/sql-db.go +++ b/pkg/api/rest/handler/sql-db.go @@ -320,7 +320,7 @@ func CreateInfracodeForSqlDb(c echo.Context) error { req.TfVars.TerrariumID = trId } - err = tofu.SavTfVarsToFile(req.TfVars, tfVarsPath) + err = tofu.SaveTfVarsToFile(req.TfVars, tfVarsPath) if err != nil { err2 := fmt.Errorf("failed to save tfVars to a file") log.Error().Err(err).Msg(err2.Error()) diff --git a/pkg/api/rest/model/sql-db.go b/pkg/api/rest/model/sql-db.go index cb4e648..b13893c 100644 --- a/pkg/api/rest/model/sql-db.go +++ b/pkg/api/rest/model/sql-db.go @@ -22,7 +22,6 @@ type TfVarsSqlDb struct { type OutputSQLDBInfo struct { Terrarium Terrarium `json:"terrarium"` SQLDBDetail SQLDBDetail `json:"sql_db_detail"` - Description string `json:"description"` } type Terrarium struct { diff --git a/pkg/tofu/tofu.go b/pkg/tofu/tofu.go index ef1ae2f..39ebb12 100644 --- a/pkg/tofu/tofu.go +++ b/pkg/tofu/tofu.go @@ -349,7 +349,7 @@ func CopyFiles(sourceDir, destDir string) error { return nil } -func SavTfVarsToFile(tfVars interface{}, filePath string) error { +func SaveTfVarsToFile(tfVars interface{}, filePath string) error { tfVarsBytes, err := json.MarshalIndent(tfVars, "", " ") if err != nil { return err