{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/5090","repository_url":"https://api.github.com/repos/chef/chef","labels_url":"https://api.github.com/repos/chef/chef/issues/5090/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/5090/comments","events_url":"https://api.github.com/repos/chef/chef/issues/5090/events","html_url":"https://github.com/chef/chef/issues/5090","id":164287619,"number":5090,"title":"Overridden `name_attribute` not matching a condition triggers `does not match` warning, even if it's overriden by a proper value in body.","user":{"login":"chr4","id":4600363,"avatar_url":"https://avatars.githubusercontent.com/u/4600363?v=3","gravatar_id":"","url":"https://api.github.com/users/chr4","html_url":"https://github.com/chr4","followers_url":"https://api.github.com/users/chr4/followers","following_url":"https://api.github.com/users/chr4/following{/other_user}","gists_url":"https://api.github.com/users/chr4/gists{/gist_id}","starred_url":"https://api.github.com/users/chr4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chr4/subscriptions","organizations_url":"https://api.github.com/users/chr4/orgs","repos_url":"https://api.github.com/users/chr4/repos","events_url":"https://api.github.com/users/chr4/events{/privacy}","received_events_url":"https://api.github.com/users/chr4/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chef/chef/labels/Low%20Priority","name":"Low Priority","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"jkeiser","id":654882,"avatar_url":"https://avatars.githubusercontent.com/u/654882?v=3","gravatar_id":"","url":"https://api.github.com/users/jkeiser","html_url":"https://github.com/jkeiser","followers_url":"https://api.github.com/users/jkeiser/followers","following_url":"https://api.github.com/users/jkeiser/following{/other_user}","gists_url":"https://api.github.com/users/jkeiser/gists{/gist_id}","starred_url":"https://api.github.com/users/jkeiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkeiser/subscriptions","organizations_url":"https://api.github.com/users/jkeiser/orgs","repos_url":"https://api.github.com/users/jkeiser/repos","events_url":"https://api.github.com/users/jkeiser/events{/privacy}","received_events_url":"https://api.github.com/users/jkeiser/received_events","type":"User","site_admin":false},"assignees":[{"login":"jkeiser","id":654882,"avatar_url":"https://avatars.githubusercontent.com/u/654882?v=3","gravatar_id":"","url":"https://api.github.com/users/jkeiser","html_url":"https://github.com/jkeiser","followers_url":"https://api.github.com/users/jkeiser/followers","following_url":"https://api.github.com/users/jkeiser/following{/other_user}","gists_url":"https://api.github.com/users/jkeiser/gists{/gist_id}","starred_url":"https://api.github.com/users/jkeiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkeiser/subscriptions","organizations_url":"https://api.github.com/users/jkeiser/orgs","repos_url":"https://api.github.com/users/jkeiser/repos","events_url":"https://api.github.com/users/jkeiser/events{/privacy}","received_events_url":"https://api.github.com/users/jkeiser/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-07-07T11:27:37Z","updated_at":"2016-08-04T05:34:13Z","closed_at":null,"body":"## Description\r\nFalse positive warning (I assume) if a `name_attribute` attributes has a `regex` condition (I assume this is also true for other conditions), but it's overriden in the body with an attribute matching the condition. See example in \"Replication Case\". As the actual value used by the provider matches the `regex` condition, I think this could be a false positive, or is there a simple solution I cant' think of?\r\n\r\n## Chef Version\r\n12.12.13\r\n\r\n## Platform Version\r\nUbuntu Xenial 16.04 LTS\r\n\r\n## Replication Case\r\nI've encountered this issue using the [iptables-ng cookbook](https://github.com/chr4-cookbooks/iptables-ng).\r\n\r\nThe `iptables_ng_chain` ressource has a `named_attribute` with a `regex` condition:\r\n\r\niptables-ng/ressources/chain.rb:\r\n```ruby\r\nattribute :chain,  kind_of: String, name_attribute: true, regex: /^\\S{1,29}$/\r\n```\r\n\r\nBecause `chef-client` complains when specifying multiple resources with the same name, the `name_attribute` is concatinated using other attributes. The `chain` attribute then sets the actual attribute that's going to be used:\r\n\r\niptables-ng/providers/chain.rb:\r\n```ruby\r\niptables_ng_chain \"#{new_resource.chain}:#{new_resource.table}:#{new_resource.name}\" do\r\n  chain  new_resource.chain\r\n  [...]\r\nend\r\n```\r\n\r\n## Client Output\r\n```\r\n  Default value \"FORWARD:filter:10-forward-drop-invalid\" is invalid for property chain of resource iptables_ng_chain. In Chef 13 this will become an error: Option chain's value FORWARD:filter:10-forward-drop-invalid does not match regular expression /^\\S{1,29}$/. at 1 location:\r\n    - /var/chef/cache/cookbooks/iptables-ng/providers/rule.rb:42:in `block in edit_rule'\r\n```"},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/237456877","html_url":"https://github.com/chef/chef/issues/5090#issuecomment-237456877","issue_url":"https://api.github.com/repos/chef/chef/issues/5090","id":237456877,"user":{"login":"jkeiser","id":654882,"avatar_url":"https://avatars.githubusercontent.com/u/654882?v=3","gravatar_id":"","url":"https://api.github.com/users/jkeiser","html_url":"https://github.com/jkeiser","followers_url":"https://api.github.com/users/jkeiser/followers","following_url":"https://api.github.com/users/jkeiser/following{/other_user}","gists_url":"https://api.github.com/users/jkeiser/gists{/gist_id}","starred_url":"https://api.github.com/users/jkeiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkeiser/subscriptions","organizations_url":"https://api.github.com/users/jkeiser/orgs","repos_url":"https://api.github.com/users/jkeiser/repos","events_url":"https://api.github.com/users/jkeiser/events{/privacy}","received_events_url":"https://api.github.com/users/jkeiser/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T05:34:13Z","updated_at":"2016-08-04T05:34:13Z","body":"@lamont-granquist I removed \"Accepted Minor\" until we get to the bottom of this."}}
{"actor":{"display_login":"jkeiser"}}