-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[RDBMS] az postgres flexible-server create: Add database name field for create with cluster
#32570
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,7 +68,7 @@ def flexible_server_create(cmd, client, | |
| zone=None, standby_availability_zone=None, | ||
| geo_redundant_backup=None, byok_identity=None, byok_key=None, backup_byok_identity=None, backup_byok_key=None, | ||
| auto_grow=None, performance_tier=None, | ||
| storage_type=None, iops=None, throughput=None, create_cluster=None, cluster_size=None, yes=False): | ||
| storage_type=None, iops=None, throughput=None, create_cluster=None, cluster_size=None, database_name=None, yes=False): | ||
|
|
||
| if not check_resource_group(resource_group_name): | ||
| resource_group_name = None | ||
|
|
@@ -138,7 +138,7 @@ def flexible_server_create(cmd, client, | |
| cluster = None | ||
| if create_cluster == 'ElasticCluster': | ||
| cluster_size = cluster_size if cluster_size else 2 | ||
| cluster = postgresql_flexibleservers.models.Cluster(cluster_size=cluster_size, default_database_name=POSTGRES_DB_NAME) | ||
| cluster = postgresql_flexibleservers.models.Cluster(cluster_size=cluster_size, default_database_name=database_name if database_name else POSTGRES_DB_NAME) | ||
|
Comment on lines
139
to
+141
|
||
|
|
||
| server_result = firewall_id = None | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
database_nameparameter is used here without being validated by thepg_arguments_validatorfunction. The validator function (defined in validators.py) accepts adatabase_nameparameter and performs format validation to ensure it begins with a letter or underscore, contains only valid characters (letters, digits, hyphens, underscores), and is less than 64 characters. You should adddatabase_name=database_nameto the validator call above (around line 112-136) to ensure invalid database names are caught early with a proper error message rather than failing later in the process.