Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept 8.0 as a correct version on MySQL server #179

Merged
merged 1 commit into from
Jun 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This documentation describes a list of rules available by enabling this ruleset.

## API Specification Rules

These are the rules that warn against invalid values generated from [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs). Currently, 231 rules are available.
These are the rules that warn against invalid values generated from [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs). Currently, 230 rules are available.

|Rule|Enabled by default|
| --- | --- |
Expand Down Expand Up @@ -178,7 +178,6 @@ These are the rules that warn against invalid values generated from [azure-rest-
|[azurerm_mssql_virtual_machine_invalid_sql_license_type](rules/azurerm_mssql_virtual_machine_invalid_sql_license_type.md)|✔|
|[azurerm_mysql_firewall_rule_invalid_end_ip_address](rules/azurerm_mysql_firewall_rule_invalid_end_ip_address.md)|✔|
|[azurerm_mysql_firewall_rule_invalid_start_ip_address](rules/azurerm_mysql_firewall_rule_invalid_start_ip_address.md)|✔|
|[azurerm_mysql_server_invalid_version](rules/azurerm_mysql_server_invalid_version.md)|✔|
|[azurerm_nat_gateway_invalid_sku_name](rules/azurerm_nat_gateway_invalid_sku_name.md)|✔|
|[azurerm_netapp_account_invalid_resource_group_name](rules/azurerm_netapp_account_invalid_resource_group_name.md)|✔|
|[azurerm_netapp_pool_invalid_name](rules/azurerm_netapp_pool_invalid_name.md)|✔|
Expand Down
44 changes: 0 additions & 44 deletions docs/rules/azurerm_mysql_server_invalid_version.md

This file was deleted.

1 change: 0 additions & 1 deletion rules/apispec/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ var Rules = []tflint.Rule{
NewAzurermMssqlVirtualMachineInvalidSQLLicenseTypeRule(),
NewAzurermMysqlFirewallRuleInvalidEndIPAddressRule(),
NewAzurermMysqlFirewallRuleInvalidStartIPAddressRule(),
NewAzurermMysqlServerInvalidVersionRule(),
NewAzurermNatGatewayInvalidSkuNameRule(),
NewAzurermNetappAccountInvalidResourceGroupNameRule(),
NewAzurermNetappPoolInvalidNameRule(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// This file generated by `tools/apispec-rule-gen/main.go`. DO NOT EDIT

package apispec
package rules

import (
"fmt"
Expand All @@ -26,7 +24,7 @@ func NewAzurermMysqlServerInvalidVersionRule() *AzurermMysqlServerInvalidVersion
attributeName: "version",
enum: []string{
"5.7",
"8.0.21",
"8.0",
},
Comment on lines 25 to 28
Copy link
Contributor

@PatMyron PatMyron Jun 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think we should consider dropping rules when automation breaks rather than switching them to be manually maintained since these enums will become outdated:
https://sourcegraph.com/search?q=context:global+r:terraform-linters/tflint-ruleset-+enum:+[]+-file:/models/|/apispec/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, but ideally, this enum should be maintained by users of this ruleset, like #171. I find automation useful to help you notice problems more quickly.

}
}
Expand Down Expand Up @@ -80,7 +78,7 @@ func (r *AzurermMysqlServerInvalidVersionRule) Check(runner tflint.Runner) error
if !found {
runner.EmitIssue(
r,
fmt.Sprintf(`"%s" is an invalid value as version`, truncateLongMessage(val)),
fmt.Sprintf(`"%s" is an invalid value as version`, val),
attribute.Expr.Range(),
)
}
Expand Down
1 change: 1 addition & 0 deletions rules/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ var Rules = append([]tflint.Rule{
NewAzurermVirtualMachineInvalidVMSizeRule(),
NewAzurermWindowsVirtualMachineInvalidSizeRule(),
NewAzurermWindowsVirtualMachineScaleSetInvalidSkuRule(),
NewAzurermMysqlServerInvalidVersionRule(),
}, apispec.Rules...)
2 changes: 1 addition & 1 deletion tools/apispec-rule-gen/mappings/azurerm_mysql_server.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ mapping "azurerm_mysql_server" {
sku_name = Sku.name
administrator_login = ServerProperties.administratorLogin
administrator_login_password = ServerProperties.administratorLoginPassword
version = ServerVersion
version = any //ServerVersion
ssl_enforcement = any //SslEnforcement
}