Skip to content

Commit 641ae1e

Browse files
committed
fix publish/unpublish twice error
1 parent ad62278 commit 641ae1e

File tree

4 files changed

+1125
-3
lines changed

4 files changed

+1125
-3
lines changed

datadog/fwprovider/resource_datadog_app_builder_app.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ var (
2929
_ resource.ResourceWithModifyPlan = &appBuilderAppResource{}
3030
)
3131

32-
var ErrDeploymentExists = "a deployment with the same app version already exists"
33-
var ErrAppAlreadyDisabled = "app already disabled"
32+
const ErrDeploymentExists = "this version of the app has already been published"
33+
const ErrAlreadyUnpublished = "this version of the app has already been unpublished"
3434

3535
type appBuilderAppResource struct {
3636
Api *datadogV2.AppBuilderApi
@@ -639,7 +639,7 @@ func handleAppBuilderPublishState(ctx context.Context, diags *diag.Diagnostics,
639639
}
640640

641641
// if error is related to the app already being unpublished, we can ignore it
642-
if strings.Contains(string(body), ErrAppAlreadyDisabled) {
642+
if strings.Contains(string(body), ErrAlreadyUnpublished) {
643643
return true
644644
}
645645
diags.AddError("error unpublishing app", string(body))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-10-30T19:11:07.296333-04:00

0 commit comments

Comments
 (0)