@@ -31,6 +31,7 @@ func TestAccJobDefinition_Basic(t *testing.T) {
3131 name = "test-jobs-job-definition-basic"
3232 cpu_limit = 120
3333 memory_limit = 256
34+ local_storage_capacity = 5120
3435 image_uri = "docker.io/alpine:latest"
3536 }
3637 ` ,
@@ -58,6 +59,7 @@ func TestAccJobDefinition_Timeout(t *testing.T) {
5859 name = "test-jobs-job-definition-timeout"
5960 cpu_limit = 120
6061 memory_limit = 256
62+ local_storage_capacity = 5120
6163 image_uri = "docker.io/alpine:latest"
6264 timeout = "20m"
6365 }
@@ -75,6 +77,7 @@ func TestAccJobDefinition_Timeout(t *testing.T) {
7577 name = "test-jobs-job-definition-timeout"
7678 cpu_limit = 120
7779 memory_limit = 256
80+ local_storage_capacity = 5120
7881 image_uri = "docker.io/alpine:latest"
7982 timeout = "1h30m"
8083 }
@@ -90,6 +93,52 @@ func TestAccJobDefinition_Timeout(t *testing.T) {
9093 })
9194}
9295
96+ func TestAccJobDefinition_LocalStorageCapacity (t * testing.T ) {
97+ tt := acctest .NewTestTools (t )
98+ defer tt .Cleanup ()
99+
100+ resource .ParallelTest (t , resource.TestCase {
101+ ProtoV6ProviderFactories : tt .ProviderFactories ,
102+ CheckDestroy : testAccCheckJobDefinitionDestroy (tt ),
103+ Steps : []resource.TestStep {
104+ {
105+ Config : `
106+ resource scaleway_job_definition main {
107+ name = "test-jobs-job-definition-local-storage"
108+ cpu_limit = 120
109+ memory_limit = 256
110+ image_uri = "docker.io/alpine:latest"
111+ local_storage_capacity = 1000
112+ }
113+ ` ,
114+ Check : resource .ComposeTestCheckFunc (
115+ testAccCheckJobDefinitionExists (tt , "scaleway_job_definition.main" ),
116+ acctest .CheckResourceAttrUUID ("scaleway_job_definition.main" , "id" ),
117+ resource .TestCheckResourceAttr ("scaleway_job_definition.main" , "name" , "test-jobs-job-definition-local-storage" ),
118+ resource .TestCheckResourceAttr ("scaleway_job_definition.main" , "local_storage_capacity" , "1000" ),
119+ ),
120+ },
121+ {
122+ Config : `
123+ resource scaleway_job_definition main {
124+ name = "test-jobs-job-definition-local-storage"
125+ cpu_limit = 120
126+ memory_limit = 256
127+ image_uri = "docker.io/alpine:latest"
128+ local_storage_capacity = 2000
129+ }
130+ ` ,
131+ Check : resource .ComposeTestCheckFunc (
132+ testAccCheckJobDefinitionExists (tt , "scaleway_job_definition.main" ),
133+ acctest .CheckResourceAttrUUID ("scaleway_job_definition.main" , "id" ),
134+ resource .TestCheckResourceAttr ("scaleway_job_definition.main" , "name" , "test-jobs-job-definition-local-storage" ),
135+ resource .TestCheckResourceAttr ("scaleway_job_definition.main" , "local_storage_capacity" , "2000" ),
136+ ),
137+ },
138+ },
139+ })
140+ }
141+
93142func TestAccJobDefinition_Cron (t * testing.T ) {
94143 tt := acctest .NewTestTools (t )
95144 defer tt .Cleanup ()
@@ -104,6 +153,7 @@ func TestAccJobDefinition_Cron(t *testing.T) {
104153 name = "test-jobs-job-definition-cron"
105154 cpu_limit = 120
106155 memory_limit = 256
156+ local_storage_capacity = 5120
107157 image_uri = "docker.io/alpine:latest"
108158 cron {
109159 schedule = "5 4 1 * *"
@@ -126,6 +176,7 @@ func TestAccJobDefinition_Cron(t *testing.T) {
126176 name = "test-jobs-job-definition-cron"
127177 cpu_limit = 120
128178 memory_limit = 256
179+ local_storage_capacity = 5120
129180 image_uri = "docker.io/alpine:latest"
130181 cron {
131182 schedule = "5 5 * * *"
@@ -148,6 +199,7 @@ func TestAccJobDefinition_Cron(t *testing.T) {
148199 name = "test-jobs-job-definition-cron"
149200 cpu_limit = 120
150201 memory_limit = 256
202+ local_storage_capacity = 5120
151203 image_uri = "docker.io/alpine:latest"
152204 }
153205 ` ,
@@ -185,6 +237,7 @@ func TestAccJobDefinition_SecretReference(t *testing.T) {
185237 name = "test-jobs-job-definition-secret"
186238 cpu_limit = 120
187239 memory_limit = 256
240+ local_storage_capacity = 5120
188241 image_uri = "docker.io/alpine:latest"
189242 secret_reference {
190243 secret_id = scaleway_secret.main.id
@@ -222,6 +275,7 @@ func TestAccJobDefinition_SecretReference(t *testing.T) {
222275 name = "test-jobs-job-definition-secret"
223276 cpu_limit = 120
224277 memory_limit = 256
278+ local_storage_capacity = 5120
225279 image_uri = "docker.io/alpine:latest"
226280 secret_reference {
227281 secret_id = split("/", scaleway_secret.main.id)[1]
@@ -260,6 +314,7 @@ func TestAccJobDefinition_SecretReference(t *testing.T) {
260314 name = "test-jobs-job-definition-secret"
261315 cpu_limit = 120
262316 memory_limit = 256
317+ local_storage_capacity = 5120
263318 image_uri = "docker.io/alpine:latest"
264319 secret_reference {
265320 secret_id = scaleway_secret.main.id
@@ -302,6 +357,7 @@ func TestAccJobDefinition_WrongSecretReference(t *testing.T) {
302357 name = "test-jobs-job-definition-secret"
303358 cpu_limit = 120
304359 memory_limit = 256
360+ local_storage_capacity = 5120
305361 image_uri = "docker.io/alpine:latest"
306362 secret_reference {
307363 secret_id = scaleway_secret.main.id
@@ -319,11 +375,12 @@ func TestAccJobDefinition_WrongSecretReference(t *testing.T) {
319375 secret_id = scaleway_secret.main.id
320376 data = "your_secret"
321377 }
322-
378+
323379 resource scaleway_job_definition main {
324380 name = "test-jobs-job-definition-secret"
325381 cpu_limit = 120
326382 memory_limit = 256
383+ local_storage_capacity = 5120
327384 image_uri = "docker.io/alpine:latest"
328385 secret_reference {
329386 secret_id = scaleway_secret.main.id
0 commit comments