From 10e0313926cb5e6d3e249c2351769da202018b19 Mon Sep 17 00:00:00 2001 From: Alex Hung Date: Mon, 30 Sep 2024 11:55:33 -0700 Subject: [PATCH] Add webhook type check for deprecated resource --- .../resource/webhook/resource_artifactory_custom_webhook.go | 2 +- .../webhook/resource_artifactory_webhook_release_bundle.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/artifactory/resource/webhook/resource_artifactory_custom_webhook.go b/pkg/artifactory/resource/webhook/resource_artifactory_custom_webhook.go index 80528e83..bd995e86 100644 --- a/pkg/artifactory/resource/webhook/resource_artifactory_custom_webhook.go +++ b/pkg/artifactory/resource/webhook/resource_artifactory_custom_webhook.go @@ -571,7 +571,7 @@ func ResourceArtifactoryCustomWebhook(webhookType string) *schema.Resource { Description: "Provides an Artifactory webhook resource", } - if webhookType == "artifactory_release_bundle" { + if webhookType == ReleaseBundleDomain { rs.DeprecationMessage = "This resource is being deprecated and replaced by artifactory_destination_custom_webhook resource" } diff --git a/pkg/artifactory/resource/webhook/resource_artifactory_webhook_release_bundle.go b/pkg/artifactory/resource/webhook/resource_artifactory_webhook_release_bundle.go index a1933dc1..df4d6c38 100644 --- a/pkg/artifactory/resource/webhook/resource_artifactory_webhook_release_bundle.go +++ b/pkg/artifactory/resource/webhook/resource_artifactory_webhook_release_bundle.go @@ -98,6 +98,9 @@ func (r *ReleaseBundleWebhookResource) Schema(ctx context.Context, req resource. } resp.Schema = r.schema(r.Domain, &criteriaBlock) + if r.Domain == ReleaseBundleDomain { + resp.Schema.DeprecationMessage = "This resource is being deprecated and replaced by artifactory_destination_webhook resource" + } } func (r *ReleaseBundleWebhookResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) {