Add fix for check-samples.py
@@ -41,8 +41,9 @@ def get_expected_samples(crd_path):
group = group.split(' ')[1]
group = strip(group, ".azure.com")
version = version.split(' ')[1]
+ versionPrefix = re.match('v1(alpha|beta)([0-9][a-z]+)?', version).group()
filename = f'{version}_{kind}.yaml'
- expected_samples.add(os.path.join(group, filename))
+ expected_samples.add(os.path.join(group, versionPrefix, filename))
return expected_samples
@@ -70,8 +71,11 @@ if __name__ == "__main__":
dir_string = str(entry.relative_to(samples_dir))
if not entry.is_dir() :
dir_string_slice = dir_string.split(os.sep)
- if len(dir_string_slice) > 2:
- dir_string = os.path.join(dir_string_slice[0], dir_string_slice[len(dir_string_slice) - 1])
+ if len(dir_string_slice) > 3:
+ group = dir_string_slice[0]
+ versionPrefix = dir_string_slice[len(dir_string_slice) - 2]
+ sample = dir_string_slice[len(dir_string_slice) - 1]
+ dir_string = os.path.join(group, versionPrefix, sample)
actual_samples.add(dir_string)
difference = expected_samples.difference(actual_samples)
