Documentation ¶
Index ¶
- Constants
- type Interface
- type Kubernetes
- func (k *Kubernetes) CanVisitAllNamespace(username string) (bool, error)
- func (k *Kubernetes) CleanAllRBACResource() error
- func (k *Kubernetes) CleanManagedClusterRole() error
- func (k *Kubernetes) CleanManagedClusterRoleBinding(username string) error
- func (k *Kubernetes) CleanManagedRoleBinding(username string) error
- func (k *Kubernetes) Client() (*kubernetes.Clientset, error)
- func (k *Kubernetes) Config() (*rest.Config, error)
- func (k *Kubernetes) CreateAppMarketCRD() error
- func (k *Kubernetes) CreateCommonUser(commonName string) ([]byte, error)
- func (k *Kubernetes) CreateDefaultClusterRoles() error
- func (k *Kubernetes) CreateOrUpdateClusterRoleBinding(clusterRoleName string, username string, builtIn bool) error
- func (k *Kubernetes) CreateOrUpdateRolebinding(namespace string, clusterRoleName string, username string, builtIn bool) error
- func (k *Kubernetes) GetUserNamespaceNames(username string, options ...interface{}) ([]string, error)
- func (k *Kubernetes) HasPermission(attributes v1.ResourceAttributes) (PermissionCheckResult, error)
- func (k *Kubernetes) IsNamespacedResource(resourceName string) (bool, error)
- func (k *Kubernetes) Ping() error
- func (k *Kubernetes) Version() (*version.Info, error)
- func (k *Kubernetes) VersionMinor() (int, error)
- type PermissionCheckResult
Constants ¶
View Source
const ( LabelManageKey = "kubepi.org/manage" LabelRoleTypeKey = "kubepi.org/role-type" LabelClusterId = "kubepi.org/cluster-id" LabelUsername = "kubepi.org/username" RoleTypeCluster = "cluster" RoleTypeNamespace = "namespace" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { Ping() error Version() (*version.Info, error) VersionMinor() (int, error) Config() (*rest.Config, error) Client() (*kubernetes.Clientset, error) HasPermission(attributes v1.ResourceAttributes) (PermissionCheckResult, error) CreateCommonUser(commonName string) ([]byte, error) CreateDefaultClusterRoles() error GetUserNamespaceNames(username string, options ...interface{}) ([]string, error) CanVisitAllNamespace(username string) (bool, error) IsNamespacedResource(resourceName string) (bool, error) CleanManagedClusterRole() error CleanManagedClusterRoleBinding(username string) error CleanManagedRoleBinding(username string) error CleanAllRBACResource() error CreateOrUpdateClusterRoleBinding(clusterRoleName string, username string, builtIn bool) error CreateOrUpdateRolebinding(namespace string, clusterRoleName string, username string, builtIn bool) error CreateAppMarketCRD() error }
func NewKubernetes ¶
type Kubernetes ¶
func (*Kubernetes) CanVisitAllNamespace ¶
func (k *Kubernetes) CanVisitAllNamespace(username string) (bool, error)
func (*Kubernetes) CleanAllRBACResource ¶
func (k *Kubernetes) CleanAllRBACResource() error
func (*Kubernetes) CleanManagedClusterRole ¶
func (k *Kubernetes) CleanManagedClusterRole() error
func (*Kubernetes) CleanManagedClusterRoleBinding ¶
func (k *Kubernetes) CleanManagedClusterRoleBinding(username string) error
func (*Kubernetes) CleanManagedRoleBinding ¶
func (k *Kubernetes) CleanManagedRoleBinding(username string) error
func (*Kubernetes) Client ¶
func (k *Kubernetes) Client() (*kubernetes.Clientset, error)
func (*Kubernetes) CreateAppMarketCRD ¶ added in v1.1.0
func (k *Kubernetes) CreateAppMarketCRD() error
func (*Kubernetes) CreateCommonUser ¶
func (k *Kubernetes) CreateCommonUser(commonName string) ([]byte, error)
func (*Kubernetes) CreateDefaultClusterRoles ¶
func (k *Kubernetes) CreateDefaultClusterRoles() error
func (*Kubernetes) CreateOrUpdateClusterRoleBinding ¶
func (k *Kubernetes) CreateOrUpdateClusterRoleBinding(clusterRoleName string, username string, builtIn bool) error
func (*Kubernetes) CreateOrUpdateRolebinding ¶
func (*Kubernetes) GetUserNamespaceNames ¶
func (k *Kubernetes) GetUserNamespaceNames(username string, options ...interface{}) ([]string, error)
func (*Kubernetes) HasPermission ¶
func (k *Kubernetes) HasPermission(attributes v1.ResourceAttributes) (PermissionCheckResult, error)
func (*Kubernetes) IsNamespacedResource ¶
func (k *Kubernetes) IsNamespacedResource(resourceName string) (bool, error)
func (*Kubernetes) Ping ¶
func (k *Kubernetes) Ping() error
func (*Kubernetes) VersionMinor ¶
func (k *Kubernetes) VersionMinor() (int, error)
type PermissionCheckResult ¶
type PermissionCheckResult struct { Resource v1.ResourceAttributes Allowed bool }
Click to show internal directories.
Click to hide internal directories.