crd

package
v0.0.0-...-d8a8f93 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package crd provides an implementation of the config store and cache using Kubernetes Custom Resources and the informer framework from Kubernetes This implementation is adopted from github.com/istio/pilot/pkg/config/kube/crd/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRESTConfig

func CreateRESTConfig(kubeconfig string) (restconfig *rest.Config, err error)

CreateRESTConfig for cluster API server, pass empty config file for in-cluster

Types

type Client

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

Client is a basic REST client for CRDs implementing config store

func NewClient

func NewClient(config string, descriptor config.Descriptor) (*Client, error)

NewClient creates a client to Kubernetes API using a kubeconfig file. Use an empty value for `kubeconfig` to use the in-cluster config. If the kubeconfig file is empty, defaults to in-cluster config as well.

func (*Client) Create

func (cl *Client) Create(entry config.Entry) (string, error)

Create implements store interface

func (*Client) Delete

func (cl *Client) Delete(typ, name, namespace string) error

Delete implements store interface

func (*Client) DeregisterResources

func (cl *Client) DeregisterResources() error

DeregisterResources removes third party resources

func (*Client) Descriptor

func (cl *Client) Descriptor() config.Descriptor

Descriptor for the store

func (*Client) Get

func (cl *Client) Get(typ, name, namespace string) (*config.Entry, bool)

Get implements store interface

func (*Client) List

func (cl *Client) List(typ, namespace string) ([]config.Entry, error)

List implements store interface

func (*Client) RegisterResources

func (cl *Client) RegisterResources() error

RegisterResources sends a request to create CRDs and waits for them to initialize

func (*Client) Update

func (cl *Client) Update(entry config.Entry) (string, error)

Update implements store interface

type FakeConfig

type FakeConfig struct {
	meta_v1.TypeMeta   `json:",inline"`
	meta_v1.ObjectMeta `json:"metadata"`
	Spec               map[string]interface{} `json:"spec"`
}

FakeConfig is the generic Kubernetes API object wrapper

func (*FakeConfig) DeepCopy

func (in *FakeConfig) DeepCopy() *FakeConfig

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

func (*FakeConfig) DeepCopyInto

func (in *FakeConfig) DeepCopyInto(out *FakeConfig)

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

func (*FakeConfig) DeepCopyObject

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

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

func (*FakeConfig) GetObjectMeta

func (in *FakeConfig) GetObjectMeta() meta_v1.ObjectMeta

GetObjectMeta from a wrapper

func (*FakeConfig) GetSpec

func (in *FakeConfig) GetSpec() map[string]interface{}

GetSpec from a wrapper

func (*FakeConfig) SetObjectMeta

func (in *FakeConfig) SetObjectMeta(metadata meta_v1.ObjectMeta)

SetObjectMeta for a wrapper

func (*FakeConfig) SetSpec

func (in *FakeConfig) SetSpec(spec map[string]interface{})

SetSpec for a wrapper

type FakeConfigList

type FakeConfigList struct {
	meta_v1.TypeMeta `json:",inline"`
	meta_v1.ListMeta `json:"metadata"`
	Items            []*FakeConfig `json:"items"`
}

FakeConfigList is the generic Kubernetes API list wrapper

func (*FakeConfigList) DeepCopy

func (in *FakeConfigList) DeepCopy() *FakeConfigList

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

func (*FakeConfigList) DeepCopyInto

func (in *FakeConfigList) DeepCopyInto(out *FakeConfigList)

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

func (*FakeConfigList) DeepCopyObject

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

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

func (*FakeConfigList) GetItems

func (in *FakeConfigList) GetItems() []IstioObject

GetItems from a wrapper

type IstioKind

type IstioKind struct {
	meta_v1.TypeMeta   `json:",inline"`
	meta_v1.ObjectMeta `json:"metadata"`
	Spec               map[string]interface{} `json:"spec"`
}

IstioKind is the generic Kubernetes API object wrapper

func (*IstioKind) DeepCopy

func (in *IstioKind) DeepCopy() *IstioKind

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

func (*IstioKind) DeepCopyInto

func (in *IstioKind) DeepCopyInto(out *IstioKind)

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

func (*IstioKind) DeepCopyObject

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

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

func (*IstioKind) GetObjectMeta

func (in *IstioKind) GetObjectMeta() meta_v1.ObjectMeta

GetObjectMeta from a wrapper

func (*IstioKind) GetSpec

func (in *IstioKind) GetSpec() map[string]interface{}

GetSpec from a wrapper

func (*IstioKind) SetObjectMeta

func (in *IstioKind) SetObjectMeta(metadata meta_v1.ObjectMeta)

SetObjectMeta for a wrapper

func (*IstioKind) SetSpec

func (in *IstioKind) SetSpec(spec map[string]interface{})

SetSpec for a wrapper

type IstioKindList

type IstioKindList struct {
	meta_v1.TypeMeta `json:",inline"`
	meta_v1.ListMeta `json:"metadata"`
	Items            []*IstioKind `json:"items"`
}

