Skip to content

Commit

Permalink
Merge pull request #116 from jfrog/dependabot/go_modules/github.com/j…
Browse files Browse the repository at this point in the history
…frog/terraform-provider-shared-1.25.1

Bump github.com/jfrog/terraform-provider-shared from 1.22.0 to 1.25.1
  • Loading branch information
alexhung authored May 3, 2024
2 parents df70dd0 + 1d99e12 commit 5fd1b42
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0
github.com/hashicorp/terraform-plugin-testing v1.7.0
github.com/jfrog/terraform-provider-shared v1.22.0
github.com/jfrog/terraform-provider-shared v1.25.1
github.com/samber/lo v1.39.0
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM=
github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jfrog/terraform-provider-shared v1.22.0 h1:6nmAltCTz/dvPDprK4iYFB9huwiJDiTHWOkOoVqQTgg=
github.com/jfrog/terraform-provider-shared v1.22.0/go.mod h1:rIiQMiefaHAlsh+vSCX+7W4tilJcqgQZLGwlHRqLMSg=
github.com/jfrog/terraform-provider-shared v1.25.1 h1:ndbE78OvIUy5QfjnxCs7xq/M0PwBVk2p2FU3Gr4M6G0=
github.com/jfrog/terraform-provider-shared v1.25.1/go.mod h1:L987Z8XO4cuv7ys4Tw6sP/LESw7z0Dji0U2ysR8FUP4=
github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c=
github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
Expand Down
6 changes: 3 additions & 3 deletions pkg/project/membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ var readMembers = func(ctx context.Context, projectKey string, membershipType st
membership := Membership{}

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectKey,
"membershipType": membershipType,
Expand Down Expand Up @@ -170,7 +170,7 @@ var updateMember = func(ctx context.Context, projectKey string, membershipType s
}

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectKey,
"membershipType": membershipType,
Expand Down Expand Up @@ -211,7 +211,7 @@ var deleteMember = func(ctx context.Context, projectKey string, membershipType s
}

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectKey,
"membershipType": membershipType,
Expand Down
8 changes: 4 additions & 4 deletions pkg/project/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, terraformVer

checkLicense := d.Get("check_license").(bool)
if checkLicense {
licenseErr := sdk.CheckArtifactoryLicense(restyBase, "Enterprise", "Commercial", "Edge")
licenseErr := util.CheckArtifactoryLicense(restyBase, "Enterprise", "Commercial", "Edge")
if licenseErr != nil {
return nil, licenseErr
return nil, diag.FromErr(licenseErr)
}
}

Expand All @@ -103,9 +103,9 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, terraformVer
}

featureUsage := fmt.Sprintf("Terraform/%s", terraformVersion)
util.SendUsage(ctx, restyBase, productId, featureUsage)
util.SendUsage(ctx, restyBase.R(), productId, featureUsage)

