From 5ad2c19e7b96a3a67e5de585be76e11f0773c1e8 Mon Sep 17 00:00:00 2001 From: Shurkys Date: Wed, 15 Jan 2025 01:33:23 +0200 Subject: [PATCH] fix lint --- routers/api/packages/terraform/terraform.go | 5 ----- templates/package/content/terraform.tmpl | 16 ++++++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/routers/api/packages/terraform/terraform.go b/routers/api/packages/terraform/terraform.go index f0948fbbd8..e213d76ef1 100644 --- a/routers/api/packages/terraform/terraform.go +++ b/routers/api/packages/terraform/terraform.go @@ -331,11 +331,6 @@ func UnlockState(ctx *context.Context) { _ = json.Unmarshal(body, &unlockRequest) // The error can be ignored, since the ID can also be in the query } - // If the ID is not found in the body, look in the query parameters - if unlockRequest.ID == "" { - unlockRequest.ID = ctx.Query("ID").(string) - } - // Check for ID presence if unlockRequest.ID == "" { log.Error("Missing lock ID in both query and request body") diff --git a/templates/package/content/terraform.tmpl b/templates/package/content/terraform.tmpl index 8d6ddd57d2..c59713c0db 100644 --- a/templates/package/content/terraform.tmpl +++ b/templates/package/content/terraform.tmpl @@ -8,14 +8,14 @@ export GITEA_USER_PASSWORD=<YOUR-USER-PASSWORD> export TF_STATE_NAME=your-state.tfstate terraform init \ - -backend-config="address= \ - -backend-config="lock_address= \ - -backend-config="unlock_address= \ - -backend-config="username={{.PackageDescriptor.Owner.Name}}" \ - -backend-config="password=$GITEA_USER_PASSWORD" \ - -backend-config="lock_method=POST" \ - -backend-config="unlock_method=DELETE" \ - -backend-config="retry_wait_min=5" + -backend-config="address= \ + -backend-config="lock_address= \ + -backend-config="unlock_address= \ + -backend-config="username={{.PackageDescriptor.Owner.Name}}" \ + -backend-config="password=$GITEA_USER_PASSWORD" \ + -backend-config="lock_method=POST" \ + -backend-config="unlock_method=DELETE" \ + -backend-config="retry_wait_min=5"