crd

package
v0.0.0-...-6472126 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2017 License: Apache-2.0, Apache-2.0 Imports: 19 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/adapter/config/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 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

Jump to

Keyboard shortcuts

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