engine: resources, lang: Set resource fields more accurately
There were some bugs about setting resource fields that were structs with various fields. This makes things more strict and correct. Now we check for duplicate field names earlier (duplicates due to identical aliases) and we also don't try and set private fields, or incorrectly set partial structs. Most interestingly, this also cleans up all of the resources and ensures that each one has nicer docs and a clear struct tag for fields that we want to use in mcl. These are mandatory now, and if you're missing the tag, then we will ignore the field.
This commit is contained in:
@@ -52,15 +52,17 @@ type PippetRes struct {
|
||||
// from a module. The Puppet installation local to the mgmt agent
|
||||
// machine must be able recognize it. It has to be a native type though,
|
||||
// as opposed to defined types from your Puppet manifest code.
|
||||
Type string `yaml:"type" json:"type"`
|
||||
Type string `lang:"type" yaml:"type" json:"type"`
|
||||
|
||||
// Title is used by Puppet as the resource title. Puppet will often
|
||||
// assign special meaning to the title, e.g. use it as the path for a
|
||||
// file resource, or the name of a package.
|
||||
Title string `yaml:"title" json:"title"`
|
||||
Title string `lang:"title" yaml:"title" json:"title"`
|
||||
|
||||
// Params is expected to be a hash in YAML format, pairing resource
|
||||
// parameter names with their respective values, e.g. { ensure: present
|
||||
// }
|
||||
Params string `yaml:"params" json:"params"`
|
||||
Params string `lang:"params" yaml:"params" json:"params"`
|
||||
|
||||
runner *pippetReceiver
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user