ctdk / goiardi

A Chef server written in Go, able to run entirely in memory, with optional persistence with saving the in-memory data to disk or using MySQL or Postgres as the data storage backend. Docs: http://goiardi.readthedocs.io/en/latest/index.html
http://goiardi.gl
Apache License 2.0
280 stars 39 forks source link

Client create fails with invalid key create_key #62

Closed joerg closed 5 years ago

joerg commented 5 years ago

Hi,

We recently migrated from the official chef-server to goiardi and just stumbled upon an error when manually running "knife client create".

% knife client create delete_me -d -f delete_me.pem
ERROR: The data in your request was invalid
Response: Invalid key create_key in request body
% knife --version
Chef: 14.1.12

According to the chef-server API docs this create_key is valid [1], but goiardi does not know about it [2]. Currently this means for us that Terrform can not use the chef provisioner which is kind of a blocker for us. Any suggestion on how to quickly fix this? Or do you think this option could simply be added/allowed?

[1] https://docs.chef.io/api_chef_server.html#id24 [2] https://github.com/ctdk/goiardi/blob/f53c85261c0b82125ecb497370193eb68c2661a6/client/client.go#L371

joerg commented 5 years ago

We just compiled and run goiardi with this minimal fix of adding "create_key" to the validElements and everything seems to be in order now. If you prefer a pull request or anything just say so and we can send it to you within a day.

ctdk commented 5 years ago

Omg, I only just saw this. (I seem to miss many github notifications in all the noise in my primary email account.) I think this is a newer allowed element is all, and to make it pass the old Chef 11 pedant tests I had to be pretty limiting in what I'd accept.

I'll add that and see if it breaks pedant horribly. If it does, I'll do something to make it work. Thanks for finding that.

ctdk commented 5 years ago

I pushed it up yesterday, but that fix you made both works and doesn't appear to cause anything else to blow up. It's in both master and 1.0.0-dev now, and I'll follow it up with a teensy bugfix release as well. Thanks again for bringing it to my attention, good sir.