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

Add relatime property support to zfs #79

Merged
merged 1 commit into from
Jun 21, 2024
Merged

Conversation

h0tw1r3
Copy link

@h0tw1r3 h0tw1r3 commented May 17, 2024

need this myself, cleaned up #76 as author was unresponsive

@h0tw1r3 h0tw1r3 added the enhancement New feature or request label May 17, 2024
@h0tw1r3 h0tw1r3 requested a review from a team as a code owner May 17, 2024 00:14
@joshcooper joshcooper merged commit 9668c4a into puppetlabs:main Jun 21, 2024
14 checks passed
@joshcooper joshcooper mentioned this pull request Jun 21, 2024
@h0tw1r3 h0tw1r3 deleted the relatime branch June 24, 2024 15:32
AriaXLi added a commit to AriaXLi/puppetlabs-zfs_core that referenced this pull request Jun 24, 2024
This reverts commit 9668c4a, reversing
changes made to 707883f.
joshcooper added a commit that referenced this pull request Jun 25, 2024
Revert "Merge pull request #79 from h0tw1r3/relatime"
@AriaXLi
Copy link
Contributor

AriaXLi commented Jun 25, 2024

Hi @h0tw1r3 thanks again for cleaning this up and contributing! Since this attribute is only supported on Linux platforms, it's causing some issues in CI.

11:26:36   Error: Could not run: Execution of '/usr/sbin/zfs get -H -o value relatime tstpool/tstfs' returned 2: bad property list: invalid property 'relatime'
11:26:39   For more info, run: zfs help get

When you can, could you please update this PR to account for this?
We have some other Linux-only properties that handle this in type (for overlay):

newproperty(:overlay) do
desc 'The overlay property. Valid values are `on`, `off`.'
validate do |_value|
raise Puppet::Error _('This property is only supported on Linux') unless Facter.value(:kernel) == 'Linux'
end
end

Or in provider (for aclmode):

[:aclmode, :acltype, :shareiscsi, :overlay].each do |field|
# The zfs commands use the property value '-' to indicate that the
# property is not set. We make use of this value to indicate that the
# property is not set since it is not available. Conversely, if these
# properties are attempted to be unset, and resulted in an error, our
# best bet is to catch the exception and continue.
define_method(field) do
zfs(:get, '-H', '-o', 'value', field, @resource[:name]).strip
rescue
PARAMETER_UNSET_OR_NOT_AVAILABLE

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

Successfully merging this pull request may close these issues.

None yet

4 participants