Documentation ¶
Index ¶
- func SetInstance(i Ops)
- type Client
- func (c *Client) CreateClusterRole(role *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error)
- func (c *Client) CreateClusterRoleBinding(binding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error)
- func (c *Client) CreateRole(role *rbac_v1.Role) (*rbac_v1.Role, error)
- func (c *Client) CreateRoleBinding(binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error)
- func (c *Client) DeleteClusterRole(roleName string) error
- func (c *Client) DeleteClusterRoleBinding(bindingName string) error
- func (c *Client) DeleteRole(name, namespace string) error
- func (c *Client) DeleteRoleBinding(name, namespace string) error
- func (c *Client) GetClusterRole(name string) (*rbacv1.ClusterRole, error)
- func (c *Client) GetClusterRoleBinding(name string) (*rbacv1.ClusterRoleBinding, error)
- func (c *Client) GetRole(name, namespace string) (*rbac_v1.Role, error)
- func (c *Client) GetRoleBinding(name, namespace string) (*rbacv1.RoleBinding, error)
- func (c *Client) ListClusterRoleBindings() (*rbacv1.ClusterRoleBindingList, error)
- func (c *Client) SetConfig(cfg *rest.Config)
- func (c *Client) UpdateClusterRole(role *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error)
- func (c *Client) UpdateClusterRoleBinding(binding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error)
- func (c *Client) UpdateRole(role *rbac_v1.Role) (*rbac_v1.Role, error)
- func (c *Client) UpdateRoleBinding(binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error)
- type ClusterRoleBindingOps
- type ClusterRoleOps
- type Ops
- type RoleBindingOps
- type RoleOps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetInstance ¶
func SetInstance(i Ops)
SetInstance replaces the instance with the provided one. Should be used only for testing purposes.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper for the kubernetes rbac client.
func NewForConfig ¶
NewForConfig builds a new rbac client for the given config.
func (*Client) CreateClusterRole ¶
func (c *Client) CreateClusterRole(role *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error)
CreateClusterRole creates the given cluster role
func (*Client) CreateClusterRoleBinding ¶
func (c *Client) CreateClusterRoleBinding(binding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error)
CreateClusterRoleBinding creates the given cluster role binding
func (*Client) CreateRole ¶
CreateRole creates the given role
func (*Client) CreateRoleBinding ¶
func (c *Client) CreateRoleBinding(binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error)
CreateRoleBinding creates the given role binding
func (*Client) DeleteClusterRole ¶
DeleteClusterRole deletes the given cluster role
func (*Client) DeleteClusterRoleBinding ¶
DeleteClusterRoleBinding deletes the given cluster role binding
func (*Client) DeleteRole ¶
DeleteRole deletes the given role
func (*Client) DeleteRoleBinding ¶
DeleteRoleBinding deletes the given role binding
func (*Client) GetClusterRole ¶
func (c *Client) GetClusterRole(name string) (*rbacv1.ClusterRole, error)
GetClusterRole gets the given cluster role
func (*Client) GetClusterRoleBinding ¶
func (c *Client) GetClusterRoleBinding(name string) (*rbacv1.ClusterRoleBinding, error)
GetClusterRoleBinding gets the given cluster role binding
func (*Client) GetRoleBinding ¶
func (c *Client) GetRoleBinding(name, namespace string) (*rbacv1.RoleBinding, error)
GetRoleBinding gets the given role binding
func (*Client) ListClusterRoleBindings ¶
func (c *Client) ListClusterRoleBindings() (*rbacv1.ClusterRoleBindingList, error)
ListClusterRoleBindings lists the cluster role bindings
func (*Client) UpdateClusterRole ¶
func (c *Client) UpdateClusterRole(role *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error)
UpdateClusterRole updates the given cluster role
func (*Client) UpdateClusterRoleBinding ¶
func (c *Client) UpdateClusterRoleBinding(binding *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error)
UpdateClusterRoleBinding updates the given cluster role binding
func (*Client) UpdateRole ¶
UpdateRole updates the given role
func (*Client) UpdateRoleBinding ¶
func (c *Client) UpdateRoleBinding(binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error)
UpdateRoleBinding updates the given role binding
type ClusterRoleBindingOps ¶
type ClusterRoleBindingOps interface { // GetClusterRoleBinding gets the given cluster role binding GetClusterRoleBinding(name string) (*rbacv1.ClusterRoleBinding, error) // ListClusterRoleBindings lists the cluster role bindings ListClusterRoleBindings() (*rbacv1.ClusterRoleBindingList, error) // CreateClusterRoleBinding creates the given cluster role binding CreateClusterRoleBinding(role *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error) // UpdateClusterRoleBinding updates the given cluster role binding UpdateClusterRoleBinding(role *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, error) // DeleteClusterRoleBinding deletes the given cluster role binding DeleteClusterRoleBinding(roleName string) error }
ClusterRoleBindingOps is an interface to perform operations on ClusterRoleBinding resources.
type ClusterRoleOps ¶
type ClusterRoleOps interface { // CreateClusterRole creates the given cluster role CreateClusterRole(role *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error) // GetClusterRole gets the given cluster role GetClusterRole(name string) (*rbacv1.ClusterRole, error) // UpdateClusterRole updates the given cluster role UpdateClusterRole(role *rbacv1.ClusterRole) (*rbacv1.ClusterRole, error) // DeleteClusterRole deletes the given cluster role DeleteClusterRole(roleName string) error }
ClusterRoleOps is an interface to perform operations on ClusterRole resources.
type Ops ¶
type Ops interface { ClusterRoleBindingOps ClusterRoleOps RoleBindingOps RoleOps // SetConfig sets the config and resets the client SetConfig(config *rest.Config) }
Ops is an interface to perform kubernetes related operations on the rbac resources.
func NewInstanceFromConfigFile ¶
NewInstanceFromConfigFile returns new instance of client by using given config file
type RoleBindingOps ¶
type RoleBindingOps interface { // CreateRoleBinding creates the given role binding CreateRoleBinding(role *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error) // UpdateRoleBinding updates the given role binding UpdateRoleBinding(role *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error) // GetRoleBinding gets the given role binding GetRoleBinding(name, namespace string) (*rbacv1.RoleBinding, error) // DeleteRoleBinding deletes the given role binding DeleteRoleBinding(name, namespace string) error }
RoleBindingOps is an interface to perform operations on RoleBinding resources.
type RoleOps ¶
type RoleOps interface { // CreateRole creates the given role CreateRole(role *rbac_v1.Role) (*rbac_v1.Role, error) // UpdateRole updates the given role UpdateRole(role *rbac_v1.Role) (*rbac_v1.Role, error) // GetRole gets the given role GetRole(name, namespace string) (*rbac_v1.Role, error) // DeleteRole deletes the given role DeleteRole(name, namespace string) error }
RoleOps is an interface to perform operations on role resources.