apiextensions

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0, MIT Imports: 22 Imported by: 19

Documentation

Index

Constants

View Source
const A_MAINTAINER = "crds.gardener.cloud/maintainer"
View Source
const CRD_V1 = CRDVersion("v1")
View Source
const CRD_V1BETA1 = CRDVersion("v1beta1")

Variables

This section is empty.

Functions

func CreateCRD

func CreateCRD(cluster resources.Cluster, groupName, version, rkind, rplural, shortName string, namespaces bool, columns ...v1beta1.CustomResourceColumnDefinition) error

func CreateCRDFromObject

func CreateCRDFromObject(log logger.LogContext, cluster resources.Cluster, crd resources.ObjectData, maintainer string) error

func CreateCRDObject

func CreateCRDObject(groupName, version, rkind, rplural, shortName string, namespaces bool, columns ...v1beta1.CustomResourceColumnDefinition) *v1beta1.CustomResourceDefinition

func CreateCRDObjectWithStatus

func CreateCRDObjectWithStatus(groupName, version, rkind, rplural, shortName string, namespaces bool, columns ...v1beta1.CustomResourceColumnDefinition) *v1beta1.CustomResourceDefinition

func GetCRDFor added in v0.2.0

func GetCRDFor(gk schema.GroupKind, cluster resources.Cluster) resources.ObjectData

func Migrate added in v0.2.0

func Migrate(log logger.LogContext, cluster resources.Cluster, crdName string, migscheme *runtime.Scheme) error

func MustRegisterCRD added in v0.2.0

func MustRegisterCRD(spec CRDSpecification)

func NewKey added in v0.2.0

func NewKey(crdName string) resources.ObjectKey

func RegisterCRD added in v0.2.0

func RegisterCRD(spec CRDSpecification) error

func RegisterClientConfigProvider added in v0.2.0

func RegisterClientConfigProvider(provider WebhookClientConfigProvider)

func WaitCRDReady

func WaitCRDReady(cluster resources.Cluster, crdName string) error

Types

type CRDSpecification added in v0.2.0

type CRDSpecification interface{}

type CRDVersion added in v0.2.0

type CRDVersion string

type CustomResourceDefinition added in v0.2.0

type CustomResourceDefinition struct {
	*apiextensions.CustomResourceDefinition
}

func GetCustomResourceDefinition added in v0.2.0

func GetCustomResourceDefinition(spec CRDSpecification) (*CustomResourceDefinition, error)

func (*CustomResourceDefinition) CRDGroupKind added in v0.2.0

func (this *CustomResourceDefinition) CRDGroupKind() schema.GroupKind

func (*CustomResourceDefinition) CRDRestrict added in v0.2.0

func (this *CustomResourceDefinition) CRDRestrict(versions ...string) (*CustomResourceDefinition, error)

func (*CustomResourceDefinition) CRDVersions added in v0.2.0

func (this *CustomResourceDefinition) CRDVersions() []string

func (*CustomResourceDefinition) ConvertTo added in v0.2.0

func (*CustomResourceDefinition) DataFor added in v0.2.0

func (*CustomResourceDefinition) DeepCopy added in v0.2.0

func (*CustomResourceDefinition) DeepCopyObject added in v0.2.0

func (this *CustomResourceDefinition) DeepCopyObject() runtime.Object

func (*CustomResourceDefinition) ObjectFor added in v0.2.0

type CustomResourceDefinitionVersions added in v0.2.0

type CustomResourceDefinitionVersions struct {
	// contains filtered or unexported fields
}

func GetCRDs added in v0.2.0

func NewCustomResourceDefinitionVersions added in v0.2.0

func NewCustomResourceDefinitionVersions(gk schema.GroupKind) *CustomResourceDefinitionVersions

func NewDefaultedCustomResourceDefinitionVersions added in v0.2.0

func NewDefaultedCustomResourceDefinitionVersions(spec CRDSpecification) (*CustomResourceDefinitionVersions, error)

func (*CustomResourceDefinitionVersions) GetDefault added in v0.2.0

func (*CustomResourceDefinitionVersions) GetFor added in v0.2.0

func (*CustomResourceDefinitionVersions) GetVersions added in v0.2.0

func (*CustomResourceDefinitionVersions) GroupKind added in v0.2.0

func (*CustomResourceDefinitionVersions) Name added in v0.2.0

func (*CustomResourceDefinitionVersions) Override added in v0.2.0

type Registry added in v0.2.0