return util.ProvderMetadata{
return util.ProviderMetadata{
Client: restyBase,
ArtifactoryVersion: version,
}, nil
Expand Down
6 changes: 3 additions & 3 deletions pkg/project/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var readRepos = func(ctx context.Context, projectKey string, m interface{}) ([]R
artifactoryRepos := []ArtifactoryRepo{}

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParam("projectKey", projectKey).
SetResult(&artifactoryRepos).
SetError(&projectError).
Expand Down Expand Up @@ -114,7 +114,7 @@ var updateRepos = func(ctx context.Context, projectKey string, terraformRepoKeys
var addRepos = func(ctx context.Context, projectKey string, repoKeys []RepoKey, m interface{}) error {
tflog.Debug(ctx, fmt.Sprintf("addRepos: %s", repoKeys))

req := m.(util.ProvderMetadata).Client.R().
req := m.(util.ProviderMetadata).Client.R().
AddRetryCondition(retryOnSpecificMsgBody("A timeout occurred")).
AddRetryCondition(retryOnSpecificMsgBody("Web server is down")).
AddRetryCondition(retryOnSpecificMsgBody("Web server is returning an unknown error"))
Expand Down Expand Up @@ -154,7 +154,7 @@ var addRepo = func(ctx context.Context, projectKey string, repoKey RepoKey, req
var deleteRepos = func(ctx context.Context, repoKeys []RepoKey, m interface{}) error {
tflog.Debug(ctx, fmt.Sprintf("deleteRepos: %s", repoKeys))

req := m.(util.ProvderMetadata).Client.R().
req := m.(util.ProviderMetadata).Client.R().
AddRetryCondition(retryOnSpecificMsgBody("A timeout occurred")).
AddRetryCondition(retryOnSpecificMsgBody("Web server is down")).
AddRetryCondition(retryOnSpecificMsgBody("Web server is returning an unknown error"))
Expand Down
8 changes: 4 additions & 4 deletions pkg/project/resource_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ func projectResource() *schema.Resource {
project := Project{}

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParam("projectKey", data.Id()).
SetResult(&project).
SetError(&projectError).
Expand Down Expand Up @@ -504,7 +504,7 @@ func projectResource() *schema.Resource {
}

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetBody(project).
SetError(&projectError).
Post(projectsUrl)
Expand Down Expand Up @@ -563,7 +563,7 @@ func projectResource() *schema.Resource {
}

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParam("projectKey", data.Id()).
SetBody(project).
SetError(&projectError).
Expand Down Expand Up @@ -627,7 +627,7 @@ func projectResource() *schema.Resource {
return diag.FromErr(fmt.Errorf("failed to delete repos for project: %s", deleteErr))
}

req := m.(util.ProvderMetadata).Client.R()
req := m.(util.ProviderMetadata).Client.R()
req.AddRetryCondition(
func(r *resty.Response, _ error) bool {
return r.StatusCode() == http.StatusBadRequest &&
Expand Down
8 changes: 4 additions & 4 deletions pkg/project/resource_project_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func projectEnvironmentResource() *schema.Resource {
var envs []ProjectEnvironment

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParam("projectKey", projectKey).
SetResult(&envs).
SetError(&projectError).
Expand Down Expand Up @@ -102,7 +102,7 @@ func projectEnvironmentResource() *schema.Resource {
}

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParam("projectKey", projectKey).
SetBody(projectEnvironment).
SetError(&projectError).
Expand All @@ -128,7 +128,7 @@ func projectEnvironmentResource() *schema.Resource {
}

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectKey,
"environmentName": fmt.Sprintf("%s-%s", projectKey, oldName),
Expand All @@ -153,7 +153,7 @@ func projectEnvironmentResource() *schema.Resource {
projectKey := data.Get("project_key").(string)

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectKey,
"environmentName": fmt.Sprintf("%s-%s", projectKey, data.Get("name")),
Expand Down
6 changes: 3 additions & 3 deletions pkg/project/resource_project_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func projectGroupResource() *schema.Resource {
var loadedProjectGroup ProjectGroup

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectGroup.ProjectKey,
"name": projectGroup.Name,
Expand Down Expand Up @@ -106,7 +106,7 @@ func projectGroupResource() *schema.Resource {
projectGroup := unpackProjectGroup(data)

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectGroup.ProjectKey,
"name": projectGroup.Name,
Expand All @@ -131,7 +131,7 @@ func projectGroupResource() *schema.Resource {
projectGroup := unpackProjectGroup(data)

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectGroup.ProjectKey,
"name": projectGroup.Name,
Expand Down
8 changes: 4 additions & 4 deletions pkg/project/resource_project_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func projectRepositoryResource() *schema.Resource {
repoKey := data.Get("key").(string)

var repo Repository
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetResult(&repo).
SetPathParam("key", repoKey).
Get(repositoryEndpoint)
Expand Down Expand Up @@ -97,7 +97,7 @@ func projectRepositoryResource() *schema.Resource {
repoKey := data.Get("key").(string)

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectKey,
"repoKey": repoKey,
Expand All @@ -114,7 +114,7 @@ func projectRepositoryResource() *schema.Resource {

retryError := retry.RetryContext(ctx, data.Timeout(schema.TimeoutCreate), func() *retry.RetryError {
var repo Repository
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetResult(&repo).
SetPathParam("key", repoKey).
Get(repositoryEndpoint)
Expand Down Expand Up @@ -149,7 +149,7 @@ func projectRepositoryResource() *schema.Resource {
repoKey := data.Get("key").(string)

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParam("repoKey", repoKey).
SetError(&projectError).
Delete("/access/api/v1/projects/_/attach/repositories/{repoKey}")
Expand Down
8 changes: 4 additions & 4 deletions pkg/project/resource_project_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func projectRoleResource() *schema.Resource {
projectKey := data.Get("project_key").(string)

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectKey,
"roleName": data.Id(),
Expand Down Expand Up @@ -172,7 +172,7 @@ func projectRoleResource() *schema.Resource {
role := unpackRole(data)

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParam("projectKey", projectKey).
SetBody(role).
SetError(&projectError).
Expand All @@ -195,7 +195,7 @@ func projectRoleResource() *schema.Resource {
role := unpackRole(data)

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectKey,
"roleName": role.Name,
Expand All @@ -218,7 +218,7 @@ func projectRoleResource() *schema.Resource {

var deleteProjectRole = func(ctx context.Context, data *schema.ResourceData, m interface{}) diag.Diagnostics {
var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"roleName": data.Id(),
"projectKey": data.Get("project_key").(string),
Expand Down
6 changes: 3 additions & 3 deletions pkg/project/resource_project_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func projectUserResource() *schema.Resource {
var loadedProjectUser ProjectUser

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectUser.ProjectKey,
"name": projectUser.Name,
Expand Down Expand Up @@ -115,7 +115,7 @@ func projectUserResource() *schema.Resource {
projectUser := unpackProjectUser(data)

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectUser.ProjectKey,
"name": projectUser.Name,
Expand Down Expand Up @@ -158,7 +158,7 @@ func projectUserResource() *schema.Resource {
projectUser := unpackProjectUser(data)

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectUser.ProjectKey,
"name": projectUser.Name,
Expand Down
8 changes: 4 additions & 4 deletions pkg/project/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var readRoles = func(ctx context.Context, projectKey string, m interface{}) ([]R
roles := []Role{}

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParam("projectKey", projectKey).
SetResult(&roles).
SetError(&projectError).
Expand Down Expand Up @@ -152,7 +152,7 @@ var addRole = func(ctx context.Context, projectKey string, role Role, m interfac
tflog.Debug(ctx, "addRole")

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParam("projectKey", projectKey).
SetBody(role).
SetError(&projectError).
Expand All @@ -171,7 +171,7 @@ var updateRole = func(ctx context.Context, projectKey string, role Role, m inter
tflog.Debug(ctx, "updateRole")

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectKey,
"roleName": role.Name,
Expand Down Expand Up @@ -207,7 +207,7 @@ var deleteRole = func(ctx context.Context, projectKey string, role Role, m inter
tflog.Trace(ctx, fmt.Sprintf("%+v\n", role))

var projectError ProjectErrorsResponse
resp, err := m.(util.ProvderMetadata).Client.R().
resp, err := m.(util.ProviderMetadata).Client.R().
SetPathParams(map[string]string{
"projectKey": projectKey,
"roleName": role.Name,
Expand Down
2 changes: 1 addition & 1 deletion pkg/project/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func verifyDeleted(id string, check CheckFun) func(*terraform.State) error {
return fmt.Errorf("error: Resource id [%s] not found", id)
}

client := TestProvider.Meta().(util.ProvderMetadata).Client
client := TestProvider.Meta().(util.ProviderMetadata).Client
resp, err := check(rs.Primary.ID, client.R())
if err != nil {
return err
Expand Down

0 comments on commit 5fd1b42

Please sign in to comment.