INNER CODE UNIT · Python
main
floci-io/floci · .github/ci/compat-opentofu-drift-check.py:71
def main():
tf = resource_addresses(TF_MAIN)
otf = resource_addresses(OTF_MAIN)
tf_ok, tf_allowed = check_direction('compat-terraform/main.tf but not compat-opentofu/main.tf',
tf - otf, ALLOWLIST_TF_ONLY)
otf_ok, otf_allowed = check_direction('compat-opentofu/main.tf but not compat-terraform/main.tf',
otf - tf, ALLOWLIST_OTF_ONLY)
if not (tf_ok and otf_ok):
print('\nPort the resource to the other config, or add it to the matching-direction '
'allowlist if the gap is intentional.')
sys.exit(1)
print(f'compat-terraform and compat-opentofu resource lists match '
f'({len(tf & otf)} shared, {len(tf_allowed)} tf-only allowlisted, '
f'{len(otf_allowed)} otf-only allowlisted).')