import "istio.io/istio/pkg/kube/secretcontroller"
const (
MultiClusterSecretLabel = "istio/multiCluster"
)
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 struct {
// contains filtered or unexported fields
}
ClusterStore is a collection of clusters
type Controller struct {
// contains filtered or unexported fields
}
Controller is the controller implementation for Secret resources
func NewController( kubeclientset kubernetes.Interface, namespace string, cs *ClusterStore, addCallback addSecretCallback, updateCallback updateSecretCallback, removeCallback removeSecretCallback) *Controller
NewController returns a new secret controller
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 (c *Controller) HasSynced() bool
func (c *Controller) Run(stopCh <-chan struct{})
Run starts the controller until it receives a message over stopCh
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.