Skip to content

Commit

Permalink
feat: expose app metadata (#148)
Browse files Browse the repository at this point in the history
* chore: update app resource

* update dependencies
  • Loading branch information
jonmorehouse authored Jun 4, 2024
1 parent bdfbdc6 commit e442d00
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0
github.com/hashicorp/terraform-plugin-testing v1.5.1
github.com/mitchellh/go-homedir v1.1.0
github.com/nuonco/nuon-go v0.29.0
github.com/nuonco/nuon-go v0.29.1
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ github.com/nuonco/nuon-go v0.28.1 h1:mFcFDtoM5BFjRvt50aK2w9/Lgzz5i+fuVLumgMSfeHA
github.com/nuonco/nuon-go v0.28.1/go.mod h1:9hQTXgG2MUXaAtW8SN3X6yiWPs4Z4LcIr+CqhECklGI=
github.com/nuonco/nuon-go v0.29.0 h1:xX/Co0Cdb7joWwGTNwLW9OMNcdMTvEN3znIuHEctZUE=
github.com/nuonco/nuon-go v0.29.0/go.mod h1:9hQTXgG2MUXaAtW8SN3X6yiWPs4Z4LcIr+CqhECklGI=
github.com/nuonco/nuon-go v0.29.1 h1:cIPOvfbGHCsFsKfwMbBOpf3r1RWdVP2HGtfmY1ebh24=
github.com/nuonco/nuon-go v0.29.1/go.mod h1:9hQTXgG2MUXaAtW8SN3X6yiWPs4Z4LcIr+CqhECklGI=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
Expand Down
8 changes: 1 addition & 7 deletions internal/provider/app_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ func (r *AppResource) Create(ctx context.Context, req resource.CreateRequest, re
if appResp.Description != "" {
data.Description = types.StringValue(appResp.Description)
}
if appResp.SlackWebhookURL != "" {
data.SlackWebhookURL = types.StringValue(appResp.SlackWebhookURL)
}

// return populated terraform model
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
Expand Down Expand Up @@ -179,7 +176,7 @@ func (r *AppResource) Read(ctx context.Context, req resource.ReadRequest, resp *
data.Id = types.StringValue(appResp.ID)
data.Description = types.StringValue(appResp.Description)
data.DisplayName = types.StringValue(appResp.DisplayName)
data.SlackWebhookURL = types.StringValue(appResp.SlackWebhookURL)
data.SlackWebhookURL = types.StringValue(appResp.NotificationsConfig.SlackWebhookURL)

// return populated terraform model
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
Expand Down Expand Up @@ -226,9 +223,6 @@ func (r *AppResource) Update(ctx context.Context, req resource.UpdateRequest, re
if appResp.Description != "" {
data.Description = types.StringValue(appResp.Description)
}
if appResp.SlackWebhookURL != "" {
data.SlackWebhookURL = types.StringValue(appResp.SlackWebhookURL)
}

// return populated terraform model
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
Expand Down

0 comments on commit e442d00

Please sign in to comment.