You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Because of the way ZFS properties can be passed and are returned by the zfs get commands, Puppet applies properties even though they already have the correct values, e.g.
quota changed '4.88T' to '5000G' (corrective)`
reservation changed '6T' to '6597069766656' (corrective)
Expected Behavior
When the values match, the module should detect it and not attempt to set them again.
Steps to Reproduce
Set a quota of 5000G
Set a reservation of 6597069766656
Environment
Version 8.4.0
Platform Debian 12
Additional Context
I thought of the following patch:
diff --git a/lib/puppet/provider/zfs/zfs.rb b/lib/puppet/provider/zfs/zfs.rb
index 976d9bf..b97ec0c 100644
--- a/lib/puppet/provider/zfs/zfs.rb+++ b/lib/puppet/provider/zfs/zfs.rb@@ -82,7 +82,7 @@ Puppet::Type.type(:zfs).provide(:zfs) do
:secondarycache, :setuid, :sharenfs, :sharesmb,
:snapdir, :sync, :version, :volsize, :vscan, :xattr].each do |field|
define_method(field) do
- zfs(:get, '-H', '-o', 'value', field, @resource[:name]).strip+ zfs(:get, '-p', '-H', '-o', 'value', field, @resource[:name]).strip
end
define_method(field.to_s + '=') do |should|
It would prevent issues when the Puppet configuration uses exact values:
But it doesn't help when we pass Puppet human-readable values, e.g.
quota changed '5368709120000' to '5000G' (corrective)
Maybe the solution would be to:
apply the above patch
convert human-readable values to exact values before applying them
The text was updated successfully, but these errors were encountered:
The munge method needs to implemented for properties whose values can take multiple forms. That way the desired and current values are canonicalized before being compared.
Describe the Bug
Hi,
Because of the way ZFS properties can be passed and are returned by the
zfs get
commands, Puppet applies properties even though they already have the correct values, e.g.Expected Behavior
When the values match, the module should detect it and not attempt to set them again.
Steps to Reproduce
quota
of5000G
reservation
of6597069766656
Environment
Additional Context
I thought of the following patch:
It would prevent issues when the Puppet configuration uses exact values:
But it doesn't help when we pass Puppet human-readable values, e.g.
Maybe the solution would be to:
The text was updated successfully, but these errors were encountered: