Skip to content

Commit

Permalink
chore: ensure missing artifactory generic feeds are removed from state
Browse files Browse the repository at this point in the history
  • Loading branch information
hnrkndrssn committed Aug 8, 2024
1 parent 929d941 commit 601c58b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion octopusdeploy_framework/resource_artifactory_generic_feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package octopusdeploy_framework
import (
"context"
"fmt"

"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/core"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/internal/errors"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/schemas"
"github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/util"
"github.com/hashicorp/terraform-plugin-framework/attr"
Expand Down Expand Up @@ -77,7 +79,9 @@ func (r *artifactoryGenericFeedTypeResource) Read(ctx context.Context, req resou
client := r.Config.Client
feed, err := feeds.GetByID(client, data.SpaceID.ValueString(), data.ID.ValueString())
if err != nil {
resp.Diagnostics.AddError("unable to load artifactoryGeneric feed", err.Error())
if err := errors.ProcessApiErrorV2(ctx, resp, data, err, "artifactory generic feed"); err != nil {
resp.Diagnostics.AddError("unable to load artifactoryGeneric feed", err.Error())
}
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ func GetArtifactoryGenericFeedResourceSchema() map[string]resourceSchema.Attribu
}

type ArtifactoryGenericFeedTypeResourceModel struct {
ResourceModel
FeedUri types.String `tfsdk:"feed_uri"`
ID types.String `tfsdk:"id"`
Name types.String `tfsdk:"name"`
PackageAcquisitionLocationOptions types.List `tfsdk:"package_acquisition_location_options"`
Password types.String `tfsdk:"password"`
Expand Down

0 comments on commit 601c58b

Please sign in to comment.