istio: istio.io/istio/pilot/pkg/config/kube/crdclient Index | Files | Directories

package crdclient

import "istio.io/istio/pilot/pkg/config/kube/crdclient"

Package crdclient provides an implementation of the config store and cache using Kubernetes Custom Resources and the informer framework from Kubernetes

This code relies heavily on code generation for performance reasons; to implement the Istio store interface, we need to take dynamic inputs. Using the dynamic informers results in poor performance, as the cache will store unstructured objects which need to be marshaled on each Get/List call. Using istio/client-go directly will cache objects marshaled, allowing us to have cheap Get/List calls, at the expense of some code gen.

Index

Package Files

cache_handler.go client.go generate.go ledger.go metrics.go types.gen.go

func New Uses

func New(client kube.Client, configLedger ledger.Ledger, revision string, options controller2.Options) (model.ConfigStoreCache, error)

func TranslateObject Uses

func TranslateObject(r runtime.Object, gvk config.GroupVersionKind, domainSuffix string) *config.Config

type Client Uses

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

Client is a client for Istio CRDs, implementing config store cache This is used for CRUD operators on Istio configuration, as well as handling of events on config changes

func (*Client) Create Uses

func (cl *Client) Create(cfg config.Config) (string, error)

Create implements store interface

func (*Client) Delete Uses

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

Delete implements store interface

func (*Client) Get Uses

func (cl *Client) Get(typ config.GroupVersionKind, name, namespace string) *config.Config

Get implements store interface

func (*Client) GetLedger Uses

func (cl *Client) GetLedger() ledger.Ledger

func (*Client) GetResourceAtVersion Uses

func (cl *Client) GetResourceAtVersion(version string, key string) (resourceVersion string, err error)

func (*Client) HasSynced Uses

func (cl *Client) HasSynced() bool

func (*Client) List Uses

func (cl *Client) List(kind config.GroupVersionKind, namespace string) ([]config.Config, error)

List implements store interface

func (*Client) Patch Uses

func (cl *Client) Patch(typ config.GroupVersionKind, name, namespace string, patchFn config.PatchFunc) (string, error)

Patch applies only the modifications made in the PatchFunc rather than doing a full replace. Useful to avoid read-modify-write conflicts when there are many concurrent-writers to the same resource.

func (*Client) RegisterEventHandler Uses

func (cl *Client) RegisterEventHandler(kind config.GroupVersionKind, handler func(config.Config, config.Config, model.Event))

func (*Client) Run Uses

func (cl *Client) Run(stop <-chan struct{})

Run the queue and all informers. Callers should wait for HasSynced() before depending on results.

func (*Client) Schemas Uses

func (cl *Client) Schemas() collection.Schemas

Schemas for the store

func (*Client) SetLedger Uses

func (cl *Client) SetLedger(l ledger.Ledger) error

func (*Client) Update Uses

func (cl *Client) Update(cfg config.Config) (string, error)

Update implements store interface

func (*Client) UpdateStatus Uses

func (cl *Client) UpdateStatus(cfg config.Config) (string, error)

func (*Client) Version Uses

func (cl *Client) Version() string

Directories

PathSynopsis
genTool to generate pilot/pkg/config/kube/crdclient/types.gen.go Example run command: REPO_ROOT=`pwd` go generate ./pilot/pkg/config/kube/crdclient/...

Package crdclient imports 37 packages (graph) and is imported by 2 packages. Updated 2020-10-22. Refresh now. Tools for package owners.