type Registry interface {
	RegisterCRD(spec CRDSpecification) error
	OverwriteCRD(k8svers *semver.Version, spec CRDSpecification) error
	GetCRDs(gk schema.GroupKind) *CustomResourceDefinitionVersions
	GetCRDDataFor(gk schema.GroupKind, cluster resources.Cluster) resources.ObjectData
	GetCRDObjectFor(gk schema.GroupKind, cluster resources.Cluster) resources.Object

	RegisterClientConfigProvider(provider WebhookClientConfigProvider)
	WebhookClientConfigProvider

	AddToRegistry(r Registry)
}

func DefaultRegistry added in v0.2.0

func DefaultRegistry() Registry

func NewRegistry added in v0.2.0

func NewRegistry() Registry

type ServiceReference added in v0.2.0

type ServiceReference struct {
	// `namespace` is the namespace of the service.
	// Required
	Namespace string
	// `name` is the name of the service.
	// Required
	Name string

	// `path` is an optional URL path which will be sent in any request to
	// this service.
	// +optional
	Path *string

	// If specified, the port on the service that hosting webhook.
	// `port` should be a valid port number (1-65535, inclusive).
	// +optional
	Port int32
}

ServiceReference holds a reference to Service.legacy.k8s.io

func (*ServiceReference) PortP added in v0.2.0

func (this *ServiceReference) PortP() *int32

type WebhookClientConfig added in v0.2.0

type WebhookClientConfig struct {
	// `url` gives the location of the webhook, in standard URL form
	// (`scheme://host:port/path`). Exactly one of `url` or `service`
	// must be specified.
	//
	// The `host` should not refer to a service running in the cluster; use
	// the `service` field instead. The host might be resolved via external
	// DNS in some apiservers (e.g., `kube-apiserver` cannot resolve
	// in-cluster DNS as that would be a layering violation). `host` may
	// also be an IP address.
	//
	// Please note that using `localhost` or `127.0.0.1` as a `host` is
	// risky unless you take great care to run this webhook on all hosts
	// which run an apiserver which might need to make calls to this
	// webhook. Such installs are likely to be non-portable, i.e., not easy
	// to turn up in a new cluster.
	//
	// The scheme must be "https"; the URL must begin with "https://".
	//
	// A path is optional, and if present may be any string permissible in
	// a URL. You may use the path to pass an arbitrary string to the
	// webhook, for example, a cluster identifier.
	//
	// Attempting to use a user or basic auth e.g. "user:password@" is not
	// allowed. Fragments ("#...") and query parameters ("?...") are not
	// allowed, either.
	//
	// +optional
	URL *string

	// `service` is a reference to the service for this webhook. Either
	// `service` or `url` must be specified.
	//
	// If the webhook is running within the cluster, then you should use `service`.
	//
	// +optional
	Service *ServiceReference

	// `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.
	// If unspecified, system trust roots on the apiserver are used.
	// +optional
	CABundle []byte
}

WebhookClientConfig contains the information to make a TLS connection with the webhook. A similar type exists for admission and conversion webhooks, but these are different GO types. Thefore we introduce a dedicated type here that can be configured in a comman way and is then mapped to the webhook specific types.

func (*WebhookClientConfig) WebhookClientConfig added in v0.2.0

func (this *WebhookClientConfig) WebhookClientConfig() *WebhookClientConfig

type WebhookClientConfigProvider added in v0.2.0

type WebhookClientConfigProvider interface {
	GetClientConfig(gk schema.GroupKind, cluster resources.Cluster) WebhookClientConfigSource
}

type WebhookClientConfigSource added in v0.2.0

type WebhookClientConfigSource interface {
	WebhookClientConfig() *WebhookClientConfig
}

func GetClientConfig added in v0.2.0

func GetClientConfig(gk schema.GroupKind, cluster resources.Cluster) WebhookClientConfigSource

func NewDNSWebhookClientConfig added in v0.2.0

func NewDNSWebhookClientConfig(dnsName string, path string, caBundle []byte, port ...int) WebhookClientConfigSource

func NewRuntimeServiceWebhookClientConfig added in v0.2.0

func NewRuntimeServiceWebhookClientConfig(name resources.ObjectName, path string, caBundle []byte, port ...int) WebhookClientConfigSource

func NewServiceWebhookClientConfig added in v0.2.0

func NewServiceWebhookClientConfig(name resources.ObjectName, port int, path string, caBundle []byte) WebhookClientConfigSource

func NewURLWebhookClientConfig added in v0.2.0

func NewURLWebhookClientConfig(url string, caBundle []byte) WebhookClientConfigSource

Jump to

Keyboard shortcuts

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