Skip to content

Commit

Permalink
Merge branch 'feature/fix-setting-creation' of https://github.com/pna…
Browse files Browse the repository at this point in the history
…g90/terraform-provider-sonarqube into feature/fix-setting-creation
  • Loading branch information
pnag90 committed Dec 18, 2023
2 parents 0b61a28 + a4dc079 commit d6f9e0e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ go 1.18

require (
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-retryablehttp v0.7.4
github.com/hashicorp/go-retryablehttp v0.7.5
github.com/hashicorp/go-version v1.6.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.28.0
github.com/hashicorp/terraform-plugin-testing v1.5.1
github.com/satori/uuid v1.2.0
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819
)

require (
Expand All @@ -18,7 +19,6 @@ require (
github.com/tidwall/pretty v1.2.0 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 // indirect
)

require (
Expand Down Expand Up @@ -62,6 +62,6 @@ require (
golang.org/x/text v0.13.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.1 // indirect
google.golang.org/grpc v1.56.3 // indirect
google.golang.org/protobuf v1.31.0 // indirect
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk=
github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0=
github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA=
github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M=
github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
Expand Down Expand Up @@ -173,8 +173,8 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ=
google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=
google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
Expand Down
2 changes: 1 addition & 1 deletion sonarqube/resource_sonarqube_alm_gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func resourceSonarqubeAlmGitlabUpdate(d *schema.ResourceData, m interface{}) err
m.(*ProviderConfiguration).httpClient,
"POST",
sonarQubeURL.String(),
http.StatusOK,
http.StatusNoContent,
"resourceSonarqubeAlmGitlabUpdate",
)
if err != nil {
Expand Down
17 changes: 12 additions & 5 deletions sonarqube/resource_sonarqube_qualityprofile_project_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func resourceSonarqubeQualityProfileProjectAssociationRead(d *schema.ResourceDat

// Id is composed of qualityProfile name and project name
idSlice := strings.Split(d.Id(), "/")

// Call api/qualityprofiles/search to return the qualityProfileID
sonarQubeURL := m.(*ProviderConfiguration).sonarQubeURL
sonarQubeURLSubPath := sonarQubeURL.Path
Expand All @@ -124,10 +123,18 @@ func resourceSonarqubeQualityProfileProjectAssociationRead(d *schema.ResourceDat

var qualityProfileID string
for _, value := range getQualityProfileResponse.Profiles {
if idSlice[0] == value.Name && idSlice[2] == value.Language {
qualityProfileID = value.Key
language = value.Language
qualityProfile = value.Name
if len(idSlice) == 3 {
if idSlice[0] == value.Name && idSlice[2] == value.Language {
qualityProfileID = value.Key
language = value.Language
qualityProfile = value.Name
}
} else {
if idSlice[0] == value.Name && d.Get("language").(string) == value.Language {
qualityProfileID = value.Key
language = value.Language
qualityProfile = value.Name
}
}
}

Expand Down

0 comments on commit d6f9e0e

Please sign in to comment.