When generating types, any field with name "id" was being skipped. The intention
here was to skip the "id" field of the embedded types.Resource struct. A type
will have an embedded types.Resource struct when the hasGet function returns
true. Therefore, this hasGet function is also used to skip the id fields as
desired.
Add a new field attribute "pointer" to indicate that the generated
client code for the field must be a pointer. This allows clients to
differentiate between sending nil/leaving the value unset and sending an
empty map or slice.
This change also removes the `nullablestring` norman type introduced in
30f8d18 since schemas that need a pointer to a string can now use this
field attribute. There are no libraries currently using this feature so
it should be safe to remove.
Example usage:
```
Labels map[string]string `json:"labels" norman:"pointer"`
```
Resulting API schema:
```
"labels": {
"create": true,
"nullable": true,
"pointer": true,
"type": "map[string]",
"update": true
}
```
Generated client code:
```
Labels *map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
```
Currently, `*string` fields in Go structs are converted to `{type:
string, nullable: true}` in the API schema, which is right, but then
converted down to just `string` when converted to generated client
structs. Without this patch, there is no way to express that `*string`s
should stay as `*string`s when run through the generator, because the
'nullable' flag is ignored. Compare this to `*bool`s, which become
`boolean` in the schema and then correctly converted back to *bool in
the generator. This patch adds a backwards-compatible way to opt in to
converting `*string`s in the original struct to *strings in the
generated struct.
Added enable function to schemas. This allows filtering of schemas
which is a required part of feature flagging in rancher. Added
addFeature functions to controller template for adding handlers that
can be disabled if their associated feature is disabled.
Problem: Cluster scoped gc was taking significantly longer to complete
than before 7387aa5. This was due to a large number of list calls and
the time needed to iterate over them.
Solution: Instead of requesting every type than Rancher uses, a
seperate map appended to when a cluster scoped handler
is created. The full map of all GroupVersionResources is kept as a
fallback for the use case where user controllers may exist on another
host other than the current leader.
Problem: Cluster scoped handlers were not being cleaned up without
manually writing garbage collection functions.
Solution: All cluster scoped handlers will be recorded in a global map
in a generic format so that they can be removed by a generic function.