The composite and decorator controller
finalize hooks will contain a new field,
This field is in the same format as
customize hook is defined, Metacontroller will ask for which related
objects, or classes of objects that your
finalize hooks need to
This is useful for mapping across many objects. One example would be a controller that lets you specify ConfigMaps to be placed in every Namespace.
Another use-case is being able to reference other objects, e.g. the
section from a core
If you don't define a
customize hook, then the related section of the hooks will
customize hook will not provide any information about the current state of
the cluster. Thus, the set of related objects may only depend on the state of
the parent object.
This hook may also accept other fields in future, for other customizations.
A separate request will be sent for each parent object, so your hook only needs to think about one parent at a time.
The body of the request (a POST in the case of a webhook) will be a JSON object with the following fields:
|The whole CompositeController object, like what you might get from |
|The parent object, like what you might get from |
The body of your response should be a JSON object with the following fields:
|A list of JSON objects representing all the desired related resource label selectors.|
relatedResources field should contain a flat list of objects,
not an associative array.
Each resource rule object should be a JSON object with the following fields:
|The API |
|The canonical, lowercase, plural name of the parent resource. (e.g. |
|Optional. The Namespace to select in|
|Optional. A list of strings, representing individual objects to return|
If the parent resource is cluster scoped and the related resource is namespaced, the namespace may be used to restrict which objects to look at. If the parent resource is namespaced, the related resources must come from the same namespace. Specifying the namespace is optional, but if specified must match.
Note that your webhook handler must return a response with a status code of
to be considered successful. Metacontroller will wait for a response for up to the
amount defined in the Webhook spec.