Documentation
¶
Index ¶
- Variables
- func ClientsGeneratedForType(info *markers.TypeInfo) bool
- func CollectKinds(ctx *genall.GenerationContext, verbs ...string) (map[Group]map[types.PackageVersion][]Kind, error)
- func IsClusterScoped(info *markers.TypeInfo) bool
- func IsNamespaced(info *markers.TypeInfo) bool
- func SupportedVerbs(info *markers.TypeInfo) (sets.String, error)
- func SupportsVerbs(info *markers.TypeInfo, verbs ...string) (bool, error)
- type Extension
- type Group
- type Kind
Constants ¶
This section is empty.
Variables ¶
var ( // In controller-tool's terms marker's are defined in the following format: <makername>:<parameter>=<values>. These // markers are not a part of genclient, since they do not accept any values. GenclientMarker = markers.Must(markers.MakeDefinition("genclient", markers.DescribesType, extension{})) NonNamespacedMarker = markers.Must(markers.MakeDefinition("genclient:nonNamespaced", markers.DescribesType, struct{}{})) // These markers, are not a part of "+genclient", and are defined separately because they accept a list which is comma separated. In // controller-tools, comma indicates another argument, as multiple arguments need to provided with a semi-colon separator. SkipVerbsMarker = markers.Must(markers.MakeDefinition("genclient:skipVerbs", markers.DescribesType, markers.RawArguments(""))) OnlyVerbsMarker = markers.Must(markers.MakeDefinition("genclient:onlyVerbs", markers.DescribesType, markers.RawArguments(""))) GroupNameMarker = markers.Must(markers.MakeDefinition("groupName", markers.DescribesPackage, markers.RawArguments(""))) GroupGoNameMarker = markers.Must(markers.MakeDefinition("groupGoName", markers.DescribesPackage, markers.RawArguments(""))) // In controller-tool's terms marker's are defined in the following format: <makername>:<parameter>=<values>. These // markers are not a part of genclient, since they do not accept any values. NoStatusMarker = markers.Must(markers.MakeDefinition("genclient:noStatus", markers.DescribesType, struct{}{})) NoVerbsMarker = markers.Must(markers.MakeDefinition("genclient:noVerbs", markers.DescribesType, struct{}{})) ReadOnlyMarker = markers.Must(markers.MakeDefinition("genclient:readonly", markers.DescribesType, struct{}{})) )
Functions ¶
func ClientsGeneratedForType ¶
ClientsGeneratedForType verifies if the genclient marker is enabled for this type or not.
func CollectKinds ¶
func CollectKinds(ctx *genall.GenerationContext, verbs ...string) (map[Group]map[types.PackageVersion][]Kind, error)
CollectKinds finds all groupVersionKinds for which the k8s client-generators are run and the set of verbs are supported. When we are looking at a package, we can determine the group and version by copying the upstream logic: https://github.com/kubernetes/kubernetes/blob/f046bdf24e69ac31d3e1ed56926d9a7c715f1cc8/staging/src/k8s.io/code-generator/cmd/lister-gen/generators/lister.go#L93-L106
func IsClusterScoped ¶
IsClusterScoped verifies if the genclient marker for this type is namespaced or clusterscoped.
func IsNamespaced ¶
IsNamespaced verifies if the genclient marker for this type is namespaced.
func SupportedVerbs ¶
SupportedVerbs determines which verbs the type supports
Types ¶
type Extension ¶
type Extension struct { Method string Verb string Subresource string InputPath string InputType string ResultPath string ResultType string }