Skip to content

Commit cd299f0

Browse files
committed
Set the app timeout from terraform resource create timeout
Set the application timeout from the resource create timeout, as the default value of 300 seconds, 5 minutes is sometimes insufficient. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
1 parent 5d63532 commit cd299f0

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

rancher2/structure_app.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,7 @@ func expandApp(in *schema.ResourceData) (*projectClient.App, error) {
158158
obj.Labels = toMapString(v)
159159
}
160160

161+
obj.Timeout = int64(in.Timeout(schema.TimeoutCreate).Seconds())
162+
161163
return obj, nil
162164
}

rancher2/structure_app_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func init() {
4040
"option1": "value1",
4141
"option2": "value2",
4242
},
43+
Timeout: 1200,
4344
}
4445
testAppInterfaceGlobal = map[string]interface{}{
4546
"catalog_name": "test",
@@ -85,6 +86,7 @@ func init() {
8586
"option1": "value1",
8687
"option2": "value2",
8788
},
89+
Timeout: 1200,
8890
}
8991
testAppInterfaceClusterLocal = map[string]interface{}{
9092
"catalog_name": "local:test",
@@ -129,6 +131,7 @@ func init() {
129131
"option1": "value1",
130132
"option2": "value2",
131133
},
134+
Timeout: 1200,
132135
}
133136
testAppInterfaceCluster = map[string]interface{}{
134137
"catalog_name": "c-XXXXX:test",
@@ -173,6 +176,7 @@ func init() {
173176
"option1": "value1",
174177
"option2": "value2",
175178
},
179+
Timeout: 1200,
176180
}
177181
testAppInterfaceProject = map[string]interface{}{
178182
"catalog_name": "p-XXXXX:test",

0 commit comments

Comments
 (0)