Documentation
¶
Index ¶
- type Repository
- func (r Repository) EnsureSecret(ctx context.Context, secret *corev1.Secret) error
- func (r Repository) EnsureServiceAccount(ctx context.Context, sa *corev1.ServiceAccount) error
- func (r Repository) GetSecret(ctx context.Context, ns string, name string) (*corev1.Secret, error)
- func (r Repository) GetServiceAccount(ctx context.Context, ns string, name string) (*corev1.ServiceAccount, error)
- func (r Repository) ListNamespaces(ctx context.Context, labelSelector map[string]string) (*corev1.NamespaceList, error)
- func (r Repository) WatchNamespaces(ctx context.Context, labelSelector map[string]string) (watch.Interface, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository represents a Kubernetes repository that knows how to speak with the Kubernetes API server to manage resources.
func NewRepository ¶
func NewRepository(kcli *kubernetes.Clientset) Repository
NewRepository returns a new Kubernetes repository that will retrieve Kubernetes resources using kubernetes sdk.
func (Repository) EnsureSecret ¶
EnsureSecret will create the secret if is missing and overwrite if already exists.
func (Repository) EnsureServiceAccount ¶
func (r Repository) EnsureServiceAccount(ctx context.Context, sa *corev1.ServiceAccount) error
EnsureServiceAccount will create the service account if is missing and overwrite if already exists.
func (Repository) GetServiceAccount ¶
func (r Repository) GetServiceAccount(ctx context.Context, ns string, name string) (*corev1.ServiceAccount, error)
GetServiceAccount will return a service account from Kubernets API server.
func (Repository) ListNamespaces ¶
func (r Repository) ListNamespaces(ctx context.Context, labelSelector map[string]string) (*corev1.NamespaceList, error)
ListNamespaces will list Kubernetes namespaces from the API server.
func (Repository) WatchNamespaces ¶
func (r Repository) WatchNamespaces(ctx context.Context, labelSelector map[string]string) (watch.Interface, error)
WatchNamespaces will return a Kubernetes watcher to subscribe to namespaces changes.