- Notifications
You must be signed in to change notification settings - Fork907
Commit1ef78b6
feat: warn when .terraform.lock.hcl is modified during terraform init
This change addresses issue#18237 by adding checksum validation for.terraform.lock.hcl files before and after running terraform init.When the lock file is modified during init, it indicates that providerhashes may be missing for the target architecture, leading to unnecessaryprovider downloads and slower provisioning.Changes:- Add calculateFileChecksum() helper function using SHA256- Add getTerraformLockFilePath() helper function- Modify init() function to calculate checksums before/after terraform init- Log warning when lock file changes with actionable guidance- Add unit tests for new functionalityThe warning message guides users to regenerate the lock file on the sameOS/architecture as their Coder instance to improve performance.Co-authored-by: kylecarbs <7122116+kylecarbs@users.noreply.github.com>1 parent7d8b994 commit1ef78b6
2 files changed
+89
-0
lines changedLines changed: 46 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| 7 | + | |
| 8 | + | |
7 | 9 |
| |
8 | 10 |
| |
9 | 11 |
| |
| |||
222 | 224 |
| |
223 | 225 |
| |
224 | 226 |
| |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
225 | 231 |
| |
226 | 232 |
| |
227 | 233 |
| |
| |||
242 | 248 |
| |
243 | 249 |
| |
244 | 250 |
| |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
245 | 276 |
| |
246 | 277 |
| |
247 | 278 |
| |
| |||
259 | 290 |
| |
260 | 291 |
| |
261 | 292 |
| |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
262 | 308 |
| |
263 | 309 |
| |
264 | 310 |
| |
|
Lines changed: 43 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| 5 | + | |
| 6 | + | |
5 | 7 |
| |
6 | 8 |
| |
7 | 9 |
| |
| |||
173 | 175 |
| |
174 | 176 |
| |
175 | 177 |
| |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + |
0 commit comments
Comments
(0)