types

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceClusterRole           = "clusterroles"
	ResourceClusterRoleBinding    = "clusterrolebindings"
	ResourceConfigMap             = "configmaps"
	ResourceCronJob               = "cronjobs"
	ResourceDaemonSet             = "daemonsets"
	ResourceDeployment            = "deployments"
	ResourceIngress               = "ingresses"
	ResourceIngressClass          = "ingressclasses"
	ResourceJob                   = "jobs"
	ResourceNamespace             = "namespaces"
	ResourceNetworkPolicy         = "networkpolicies"
	ResourceNode                  = "nodes"
	ResourcePersistentVolume      = "persistentvolumes"
	ResourcePersistentVolumeClaim = "persistentvolumeclaims"
	ResourcePod                   = "pods"
	ResourceReplicaSet            = "replicasets"
	ResourceReplicationController = "replicationcontrollers"
	ResourceRole                  = "roles"
	ResourceRoleBinding           = "rolebindings"
	ResourceSecret                = "secrets"
	ResourceService               = "services"
	ResourceServiceAccount        = "serviceaccounts"
	ResourceStatefulSet           = "statefulsets"
	ResourceStorageClass          = "storageclasses"
)

k8s resource name

View Source
const (
	KindClusterRole           = "ClusterRole"
	KindClusterRoleBinding    = "ClusterRoleBinding"
	KindConfigMap             = "ConfigMap"
	KindCronJob               = "CronJob"
	KindDaemonSet             = "DaemonSet"
	KindDeployment            = "Deployment"
	KindIngress               = "Ingress"
	KindIngressClass          = "IngressClass"
	KindJob                   = "Job"
	KindNamespace             = "Namespace"
	KindNetworkPolicy         = "NetworkPolicy"
	KindNode                  = "Node"
	KindPersistentVolume      = "PersistentVolume"
	KindPersistentVolumeClaim = "PersistentVolumeClaim"
	KindPod                   = "Pod"
	KindReplicaSet            = "ReplicaSet"
	KindReplicationController = "ReplicationController"
	KindRole                  = "Role"
	KindRoleBinding           = "RoleBinding"
	KindSecret                = "Secret"
	KindService               = "Service"
	KindServiceAccount        = "ServiceAccount"
	KindStatefulSet           = "StatefulSet"
	KindStorageClass          = "StorageClass"
)

k8s resource kind

Variables

Functions

This section is empty.

Types

type Applyer

type Applyer interface {
	Apply(Object) (Object, error)
}

Applyer

type Creater

type Creater interface {
	Create(Object) (Object, error)
}

Creater

type Deleter

type Deleter interface {
	Delete(Object) error
}

Deleter

type Geter

type Geter interface {
	Get(Object) (Object, error)
}

Geter

type HandlerInterface added in v0.7.0

type HandlerInterface interface {
	Creater
	Updater
	Applyer
	Deleter
	Geter
}

type HandlerOptions

type HandlerOptions struct {
	ListOptions   metav1.ListOptions
	GetOptions    metav1.GetOptions
	CreateOptions metav1.CreateOptions
	DeleteOptions metav1.DeleteOptions
	ApplyOptions  metav1.ApplyOptions
	UpdateOptions metav1.UpdateOptions
	PatchOptions  metav1.PatchOptions
}

type Object added in v0.6.1

type Object interface {
	metav1.Object
	runtime.Object
}

Object is a Kubernetes object, allows functions to work indistinctly with any resource that implements both Object interfaces.

Semantically, these are objects which are both serializable (runtime.Object) and identifiable (metav1.Object) -- think any object which you could write as YAML or JSON, and then `kubectl create`.

Code-wise, this means that any object which embeds both ObjectMeta (which provides metav1.Object) and TypeMeta (which provides half of runtime.Object) and has a `DeepCopyObject` implementation (the other half of runtime.Object) will implement this by default.

For example, nearly all the built-in types are Objects, as well as all KubeBuilder-generated CRDs (unless you do something real funky to them).

By and large, most things that implement runtime.Object also implement Object -- it's very rare to have *just* a runtime.Object implementation (the cases tend to be funky built-in types like Webhook payloads that don't have a `metadata` field).

Notice that XYZList types are distinct: they implement ObjectList instead.

type ObjectList added in v0.6.1

type ObjectList interface {
	metav1.ListInterface
	runtime.Object
}

ObjectList is a Kubernetes object list, allows functions to work indistinctly with any resource that implements both runtime.Object and metav1.ListInterface interfaces.

Semantically, this is any object which may be serialized (ObjectMeta), and is a kubernetes list wrapper (has items, pagination fields, etc) -- think the wrapper used in a response from a `kubectl list --output yaml` call.

Code-wise, this means that any object which embedds both ListMeta (which provides metav1.ListInterface) and TypeMeta (which provides half of runtime.Object) and has a `DeepCopyObject` implementation (the other half of runtime.Object) will implement this by default.

For example, nearly all the built-in XYZList types are ObjectLists, as well as the XYZList types for all KubeBuilder-generated CRDs (unless you do something real funky to them).

By and large, most things that are XYZList and implement runtime.Object also implement ObjectList -- it's very rare to have *just* a runtime.Object implementation (the cases tend to be funky built-in types like Webhook payloads that don't have a `metadata` field).

This is similar to Object, which is almost always implemented by the items in the list themselves.

type Updater

type Updater interface {
	Update(Object) (Object, error)
}

Updater

Jump to

Keyboard shortcuts

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