in config/v1beta2/types.go [233:249]
func (c *PluginConfig) decodeNestedObjects(d runtime.Decoder) error {
gvk := SchemeGroupVersion.WithKind(c.Name + "Args")
// dry-run to detect and skip out-of-tree plugin args.
if _, _, err := d.Decode(nil, &gvk, nil); runtime.IsNotRegisteredError(err) {
return nil
}
obj, parsedGvk, err := d.Decode(c.Args.Raw, &gvk, nil)
if err != nil {
return fmt.Errorf("decoding args for plugin %s: %w", c.Name, err)
}
if parsedGvk.GroupKind() != gvk.GroupKind() {
return fmt.Errorf("args for plugin %s were not of type %s, got %s", c.Name, gvk.GroupKind(), parsedGvk.GroupKind())
}
c.Args.Object = obj
return nil
}