parser

package
v0.0.0-...-2dc1248 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func ClientsGeneratedForType(info *markers.TypeInfo) bool

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

func IsClusterScoped(info *markers.TypeInfo) bool

IsClusterScoped verifies if the genclient marker for this type is namespaced or clusterscoped.

func IsNamespaced

func IsNamespaced(info *markers.TypeInfo) bool

IsNamespaced verifies if the genclient marker for this type is namespaced.

func SupportedVerbs

func SupportedVerbs(info *markers.TypeInfo) (sets.String, error)

SupportedVerbs determines which verbs the type supports

func SupportsVerbs

func SupportsVerbs(info *markers.TypeInfo, verbs ...string) (bool, error)

SupportsVerbs determines if the type supports all the verbs.

Types

type Extension

type Extension struct {
	Method      string
	Verb        string
	Subresource string
	InputPath   string
	InputType   string
	ResultPath  string
	ResultType  string
}

func ClientExtensions

func ClientExtensions(info *markers.TypeInfo) []Extension

type Group

type Group struct {
	types.Group
	GoName string
}

type Kind

type Kind struct {
	SupportedVerbs sets.String
	Extensions     []Extension
	// contains filtered or unexported fields
}

func NewKind

func NewKind(kind string, namespaced bool, supportedVerbs sets.String, extensions []Extension) Kind

func (*Kind) IsNamespaced

func (k *Kind) IsNamespaced() bool

func (*Kind) Plural

func (k *Kind) Plural() string

func (*Kind) String

func (k *Kind) String() string

func (*Kind) SupportsListWatch

func (k *Kind) SupportsListWatch() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL