Documentation ¶
Index ¶
- func GetConfigMapInformer(ctx context.Context, nsName string, cmName string) cache.SharedIndexInformer
- type Client
- func (c *Client) ClientInterface() kubernetes.Interface
- func (c *Client) CreateOrUpdateClusterRole(ctx context.Context, name string) error
- func (c *Client) CreateOrUpdateClusterRoleBinding(ctx context.Context, name string, clusterRoleName string, ...) error
- func (c *Client) CreateOrUpdateCustomResource(ctx context.Context, cr *namespace.CustomResource, ns string) error
- func (c *Client) CreateOrUpdateK8sSecret(ctx context.Context, secret *corev1.Secret, ns string) error
- func (c *Client) CreateOrUpdateManagedCluster(ctx context.Context, cr *v1alpha1.Cluster, ns string) error
- func (c *Client) CreateOrUpdateManagedNamespace(ctx context.Context, cr *v1alpha1.ManagedNamespace, ns string) error
- func (c *Client) CreateOrUpdateNamespace(ctx context.Context, ns *v1.Namespace) error
- func (c *Client) CreateOrUpdateResourceQuota(ctx context.Context, quota *v1.ResourceQuota, ns string) error
- func (c *Client) CreateOrUpdateRole(ctx context.Context, role *rbacv1.Role, ns string) error
- func (c *Client) CreateOrUpdateRoleBinding(ctx context.Context, binding *rbacv1.RoleBinding, ns string) error
- func (c *Client) CreateServiceAccount(ctx context.Context, sa *corev1.ServiceAccount, ns string) error
- func (c *Client) CreateServiceAccountForCluster(ctx context.Context, saName string, ns string) error
- func (c *Client) DeleteClusterRole(ctx context.Context, name string) error
- func (c *Client) DeleteClusterRoleBinding(ctx context.Context, name string) error
- func (c *Client) DeleteManagedCluster(ctx context.Context, cr *v1alpha1.Cluster, ns string) error
- func (c *Client) DeleteNamespace(ctx context.Context, name string) error
- func (c *Client) DeleteServiceAccount(ctx context.Context, saName string, ns string) error
- func (c *Client) GetConfigMap(ctx context.Context, ns string, name string) *v1.ConfigMap
- func (c *Client) GetK8sSecret(ctx context.Context, name string, ns string) (*corev1.Secret, error)
- func (c *Client) GetNamespace(ctx context.Context, name string) error
- func (c *Client) GetServiceAccountTokenSecret(ctx context.Context, saName string, ns string) (string, error)
- func (c *Client) SetUpEventHandler(ctx context.Context) record.EventRecorder
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigMapInformer ¶
func GetConfigMapInformer(ctx context.Context, nsName string, cmName string) cache.SharedIndexInformer
GetConfigMapInformer returns shared informer for given config map
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewK8sManagedClusterClientDoOrDie ¶
NewK8sManagedClusterClientDoOrDie creates a client for managed cluster or config passed
func NewK8sSelfClientDoOrDie ¶
func NewK8sSelfClientDoOrDie() *Client
NewK8sSelfClientDoOrDie gets the new k8s go client
func (*Client) ClientInterface ¶
func (c *Client) ClientInterface() kubernetes.Interface
func (*Client) CreateOrUpdateClusterRole ¶
CreateOrUpdateClusterRole create or updates cluster role
func (*Client) CreateOrUpdateClusterRoleBinding ¶
func (c *Client) CreateOrUpdateClusterRoleBinding(ctx context.Context, name string, clusterRoleName string, subject rbacv1.Subject) error
CreateOrUpdateClusterRole create or updates cluster role
func (*Client) CreateOrUpdateCustomResource ¶
func (c *Client) CreateOrUpdateCustomResource(ctx context.Context, cr *namespace.CustomResource, ns string) error
CreateCustomResource creates a custom resource
func (*Client) CreateOrUpdateK8sSecret ¶
func (c *Client) CreateOrUpdateK8sSecret(ctx context.Context, secret *corev1.Secret, ns string) error
CreateK8sSecret function creates secret in specific namespace
func (*Client) CreateOrUpdateManagedCluster ¶
func (c *Client) CreateOrUpdateManagedCluster(ctx context.Context, cr *v1alpha1.Cluster, ns string) error
CreateOrUpdateClusterCR creates cluster custom resource
func (*Client) CreateOrUpdateManagedNamespace ¶
func (c *Client) CreateOrUpdateManagedNamespace(ctx context.Context, cr *v1alpha1.ManagedNamespace, ns string) error
CreateOrUpdateManagedNamespace creates/updates managed namespace
func (*Client) CreateOrUpdateNamespace ¶
CreateNamespace function creates a namespace in the control plan cluster
func (*Client) CreateOrUpdateResourceQuota ¶
func (c *Client) CreateOrUpdateResourceQuota(ctx context.Context, quota *v1.ResourceQuota, ns string) error
CreateResourceQuota function creates resource quota for a specified namespace
func (*Client) CreateOrUpdateRole ¶
CreateOrUpdateRole create or updates role
func (*Client) CreateOrUpdateRoleBinding ¶
func (c *Client) CreateOrUpdateRoleBinding(ctx context.Context, binding *rbacv1.RoleBinding, ns string) error
CreateOrUpdateClusterRole create or updates cluster role
func (*Client) CreateServiceAccount ¶
func (c *Client) CreateServiceAccount(ctx context.Context, sa *corev1.ServiceAccount, ns string) error
CreateServiceAccount adds the service account
func (*Client) CreateServiceAccountForCluster ¶
func (c *Client) CreateServiceAccountForCluster(ctx context.Context, saName string, ns string) error
CreateServiceAccountForCluster adds the service account in the target cluster
func (*Client) DeleteClusterRole ¶
DeleteClusterRole deletes cluster role
func (*Client) DeleteClusterRoleBinding ¶
CreateOrUpdateClusterRole create or updates cluster role
func (*Client) DeleteManagedCluster ¶
DeleteManagedCluster deletes managed cluster with propagation policy foreground
func (*Client) DeleteNamespace ¶
DeleteNamespace function creates a namespace in the control plan cluster
func (*Client) DeleteServiceAccount ¶
DeleteServiceAccount deletes the service account in the target cluster
func (*Client) GetConfigMap ¶
func (*Client) GetK8sSecret ¶
GetK8sSecret function retrieves the secrets
func (*Client) GetNamespace ¶
CreateNamespace function creates a namespace in the control plan cluster
func (*Client) GetServiceAccountTokenSecret ¶
func (c *Client) GetServiceAccountTokenSecret(ctx context.Context, saName string, ns string) (string, error)
GetServiceAccountTokenSecret retrieves the token secret for a given service account
func (*Client) SetUpEventHandler ¶
func (c *Client) SetUpEventHandler(ctx context.Context) record.EventRecorder
SetUpEventHandler sets up event handler with client-go recorder instead of creating events directly
type Interface ¶
type Interface interface { SetUpEventHandler(ctx context.Context) record.EventRecorder GetConfigMap(ctx context.Context, ns string, name string) *v1.ConfigMap CreateServiceAccountForCluster(ctx context.Context, saName string, ns string) error CreateServiceAccount(ctx context.Context, sa *v1.ServiceAccount) error DeleteServiceAccount(ctx context.Context, saName string, ns string) error CreateOrUpdateClusterRole(ctx context.Context, name string) error DeleteClusterRole(ctx context.Context, name string) error CreateOrUpdateClusterRoleBinding(ctx context.Context, name string) error DeleteClusterRoleBinding(ctx context.Context, name string) error CreateOrUpdateRole(ctx context.Context, role *rbacv1.Role, ns string) error CreateOrUpdateRoleBinding(ctx context.Context, roleBinding *rbacv1.RoleBinding) error GetServiceAccountTokenSecret(ctx context.Context, saName string) (string, error) CreateOrUpdateK8sSecret(ctx context.Context, secret *v1.Secret) error GetK8sSecret(ctx context.Context, name string, ns string) (*v1.Secret, error) CreateOrUpdateNamespace(ctx context.Context, namespace *v1.Namespace) error DeleteNamespace(ctx context.Context, name string) error GetNamespace(ctx context.Context, name string) error CreateOrUpdateResourceQuota(ctx context.Context, quota *v1.ResourceQuota) error CreateOrUpdateManagedCluster(ctx context.Context, cr *v1alpha1.Cluster, ns string) error CreateOrUpdateCustomResource(ctx context.Context, cr *namespace.CustomResource, ns string) error CreateOrUpdateManagedNamespace(ctx context.Context, cr *v1alpha1.ManagedNamespace, ns string) error DeleteManagedCluster(ctx context.Context, name string, ns string) error }
Interface defines required functions to be implemented by receivers