IstioKindList is the generic Kubernetes API list wrapper

func (*IstioKindList) DeepCopy

func (in *IstioKindList) DeepCopy() *IstioKindList

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

func (*IstioKindList) DeepCopyInto

func (in *IstioKindList) DeepCopyInto(out *IstioKindList)

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

func (*IstioKindList) DeepCopyObject

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

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

func (*IstioKindList) GetItems

func (in *IstioKindList) GetItems() []IstioObject

GetItems from a wrapper

type IstioObject

type IstioObject interface {
	runtime.Object
	GetSpec() map[string]interface{}
	SetSpec(map[string]interface{})
	GetObjectMeta() meta_v1.ObjectMeta
	SetObjectMeta(meta_v1.ObjectMeta)
}

IstioObject is a k8s wrapper interface for config objects

type IstioObjectList

type IstioObjectList interface {
	runtime.Object
	GetItems() []IstioObject
}

IstioObjectList is a k8s wrapper interface for config lists

type ServiceClass

type ServiceClass struct {
	meta_v1.TypeMeta   `json:",inline"`
	meta_v1.ObjectMeta `json:"metadata"`
	Spec               map[string]interface{} `json:"spec"`
}

ServiceClass is the generic Kubernetes API object wrapper

func (*ServiceClass) DeepCopy

func (in *ServiceClass) DeepCopy() *ServiceClass

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

func (*ServiceClass) DeepCopyInto

func (in *ServiceClass) DeepCopyInto(out *ServiceClass)

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

func (*ServiceClass) DeepCopyObject

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

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

func (*ServiceClass) GetObjectMeta

func (in *ServiceClass) GetObjectMeta() meta_v1.ObjectMeta

GetObjectMeta from a wrapper

func (*ServiceClass) GetSpec

func (in *ServiceClass) GetSpec() map[string]interface{}

GetSpec from a wrapper

func (*ServiceClass) SetObjectMeta

func (in *ServiceClass) SetObjectMeta(metadata meta_v1.ObjectMeta)

SetObjectMeta for a wrapper

func (*ServiceClass) SetSpec

func (in *ServiceClass) SetSpec(spec map[string]interface{})

SetSpec for a wrapper

type ServiceClassList

type ServiceClassList struct {
	meta_v1.TypeMeta `json:",inline"`
	meta_v1.ListMeta `json:"metadata"`
	Items            []*ServiceClass `json:"items"`
}

ServiceClassList is the generic Kubernetes API list wrapper

func (*ServiceClassList) DeepCopy

func (in *ServiceClassList) DeepCopy() *ServiceClassList

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

func (*ServiceClassList) DeepCopyInto

func (in *ServiceClassList) DeepCopyInto(out *ServiceClassList)

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

func (*ServiceClassList) DeepCopyObject

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

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

func (*ServiceClassList) GetItems

func (in *ServiceClassList) GetItems() []IstioObject

GetItems from a wrapper

type ServicePlan

type ServicePlan struct {
	meta_v1.TypeMeta   `json:",inline"`
	meta_v1.ObjectMeta `json:"metadata"`
	Spec               map[string]interface{} `json:"spec"`
}

ServicePlan is the generic Kubernetes API object wrapper

func (*ServicePlan) DeepCopy

func (in *ServicePlan) DeepCopy() *ServicePlan

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

func (*ServicePlan) DeepCopyInto

func (in *ServicePlan) DeepCopyInto(out *ServicePlan)

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

func (*ServicePlan) DeepCopyObject

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

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

func (*ServicePlan) GetObjectMeta

func (in *ServicePlan) GetObjectMeta() meta_v1.ObjectMeta

GetObjectMeta from a wrapper

func (*ServicePlan) GetSpec

func (in *ServicePlan) GetSpec() map[string]interface{}

GetSpec from a wrapper

func (*ServicePlan) SetObjectMeta

func (in *ServicePlan) SetObjectMeta(metadata meta_v1.ObjectMeta)

SetObjectMeta for a wrapper

func (*ServicePlan) SetSpec

func (in *ServicePlan) SetSpec(spec map[string]interface{})

SetSpec for a wrapper

type ServicePlanList

type ServicePlanList struct {
	meta_v1.TypeMeta `json:",inline"`
	meta_v1.ListMeta `json:"metadata"`
	Items            []*ServicePlan `json:"items"`
}

ServicePlanList is the generic Kubernetes API list wrapper

func (*ServicePlanList) DeepCopy

func (in *ServicePlanList) DeepCopy() *ServicePlanList

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

func (*ServicePlanList) DeepCopyInto

func (in *ServicePlanList) DeepCopyInto(out *ServicePlanList)

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

func (*ServicePlanList) DeepCopyObject

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

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

func (*ServicePlanList) GetItems

func (in *ServicePlanList) GetItems() []IstioObject

GetItems from a wrapper

Jump to

Keyboard shortcuts

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