Documentation ¶
Index ¶
- Variables
- func FromUnstructured(in runtime.Unstructured, out runtime.Object) error
- func GetResourceClient(cl *dynamic.Client, kind Kind, namespace string) (*dynamic.ResourceClient, error)
- func InstallTypes(cl extensionsv1beta.ThirdPartyResourceInterface) error
- func NewStorage(opts Options) (storage.Interface, factory.DestroyFunc)
- func ToUnstructured(in runtime.Object) (*runtime.Unstructured, error)
- type ErrTPRInstall
- type Keyer
- type Kind
- type Options
Constants ¶
This section is empty.
Variables ¶
var ServiceBrokerResource = metav1.APIResource{ Name: ServiceBrokerKind.TPRName(), Namespaced: true, }
ServiceBrokerResource represents the API resource for the service broker third party resource
var ServiceClassResource = metav1.APIResource{ Name: ServiceClassKind.TPRName(), Namespaced: true, }
ServiceClassResource represents the API resource for the service class third party resource
var ServiceInstanceCredentialResource = metav1.APIResource{ Name: ServiceInstanceCredentialKind.TPRName(), Namespaced: true, }
ServiceInstanceCredentialResource represents the API resource for the service
instance credential third party resource
var ServiceInstanceResource = metav1.APIResource{ Name: ServiceInstanceKind.TPRName(), Namespaced: true, }
ServiceInstanceResource represents the API resource for the service instance third party resource
var ServicePlanResource = metav1.APIResource{ Name: ServicePlanKind.TPRName(), Namespaced: true, }
ServicePlanResource represents the API resource for the service plan third party resource
Functions ¶
func FromUnstructured ¶
func FromUnstructured(in runtime.Unstructured, out runtime.Object) error
FromUnstructured converts o, a Kubernetes Third Party Resource type, into a *runtime.Unstructured and writes it to object. Returns a non-nil error is there were any issues with the conversion
func GetResourceClient ¶
func GetResourceClient(cl *dynamic.Client, kind Kind, namespace string) (*dynamic.ResourceClient, error)
GetResourceClient returns the *dynamic.ResourceClient for a given resource type
func InstallTypes ¶
func InstallTypes(cl extensionsv1beta.ThirdPartyResourceInterface) error
InstallTypes installs all third party resource types to the cluster
func NewStorage ¶
func NewStorage(opts Options) (storage.Interface, factory.DestroyFunc)
NewStorage creates a new TPR-based storage.Interface implementation
func ToUnstructured ¶
func ToUnstructured(in runtime.Object) (*runtime.Unstructured, error)
ToUnstructured converts in (which should be a Service Catalog third party object type) into a runtime.Unstructured for use in writing to Kubernetes
Types ¶
type ErrTPRInstall ¶
type ErrTPRInstall struct {
// contains filtered or unexported fields
}
ErrTPRInstall is returned when we fail to install TPR
func (ErrTPRInstall) Error ¶
func (e ErrTPRInstall) Error() string
type Keyer ¶
Keyer is a containing struct for
func (Keyer) Key ¶
Key is a (k8s.io/kubernetes/pkg/registry/generic/registry).Store compatible function to get the key to be passed to a third party resource based storage Interface.
It is meant to be passed to a Store's KeyRoot field, so that a TPR based storage interface can parse the namespace and name from fields that it is later given
func (Keyer) KeyRoot ¶
KeyRoot is a (k8s.io/kubernetes/pkg/registry/generic/registry).Store compatible function to get the key root to be passed to a third party resource based storage Interface.
It is meant to be passed to a Store's KeyRootFunc field, so that a TPR based storage interface can parse the namespace and name from fields that it is later given.
The returned string will never be empty is k.DefaultNamespace is not empty
func (Keyer) NamespaceAndNameFromKey ¶
NamespaceAndNameFromKey returns the namespace (or an empty string if there wasn't one) and name for a given etcd-style key. This function is intended to be used in a TPR based storage.Interface that uses k.KeyRoot and k.Key to construct its etcd keys.
The first return value is the namespace, and may be empty if the key represents a namespace-less resource. The second return value is the name and will not be empty if the error is nil. The error will be non-nil if the key was malformed, in which case all other return values will be empty strings.
type Kind ¶
type Kind string
Kind represents the kind of a third party resource. This type implements fmt.Stringer
const ( // ServiceBrokerKind is the name of a Service Broker resource, a Kubernetes third party resource. ServiceBrokerKind Kind = "ServiceBroker" // ServiceBrokerListKind is the name of a list of Service Broker resources ServiceBrokerListKind Kind = "ServiceBrokerList" // ServiceInstanceCredentialKind is the name of a Service Instance // Credential resource, a Kubernetes third party resource. ServiceInstanceCredentialKind Kind = "ServiceInstanceCredential" // ServiceInstanceCredentialListKind is the name for lists of Service // Instance Credentials ServiceInstanceCredentialListKind Kind = "ServiceInstanceCredentialList" // ServiceClassKind is the name of a Service Class resource, a Kubernetes third party resource. ServiceClassKind Kind = "ServiceClass" // ServiceClassListKind is the name of a list of service class resources ServiceClassListKind Kind = "ServiceClassList" // ServicePlanKind is the name of a Service Plan resource, a Kubernetes third party resource. ServicePlanKind Kind = "ServicePlan" // ServicePlanListKind is the name of a list of service plan resources ServicePlanListKind Kind = "ServicePlanList" // ServiceInstanceKind is the name of a Service Instance resource, a Kubernetes third party resource. ServiceInstanceKind Kind = "ServiceInstance" // ServiceInstanceListKind is the name of a list of service instance resources ServiceInstanceListKind Kind = "ServiceInstanceList" )
func (Kind) TPRName ¶
TPRName returns the lowercase name, suitable for creating third party resources of this kind
func (Kind) URLName ¶
URLName returns the URL-worthy name this TPR kind. Examples:
Kind("ServiceBroker").URLName() == "servicebrokers" Kind("ServiceClass").URLName() == "serviceclasses" Kind("ServiceInstance").URLName() == "serviceinstances" Kind("ServiceInstanceCredntial").URLName() == "serviceinstancecredentials"
Note that this function is incomplete - it is only guaranteed to properly pluralize our 4 resource types ("ServiceBroker", "ServiceClass", "ServiceInstance", "ServiceInstanceCredential")
type Options ¶
type Options struct { HasNamespace bool RESTOptions generic.RESTOptions DefaultNamespace string RESTClient restclient.Interface SingularKind Kind // NewSingularFunc is a function that returns a new object of the appropriate type, // with the namespace (first param) and name (second param) pre-filled NewSingularFunc func(string, string) runtime.Object ListKind Kind // NewListFunc is a function that returns a new, empty list object of the appropriate // type. The list object should hold elements that are returned by NewSingularFunc NewListFunc func() runtime.Object CheckObjectFunc func(runtime.Object) error DestroyFunc func() Keyer Keyer HardDelete bool }
Options is the set of options to create a new TPR storage interface