jdamata / terraform-provider-sonarqube

Terraform provider for managing Sonarqube configuration
GNU General Public License v3.0
62 stars 56 forks source link

Sonarqube Portfolio cannot be created in Data Center Edition #227

Closed Lucatronlk closed 9 months ago

Lucatronlk commented 9 months ago

Hello,

During the portfolio creation process, an error is encountered, indicating that portfolios are exclusively compatible with the Enterprise edition of SonarQube. The current SonarQube version in use is SonarQube Data Center version %s.

sonarqube_portfolio.main: Creating...
╷
│ Error: portfolios are only supported in the Enterprise edition of SonarQube. You are using: SonarQube Data Center version 10.2.77647
│ 
│   with sonarqube_portfolio.main,
│   on main.tf line 28, in resource "sonarqube_portfolio" "main":
│   28: resource "sonarqube_portfolio" "main" {
│ 

It should be noted that portfolios are also accessible in the Data Center Edition, and manual creation through the Sonar UI or API is successful.

image

I think it makes more sense to have a condition like this

if strings.ToLower(conf.sonarQubeEdition) == "community"
     return fmt.Errorf("portfolios are NOT supported in the Community Edition of SonarQube)

Affected Resource(s)

Please list the resources as a list, for example:

Expected Behavior

Being able to create sonarqube_portfolio if you have SonarQube Data Center Edition

Actual Behavior

Unable to create sonarqube_portfolio if you have a SonarQube Data Center Edition