File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -189,9 +189,14 @@ def _check_workspaces_data(self, data: list[dict]) -> list[dict]:
189
189
logging .info ("Start checking workspaces data" )
190
190
191
191
def check_for_bsl_terraform (version ):
192
+ # Ensure version is not pessimistic
193
+ if version .startswith ("~" ) or version .startswith ("^" ):
194
+ # lets just default to true so we catch this during a migration. This can almost certainly be overridden.
195
+ return True , "Pessimistic version, unable to determine if it's BSL Terraform"
196
+
192
197
if version == "latest" or semver .match (version , ">=1.5.7" ):
193
- return True
194
- return False
198
+ return True , None
199
+ return False , None
195
200
196
201
for key , item in enumerate (data ):
197
202
warnings = []
@@ -202,8 +207,11 @@ def check_for_bsl_terraform(version):
202
207
if item .get ("attributes.vcs-repo.service-provider" ) is None :
203
208
warnings .append ("No VCS configuration" )
204
209
205
- if check_for_bsl_terraform (item .get ("attributes.terraform-version" )):
210
+ bsl , warning = check_for_bsl_terraform (item .get ("attributes.terraform-version" ))
211
+ if bsl :
206
212
warnings .append ("BSL Terraform version" )
213
+ if warning is not None :
214
+ warnings .append (warning )
207
215
208
216
data [key ]["warnings" ] = ", " .join (warnings )
209
217
You can’t perform that action at this time.
0 commit comments