v1alpha1

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package +groupName=discovery.knative.dev

Index

Constants

View Source
const (
	// DuckTypeConditionReady is set when the revision is starting to materialize
	// runtime resources, and becomes true when those resources are ready.
	DuckTypeConditionReady = apis.ConditionReady
)

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: discovery.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ClusterDuckType

type ClusterDuckType struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the desired state of the ClusterDuckType (from the client).
	// +optional
	Spec ClusterDuckTypeSpec `json:"spec,omitempty"`

	// Status communicates the observed state of the ClusterDuckType (from the controller).
	// +optional
	Status ClusterDuckTypeStatus `json:"status,omitempty"`
}

ClusterDuckType is a query and identifier for Knative-style duck types installed in a cluster.

func (*ClusterDuckType) DeepCopy

func (in *ClusterDuckType) DeepCopy() *ClusterDuckType

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDuckType.

func (*ClusterDuckType) DeepCopyInto

func (in *ClusterDuckType) DeepCopyInto(out *ClusterDuckType)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterDuckType) DeepCopyObject

func (in *ClusterDuckType) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ClusterDuckType) GetConditionSet

func (*ClusterDuckType) GetConditionSet() apis.ConditionSet

GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.

func (*ClusterDuckType) GetGroupVersionKind

func (*ClusterDuckType) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind implements kmeta.OwnerRefable

func (*ClusterDuckType) GetStatus

func (dt *ClusterDuckType) GetStatus() *duckv1.Status

GetStatus retrieves the status of the resource. Implements the KRShaped interface.

func (*ClusterDuckType) SetDefaults

func (dt *ClusterDuckType) SetDefaults(ctx context.Context)

SetDefaults implements apis.Defaultable

func (*ClusterDuckType) Validate

func (dt *ClusterDuckType) Validate(ctx context.Context) (errs *apis.FieldError)

Validate implements apis.Validatable

type ClusterDuckTypeList

type ClusterDuckTypeList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []ClusterDuckType `json:"items"`
}

ClusterDuckTypeList is a list of ClusterDuckType resources

func (*ClusterDuckTypeList) DeepCopy

func (in *ClusterDuckTypeList) DeepCopy() *ClusterDuckTypeList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDuckTypeList.

func (*ClusterDuckTypeList) DeepCopyInto

func (in *ClusterDuckTypeList) DeepCopyInto(out *ClusterDuckTypeList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterDuckTypeList) DeepCopyObject

