Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Incorrect usage of file.managed mode #251

Open
iils-jschmidt opened this issue Jul 20, 2022 · 2 comments
Open

[BUG] Incorrect usage of file.managed mode #251

iils-jschmidt opened this issue Jul 20, 2022 · 2 comments
Labels

Comments

@iils-jschmidt
Copy link

According so salt lint, file.managed mode should be in quotation marks and have a leading zero.
So all occurrences of this:

  • mode: 644
    should be replaced with this:
  • mode: '0644'
@myii
Copy link
Member

myii commented Jul 20, 2022

Thanks for the report, @jensgw.

This was a conscious decision when first introducing salt-lint across this org, in our CI. Referring to the values set to be skipped in the configuration file:

# Skipping `207` and `208` because `210` is sufficient, at least for the time-being
# I.e. Allows 3-digit unquoted codes to still be used, such as `644` and `755`
- 207 # File modes should always be encapsulated in quotation marks
- 208 # File modes should always contain a leading zero

Essentially, the important rule to be upheld, from a YAML perspective, is 210:

  • Numbers that start with 0 should always be encapsulated in quotation marks

At the current time, there's no plan to enable 207 and 208 across the org -- the effort involved would be substantial, with no effective payback.

An argument could be made that this template itself could be adjusted; this is something that could be discussed in the next Formulas' working group meeting -- CC: @saltstack-formulas/wg.

@mdschmitt
Copy link

I think it makes sense to have just this template formula tweaked to use '0644' notation. All forks made from it in the future would be correct by default and anything already existing just have a simple lint warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants