Skip to content

Commit feb7487

Browse files
Release/2.7.2 (#178)
* Fix Portal Object False Diff (#177) * Add acceptance tests for portal objects * OpenAPI changes * Generated provider and dependency updates * Update CHANGELOG.md * Bump version for github.com/Kong/shared-speakeasy/customtypes * tests: update domain to prevent unintended conflict * Bump version to 2.7.2
1 parent 8100884 commit feb7487

File tree

18 files changed

+261
-27
lines changed

18 files changed

+261
-27
lines changed

.speakeasy/gen.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 9d20c53e-7836-4ea8-88b8-a75fb7dce3a2
33
management:
4-
docChecksum: 41a63cf4311cedcc5cb26f85e0f7c2bd
4+
docChecksum: aa3a97868a10f80607f479b90527c9d1
55
docVersion: 2.0.0
66
speakeasyVersion: 1.541.2
77
generationVersion: 2.595.4
8-
releaseVersion: 2.7.1
9-
configChecksum: a2e5ba59a72f94f643bf86672ec2320b
8+
releaseVersion: 2.7.2
9+
configChecksum: db9e9fe5085728f581238a0a6a03792e
1010
features:
1111
terraform:
1212
additionalDependencies: 0.1.0

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 2.7.2
4+
> Released on 2025/05/06
5+
6+
### Bug fixes
7+
8+
* Fixed output of `terraform plan` for `konnect_api_product_document` and `konnect_api_product_specification` resources.
9+
310
## 2.7.1
411
> Released on 2025/05/01
512

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ terraform {
1717
required_providers {
1818
konnect = {
1919
source = "kong/konnect"
20-
version = "2.7.1"
20+
version = "2.7.2"
2121
}
2222
}
2323
}

gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ generation:
1717
oAuth2PasswordEnabled: false
1818
baseServerURL: ""
1919
terraform:
20-
version: 2.7.1
20+
version: 2.7.2
2121
additionalDataSources: []
2222
additionalDependencies: {}
2323
additionalEphemeralResources: []

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
module github.com/kong/terraform-provider-konnect/v2
22

3-
go 1.23.0
3+
go 1.23.4
44

55
require (
6+
github.com/Kong/shared-speakeasy/customtypes v0.1.0
67
github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05
78
github.com/hashicorp/go-uuid v1.0.3
89
github.com/hashicorp/terraform-plugin-docs v0.20.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
22
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
33
github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
44
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
5+
github.com/Kong/shared-speakeasy/customtypes v0.1.0 h1:xCEU9Dc7TJO5vuSxcH7Zi5/PUW7C6TMExGRJv9DjqJU=
6+
github.com/Kong/shared-speakeasy/customtypes v0.1.0/go.mod h1:R3le6Th+bdGiOaroady+wkiKULzpiMYFYcDJv/rKkSE=
57
github.com/Kunde21/markdownfmt/v3 v3.1.0 h1:KiZu9LKs+wFFBQKhrZJrFZwtLnCCWJahL+S+E/3VnM0=
68
github.com/Kunde21/markdownfmt/v3 v3.1.0/go.mod h1:tPXN1RTyOzJwhfHoon9wUr4HGYmWgVxSQN6VBJDkrVc=
79
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=

internal/provider/apiproductdocument_resource.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"context"
88
"encoding/json"
99
"fmt"
10+
"github.com/Kong/shared-speakeasy/customtypes/encodedstring"
1011
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
1112
"github.com/hashicorp/terraform-plugin-framework/path"
1213
"github.com/hashicorp/terraform-plugin-framework/resource"
@@ -35,16 +36,16 @@ type APIProductDocumentResource struct {
3536

3637
// APIProductDocumentResourceModel describes the resource data model.
3738
type APIProductDocumentResourceModel struct {
38-
APIProductID types.String `tfsdk:"api_product_id"`
39-
Content types.String `tfsdk:"content"`
40-
CreatedAt types.String `tfsdk:"created_at"`
41-
ID types.String `tfsdk:"id"`
42-
Metadata *tfTypes.Metadata `tfsdk:"metadata"`
43-
ParentDocumentID types.String `tfsdk:"parent_document_id"`
44-
Slug types.String `tfsdk:"slug"`
45-
Status types.String `tfsdk:"status"`
46-
Title types.String `tfsdk:"title"`
47-
UpdatedAt types.String `tfsdk:"updated_at"`
39+
APIProductID types.String `tfsdk:"api_product_id"`
40+
Content encodedstring.Base64OrPlainInput `tfsdk:"content"`
41+
CreatedAt types.String `tfsdk:"created_at"`
42+
ID types.String `tfsdk:"id"`
43+
Metadata *tfTypes.Metadata `tfsdk:"metadata"`
44+
ParentDocumentID types.String `tfsdk:"parent_document_id"`
45+
Slug types.String `tfsdk:"slug"`
46+
Status types.String `tfsdk:"status"`
47+
Title types.String `tfsdk:"title"`
48+
UpdatedAt types.String `tfsdk:"updated_at"`
4849
}
4950

5051
func (r *APIProductDocumentResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
@@ -60,6 +61,7 @@ func (r *APIProductDocumentResource) Schema(ctx context.Context, req resource.Sc
6061
Description: `The API product identifier`,
6162
},
6263
"content": schema.StringAttribute{
64+
CustomType: encodedstring.Base64OrPlainInputType{},
6365
Computed: true,
6466
Optional: true,
6567
Description: `Can be markdown string content or base64 encoded string`,

internal/provider/apiproductdocument_resource_sdk.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package provider
44

55
import (
66
"context"
7+
"github.com/Kong/shared-speakeasy/customtypes/encodedstring"
78
"github.com/hashicorp/terraform-plugin-framework/diag"
89
"github.com/hashicorp/terraform-plugin-framework/types"
910
"github.com/kong/terraform-provider-konnect/v2/internal/provider/typeconvert"
@@ -183,7 +184,9 @@ func (r *APIProductDocumentResourceModel) RefreshFromSharedAPIProductDocument(ct
183184
var diags diag.Diagnostics
184185

185186
if resp != nil {
186-
r.Content = types.StringValue(resp.Content)
187+
contentValuable, contentDiags := encodedstring.Base64OrPlainInputType{}.ValueFromString(ctx, types.StringValue(resp.Content))
188+
diags.Append(contentDiags...)
189+
r.Content, _ = contentValuable.(encodedstring.Base64OrPlainInput)
187190
r.CreatedAt = types.StringValue(typeconvert.TimeToString(resp.CreatedAt))
188191
r.ID = types.StringValue(resp.ID)
189192
if r.Metadata == nil {

internal/provider/apiproductspecification_resource.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"context"
88
"encoding/json"
99
"fmt"
10+
"github.com/Kong/shared-speakeasy/customtypes/encodedstring"
1011
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
1112
"github.com/hashicorp/terraform-plugin-framework/path"
1213
"github.com/hashicorp/terraform-plugin-framework/resource"
@@ -34,13 +35,13 @@ type APIProductSpecificationResource struct {
3435

3536
// APIProductSpecificationResourceModel describes the resource data model.
3637
type APIProductSpecificationResourceModel struct {
37-
APIProductID types.String `tfsdk:"api_product_id"`
38-
APIProductVersionID types.String `tfsdk:"api_product_version_id"`
39-
Content types.String `tfsdk:"content"`
40-
CreatedAt types.String `tfsdk:"created_at"`
41-
ID types.String `tfsdk:"id"`
42-
Name types.String `tfsdk:"name"`
43-
UpdatedAt types.String `tfsdk:"updated_at"`
38+
APIProductID types.String `tfsdk:"api_product_id"`
39+
APIProductVersionID types.String `tfsdk:"api_product_version_id"`
40+
Content encodedstring.Base64Input `tfsdk:"content"`
41+
CreatedAt types.String `tfsdk:"created_at"`
42+
ID types.String `tfsdk:"id"`
43+
Name types.String `tfsdk:"name"`
44+
UpdatedAt types.String `tfsdk:"updated_at"`
4445
}
4546

4647
func (r *APIProductSpecificationResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
@@ -60,6 +61,7 @@ func (r *APIProductSpecificationResource) Schema(ctx context.Context, req resour
6061
Description: `The API product version identifier`,
6162
},
6263
"content": schema.StringAttribute{
64+
CustomType: encodedstring.Base64InputType{},
6365
Required: true,
6466
Description: `The base64 encoded contents of the API product version specification`,
6567
Validators: []validator.String{

internal/provider/apiproductspecification_resource_sdk.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package provider
44

55
import (
66
"context"
7+
"github.com/Kong/shared-speakeasy/customtypes/encodedstring"
78
"github.com/hashicorp/terraform-plugin-framework/diag"
89
"github.com/hashicorp/terraform-plugin-framework/types"
910
"github.com/kong/terraform-provider-konnect/v2/internal/provider/typeconvert"
@@ -151,7 +152,9 @@ func (r *APIProductSpecificationResourceModel) RefreshFromSharedAPIProductVersio
151152
var diags diag.Diagnostics
152153

153154
if resp != nil {
154-
r.Content = types.StringValue(resp.Content)
155+
contentValuable, contentDiags := encodedstring.Base64InputType{}.ValueFromString(ctx, types.StringValue(resp.Content))
156+
diags.Append(contentDiags...)
157+
r.Content, _ = contentValuable.(encodedstring.Base64Input)
155158
r.CreatedAt = types.StringValue(typeconvert.TimeToString(resp.CreatedAt))
156159
r.ID = types.StringValue(resp.ID)
157160
r.Name = types.StringValue(resp.Name)

0 commit comments

Comments
 (0)