func (in *ClusterDuckTypeList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterDuckTypeSpec

type ClusterDuckTypeSpec struct {
	// Group is the API group of the defined duck type.
	// Must match the name of the ClusterDuckType (in the form `<names.plural>.<group>`).
	Group string `json:"group"`

	// Names holds the naming conventions for this duck type.
	Names DuckTypeNames `json:"names"`

	// Versions holds the schema and printer column mappings for specific
	// versions for duck types.
	Versions []DuckVersion `json:"versions" patchStrategy:"merge" patchMergeKey:"name"`

	// Selectors is a list of selectors for CustomResourceDefinitions to identify a duck type.
	// +optional
	Selectors []CustomResourceDefinitionSelector `json:"selectors,omitempty"`

	//Role holds an Aggregating Role used by the duck type to manage the ducks.
	//  If not specified, the Selectors are used to find a Role with an aggregation rule that matches a selector
	// +optional
	Role *Role `json:"role,omitempty"`
}

ClusterDuckTypeSpec holds the desired state of the ClusterDuckType (from the client). +k8s:openapi-gen=true

func (*ClusterDuckTypeSpec) DeepCopy

func (in *ClusterDuckTypeSpec) DeepCopy() *ClusterDuckTypeSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDuckTypeSpec.

func (*ClusterDuckTypeSpec) DeepCopyInto

func (in *ClusterDuckTypeSpec) DeepCopyInto(out *ClusterDuckTypeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterDuckTypeSpec) SetDefaults

func (dts *ClusterDuckTypeSpec) SetDefaults(ctx context.Context)

SetDefaults implements apis.Defaultable

func (*ClusterDuckTypeSpec) Validate

func (dts *ClusterDuckTypeSpec) Validate(ctx context.Context) (errs *apis.FieldError)

Validate implements apis.Validatable

type ClusterDuckTypeStatus

type ClusterDuckTypeStatus struct {
	duckv1.Status `json:",inline"`

	// Ducks is a versioned mapping of the found resources that implement this duck.
	Ducks map[string][]ResourceMeta `json:"ducks,omitempty"`

	// DuckCount is the count of unique duck types found post-hunt.
	DuckCount int `json:"duckCount"`

	//ClusterRole Aggregation Rule
	ClusterRoleAggregationRule rbacv1.AggregationRule `json:"clusterRoleAggregationRule,omitempty"`
}

ClusterDuckTypeStatus communicates the observed state of the ClusterDuckType (from the controller).

func (*ClusterDuckTypeStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDuckTypeStatus.

func (*ClusterDuckTypeStatus) DeepCopyInto

func (in *ClusterDuckTypeStatus) DeepCopyInto(out *ClusterDuckTypeStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterDuckTypeStatus) InitializeConditions

func (dts *ClusterDuckTypeStatus) InitializeConditions()

InitializeConditions sets the initial values to the conditions.

func (*ClusterDuckTypeStatus) MarkReady

func (dts *ClusterDuckTypeStatus) MarkReady()

TODO: temp function, delete later as we develop the reconciler.

type CustomResourceDefinitionSelector

type CustomResourceDefinitionSelector struct {

	// LabelSelector is a label selector used to find CRDs that associate with
	// the duck type.
	// Typically this will be in the form:
	//   `<group>/<names.singular>=true`
	// Annotations are used to map the versions of the CRD to the correct
	// ducktype. The annotation is expected to be in the form:
	//   `<names.plural>.<group>/<versions[x].name>=[CRD.Version]`
	// and results in `x = CRD.Version`.
	// The duck type version annotation can have several CRD versions that map:
	//   `<names.plural>.<group>/<versions[x].name>=[CRD.V1],[CRD.V2],[CRD.V3]`
	// this tells the interrupter to match x to all of V1, V2 and V3 versions.
	// If the version mapping annotation is missing, it is assumed this applies
	// as the match.
	// Must be a valid Kubernetes Label Selector.
	LabelSelector string `json:"labelSelector,omitempty" yaml:"labelSelector,omitempty"`
}

CustomResourceDefinitionSelector

func (*CustomResourceDefinitionSelector) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitionSelector.

func (*CustomResourceDefinitionSelector) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DuckTypeNames

type DuckTypeNames struct {
	// Name is the serialized name of the resource. It is normally CamelCase and singular.
	Name string `json:"name"`

	// Plural is the plural name of the duck type.
	// Must match the name of the ClusterDuckType (in the form `<names.plural>.<group>`).
	// Must be all lowercase.
	Plural string `json:"plural"`

	// Singular is the singular name of the duck type. It must be all lowercase.
	// Defaults to lowercased `name`.
	Singular string `json:"singular"`
}

DuckTypeNames provides the naming rules for this duck type.

func (*DuckTypeNames) DeepCopy

func (in *DuckTypeNames) DeepCopy() *DuckTypeNames

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DuckTypeNames.

func (*DuckTypeNames) DeepCopyInto

func (in *DuckTypeNames) DeepCopyInto(out *DuckTypeNames)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DuckTypeNames) Validate

func (dtn *DuckTypeNames) Validate(ctx context.Context) (errs *apis.FieldError)

Validate implements apis.Validatable

type DuckVersion

type DuckVersion struct {
	// Name is the name of this duck type version.
	Name string `json:"name"`

	// Refs is a list of ResourceRefs that implement this duck type.
	// Used for manual discovery.
	// +optional
	Refs []ResourceRef `json:"refs,omitempty"`

	// Custom Columns to be used to pretty print the duck type at this version.
	// +optional
	AdditionalPrinterColumns []apiextensionsv1.CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty"`

	// Partial Schema of this version of the duck type.
	// +optional
	Schema *apiextensionsv1.CustomResourceValidation `json:"schema,omitempty"`
}

DuckVersion

func (*DuckVersion) DeepCopy

func (in *DuckVersion) DeepCopy() *DuckVersion

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DuckVersion.

func (*DuckVersion) DeepCopyInto

func (in *DuckVersion) DeepCopyInto(out *DuckVersion)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DuckVersion) SetDefaults

