Skip to content

Commit 3f30614

Browse files
authored
fix: Added fix to ensure the plan upgrade should be completed before attempting to set the quota (#326)
1 parent c9d3072 commit 3f30614

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ module "upgrade-plan" {
4040
source = "terraform-ibm-modules/container-registry/ibm//modules/plan"
4141
version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
4242
}
43+
4344
module "set_quota" {
4445
source = "terraform-ibm-modules/container-registry/ibm//modules/quotas"
4546
version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
46-
update_storage_quota = true
47-
storage_megabytes = 5 * 1024 # 5GiB
48-
update_traffic_quota = true
49-
traffic_megabytes = 500 # 500 MB
47+
storage_megabytes = 5 * 1024 # 5GiB
48+
traffic_megabytes = 500 # 500 MB
49+
# Issue 324: Upgrade plan before setting quota
50+
depends_on = [module.upgrade_plan]
5051
}
5152
```
5253

common-dev-assets

examples/complete/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ module "namespace" {
2424
}
2525

2626
module "upgrade_plan" {
27-
source = "../..//modules/plan"
27+
source = "../../modules/plan"
2828
}
2929

3030
module "set_quota" {
3131
source = "../../modules/quotas"
3232
storage_megabytes = 5 * 1024 - 1
3333
traffic_megabytes = 499
34+
# Issue 324: Upgrade plan before extending quota
35+
depends_on = [module.upgrade_plan]
3436
}

modules/quotas/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ module "upgrade-plan" {
1414
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
1515
container_registry_endpoint = "us.icr.io"
1616
}
17+
18+
# Set quota:
1719
module "set_quota" {
1820
source = "terraform-ibm-modules/container-registry/ibm//modules/quotas"
1921
version = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
2022
container_registry_endpoint = "us.icr.io"
2123
storage_megabytes = 5 * 1024 # 5GiB
2224
traffic_megabytes = 500 # 500 MB
25+
# Issue 324: Upgrade plan before setting quota
26+
depends_on = [module.upgrade_plan]
2327
}
2428
```
2529

solutions/fully-configurable/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ module "set_quota" {
3737
container_registry_endpoint = var.provider_visibility == "private" ? module.cr_endpoint.container_registry_endpoint_private : module.cr_endpoint.container_registry_endpoint
3838
storage_megabytes = var.storage_megabytes
3939
traffic_megabytes = var.traffic_megabytes
40+
# Issue 324: Upgrade plan before setting quota
41+
depends_on = [module.upgrade_plan]
4042
}

0 commit comments

Comments
 (0)