cristifalcas / puppet-etcd

etcd is a distributed key value store that provides a reliable way to store data across a cluster of machines.
https://coreos.com/etcd/
Apache License 2.0
9 stars 39 forks source link

Issue regarding `validate_integer` #26

Closed jeefberkey closed 6 years ago

jeefberkey commented 6 years ago

My code looks like:

# this may be wrong, can't tell yet!
class {'etcd':
  listen_client_urls    => 'https://0.0.0.0:2379',
  advertise_client_urls => "https://${facts['fqdn']}:2379",
  listen_peer_urls      => 'https://0.0.0.0:2380',
  etcd_name             => 'default',

  client_cert_auth      => true,
  peer_client_cert_auth => true,
  cert_file             => "/etc/pki/simp-testing/pki/bogus_cert",
  key_file              => "/etc/pki/simp-testing/pki/bogus_key",
  trusted_ca_file       => "/etc/pki/simp-testing/pki/bogus_cacert",
  peer_cert_file        => "/etc/pki/simp-testing/pki/bogus_cert",
  peer_key_file         => "/etc/pki/simp-testing/pki/private/bogus_key",
  peer_trusted_ca_file  => "/etc/pki/simp-testing/pki/bogus_cacert",

  initial_advertise_peer_urls => "https://${facts['fqdn']}:2380",
  initial_cluster             => [ 'master01=https://master01:2380' ],
}

And when I run it I get:

Error: Evaluation Error: Error while evaluating a Function Call, '[[10000, 100, 1000, 0, 5, 5, 5000, 30000, 1000, 5000, 0]]' is not an integer. at /etc/puppetlabs/code/environments/production/modules/etcd/manifests/init.pp:309:3 on node node.domain

which is making absolutely no sense to me. It seems to be turning the array of integers into an array of an array. I'm not modifying these parameters at all, and the module works fine when I comment out the validate statement.

Would you be interested in a PR to validate each int individually or switch to data types?

jeefberkey commented 6 years ago

It works in the spec tests, and I've even added a test with my exact parameters and it still passes everywhere except my test node.

https://github.com/jeefberkey/puppet-etcd/blob/my-tests/spec/classes/init_spec.rb#L33