From 0208cbd96008477fc40c6d7dd44542104e8683df Mon Sep 17 00:00:00 2001 From: Tobias Trabelsi Date: Fri, 8 Jul 2022 21:50:09 +0200 Subject: [PATCH] #5 fixed state handling for public keys --- Makefile | 2 +- examples/provider.tf | 2 +- gitea/resource_gitea_public_key.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8ae9eeb..dc91e40 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) GOFMT ?= gofmt -s -VERSION = 0.6.0 +VERSION = 0.6.1 test: fmt-check go test -i $(TEST) || exit 1 diff --git a/examples/provider.tf b/examples/provider.tf index b523a8e..0e08f75 100644 --- a/examples/provider.tf +++ b/examples/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { gitea = { source = "terraform.local/lerentis/gitea" - version = "0.6.0" + version = "0.6.1" } } } diff --git a/gitea/resource_gitea_public_key.go b/gitea/resource_gitea_public_key.go index 8a64ad3..c83a39f 100644 --- a/gitea/resource_gitea_public_key.go +++ b/gitea/resource_gitea_public_key.go @@ -91,9 +91,9 @@ func resourcePublicKeyDelete(d *schema.ResourceData, meta interface{}) (err erro func setPublicKeyResourceData(pubKey *gitea.PublicKey, d *schema.ResourceData) (err error) { d.SetId(fmt.Sprintf("%d", pubKey.ID)) d.Set(PublicKeyUser, d.Get(PublicKeyUser).(string)) - d.Set(PublicKey, pubKey.Key) + d.Set(PublicKey, d.Get(PublicKey).(string)) d.Set(PublicKeyTitle, pubKey.Title) - d.Set(PublicKeyReadOnlyFlag, pubKey.ReadOnly) + d.Set(PublicKeyReadOnlyFlag, d.Get(PublicKeyReadOnlyFlag).(bool)) d.Set(PublicKeyCreated, pubKey.Created) d.Set(PublicKeyFingerprint, pubKey.Fingerprint) d.Set(PublicKeyType, pubKey.KeyType)