istio: istio.io/istio/pkg/kube/secretcontroller Index | Files

package secretcontroller

import "istio.io/istio/pkg/kube/secretcontroller"

Index

Package Files

secretcontroller.go

Constants

const (
    MultiClusterSecretLabel = "istio/multiCluster"
)

Variables

var BuildClientsFromConfig = func(kubeConfig []byte) (kube.Client, error) {
    if len(kubeConfig) == 0 {
        return nil, errors.New("kubeconfig is empty")
    }

    rawConfig, err := clientcmd.Load(kubeConfig)
    if err != nil {
        return nil, fmt.Errorf("kubeconfig cannot be loaded: %v", err)
    }

    if err := clientcmd.Validate(*rawConfig); err != nil {
        return nil, fmt.Errorf("kubeconfig is not valid: %v", err)
    }

    clientConfig := clientcmd.NewDefaultClientConfig(*rawConfig, &clientcmd.ConfigOverrides{})

    clients, err := kube.NewClient(clientConfig)
    if err != nil {
        return nil, fmt.Errorf("failed to create kube clients: %v", err)
    }
    return clients, nil
}

BuildClientsFromConfig creates kube.Clients from the provided kubeconfig. This is overiden for testing only

type ClusterStore Uses

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

ClusterStore is a collection of clusters

type Controller Uses

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

Controller is the controller implementation for Secret resources

func NewController Uses

func NewController(
    kubeclientset kubernetes.Interface,
    namespace string,
    cs *ClusterStore,
    addCallback addSecretCallback,
    updateCallback updateSecretCallback,
    removeCallback removeSecretCallback) *Controller

NewController returns a new secret controller

func StartSecretController Uses

func StartSecretController(
    k8s kubernetes.Interface,
    addCallback addSecretCallback, updateCallback updateSecretCallback,
    removeCallback removeSecretCallback,
    namespace string,
    syncInterval time.Duration,
    stop <-chan struct{},
) *Controller

StartSecretController creates the secret controller.

func (*Controller) HasSynced Uses

func (c *Controller) HasSynced() bool

func (*Controller) Run Uses

func (c *Controller) Run(stopCh <-chan struct{})

Run starts the controller until it receives a message over stopCh

type RemoteCluster Uses

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

RemoteCluster defines cluster struct

Package secretcontroller imports 20 packages (graph) and is imported by 7 packages. Updated 2021-01-02. Refresh now. Tools for package owners.