func (dv *DuckVersion) SetDefaults(ctx context.Context)

SetDefaults implements apis.Defaultable

func (*DuckVersion) Validate

func (dv *DuckVersion) Validate(ctx context.Context) (errs *apis.FieldError)

Validate implements apis.Validatable

type ResourceMeta

type ResourceMeta struct {
	// APIVersion is the group and version of the resource combined.
	APIVersion string `json:"apiVersion,omitempty"`

	// Kind is the CamelCased resource kind.
	Kind string `json:"kind"`

	// Scope indicates whether the resource is cluster- or namespace-scoped.
	// Allowed values are `Cluster` and `Namespaced`.
	Scope ResourceScope `json:"scope"`

	// AccessibleViaClusterRole indicates whether the provided ClusterDuckType Role can perform get, list & watch on the resource
	AccessibleViaClusterRole bool `json:"accessibleByClusterRole"`
}

ResourceMeta is a resolved ResourceRef.

func (*ResourceMeta) DeepCopy

func (in *ResourceMeta) DeepCopy() *ResourceMeta

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceMeta.

func (*ResourceMeta) DeepCopyInto

func (in *ResourceMeta) DeepCopyInto(out *ResourceMeta)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceMeta) Group

func (r *ResourceMeta) Group() string

Group inspects a ResourceMeta object and returns the correct group based on APIVersion.

func (*ResourceMeta) Version

func (r *ResourceMeta) Version() string

Version inspects a ResourceMeta object and returns the correct version based on APIVersion.

type ResourceRef

type ResourceRef struct {
	// Group is the resource group.
	// +optional, must not be set if APIVersion is set.
	Group string `json:"group,omitempty"`
	// Version is the version the duck type applies to for the resource.
	// +optional
	// +optional, one of [Version, APIVersion] required.
	Version string `json:"version,omitempty"`

	// APIVersion is the group and version of the resource combined.
	// - if group is non-empty, `group/version`
	// - if group is empty, `version`
	// +optional, one of [Version, APIVersion] required.
	APIVersion string `json:"apiVersion,omitempty"`

	// Resource is the plural resource name.
	// +optional, one of [Resource, Kind] required.
	Resource string `json:"resource,omitempty"`
	// Kind is the CamelCased resource kind.
	// +optional, one of [Resource, Kind] required.
	Kind string `json:"kind,omitempty"`

	// Scope indicates whether the resource is cluster- or namespace-scoped.
	// +optional, allowed values are `Cluster` and `Namespaced`, defaults to "Namespaced".
	Scope ResourceScope `json:"scope"`
}

ResourceRef points to a Kubernetes Resource kind.

func (*ResourceRef) DeepCopy

func (in *ResourceRef) DeepCopy() *ResourceRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRef.

func (*ResourceRef) DeepCopyInto

func (in *ResourceRef) DeepCopyInto(out *ResourceRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceRef) GroupVersion

func (r *ResourceRef) GroupVersion() string

APIVersion puts "group" and "version" into a single "group/version" string or returns APIVersion.

func (*ResourceRef) SetDefaults

func (rr *ResourceRef) SetDefaults(ctx context.Context)

func (*ResourceRef) Validate

func (g *ResourceRef) Validate(ctx context.Context) (errs *apis.FieldError)

Validate implements apis.Validatable

type ResourceScope

type ResourceScope string

ResourceScope is an enum defining the different scopes available to a custom resource

const (
	ClusterScoped   ResourceScope = "Cluster"
	NamespaceScoped ResourceScope = "Namespaced"
)

type Role added in v0.22.0

type Role struct {
	// RoleRef is a reference to the Aggregating Role
	// +optional
	RoleRef *rbacv1.RoleRef `json:"roleRef,omitempty"`
}

Role provides a way of specifying which Aggregating Role is used by the duck type to manage the ducks

func (*Role) DeepCopy added in v0.22.0

func (in *Role) DeepCopy() *Role

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Role.

func (*Role) DeepCopyInto added in v0.22.0

func (in *Role) DeepCopyInto(out *Role)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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