helpers

package
v1.0.0-2021-09-22-22-0... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const GroupName = "rbac.authorization.k8s.io"

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterRoleBindingBuilder

type ClusterRoleBindingBuilder struct {
	ClusterRoleBinding rbacv1.ClusterRoleBinding `protobuf:"bytes,1,opt,name=clusterRoleBinding"`
}

ClusterRoleBindingBuilder let's us attach methods. A no-no for API types. We use it to construct bindings in code. It's more compact than trying to write them out in a literal.

func NewClusterBinding

func NewClusterBinding(clusterRoleName string) *ClusterRoleBindingBuilder

func (*ClusterRoleBindingBuilder) Binding

func (*ClusterRoleBindingBuilder) BindingOrDie

func (*ClusterRoleBindingBuilder) Groups

func (*ClusterRoleBindingBuilder) SAs

func (r *ClusterRoleBindingBuilder) SAs(namespace string, serviceAccountNames ...string) *ClusterRoleBindingBuilder

func (*ClusterRoleBindingBuilder) Users

type ClusterSetMapper

type ClusterSetMapper struct {
	// contains filtered or unexported fields
}

func NewClusterSetMapper

func NewClusterSetMapper() *ClusterSetMapper

func (*ClusterSetMapper) AddObjectInClusterSet

func (c *ClusterSetMapper) AddObjectInClusterSet(objectName, clusterSetName string)

AddObjectInClusterSet add object to clusterset mapping. it only add the object to current clusterset, and will not delete the object in other clusterset.

func (*ClusterSetMapper) CopyClusterSetMapper

func (c *ClusterSetMapper) CopyClusterSetMapper(requiredMapper *ClusterSetMapper)

func (*ClusterSetMapper) DeleteClusterSet

func (c *ClusterSetMapper) DeleteClusterSet(clusterSetName string)

func (*ClusterSetMapper) DeleteObjectInClusterSet

func (c *ClusterSetMapper) DeleteObjectInClusterSet(objectName string)

DeleteObjectInClusterSet will delete cluster in all clusterset mapping

func (*ClusterSetMapper) GetAllClusterSetToObjects

func (c *ClusterSetMapper) GetAllClusterSetToObjects() map[string]sets.String

func (*ClusterSetMapper) GetObjectClusterset

func (c *ClusterSetMapper) GetObjectClusterset(objectName string) string

func (*ClusterSetMapper) GetObjectsOfClusterSet

func (c *ClusterSetMapper) GetObjectsOfClusterSet(clusterSetName string) sets.String

func (*ClusterSetMapper) UnionObjectsInClusterSet

func (c *ClusterSetMapper) UnionObjectsInClusterSet(newClustersetToObjects *ClusterSetMapper) *ClusterSetMapper

UnionObjectsInClusterSet merge the objects in current ClusterSetMapper and newClustersetToObjects when clusterset is same.

func (*ClusterSetMapper) UpdateClusterSetByObjects

func (c *ClusterSetMapper) UpdateClusterSetByObjects(clusterSetName string, objects sets.String)

func (*ClusterSetMapper) UpdateObjectInClusterSet

func (c *ClusterSetMapper) UpdateObjectInClusterSet(objectName, clusterSetName string)

UpdateObjectInClusterSet updates clusterset to cluster mapping. If a the clusterset of a object is changed, this func remove object from the previous mapping and add in new one.

type PolicyRuleBuilder

type PolicyRuleBuilder struct {
	PolicyRule rbacv1.PolicyRule
}

PolicyRuleBuilder let's us attach methods. A no-no for API types. We use it to construct rules in code. It's more compact than trying to write them out in a literal and allows us to perform some basic checking during construction

func NewRule

func NewRule(verbs ...string) *PolicyRuleBuilder

func (*PolicyRuleBuilder) Groups

func (r *PolicyRuleBuilder) Groups(groups ...string) *PolicyRuleBuilder

func (*PolicyRuleBuilder) Names

func (r *PolicyRuleBuilder) Names(names ...string) *PolicyRuleBuilder

func (*PolicyRuleBuilder) Resources

func (r *PolicyRuleBuilder) Resources(resources ...string) *PolicyRuleBuilder

func (*PolicyRuleBuilder) Rule

func (*PolicyRuleBuilder) RuleOrDie

func (r *PolicyRuleBuilder) RuleOrDie() rbacv1.PolicyRule

func (*PolicyRuleBuilder) URLs

func (r *PolicyRuleBuilder) URLs(urls ...string) *PolicyRuleBuilder

type RoleBindingBuilder

type RoleBindingBuilder struct {
	RoleBinding rbacv1.RoleBinding
}

RoleBindingBuilder let's us attach methods. It is similar to ClusterRoleBindingBuilder above.

func NewRoleBinding

func NewRoleBinding(roleName, namespace string) *RoleBindingBuilder

NewRoleBinding creates a RoleBinding builder that can be used to define the subjects of a role binding. At least one of the `Groups`, `Users` or `SAs` method must be called before calling the `Binding*` methods.

func NewRoleBindingForClusterRole

func NewRoleBindingForClusterRole(roleName, namespace string) *RoleBindingBuilder

func (*RoleBindingBuilder) Binding

func (r *RoleBindingBuilder) Binding() (rbacv1.RoleBinding, error)

Binding builds and returns the RoleBinding API object from the builder object.

func (*RoleBindingBuilder) BindingOrDie

func (r *RoleBindingBuilder) BindingOrDie() rbacv1.RoleBinding

BindingOrDie calls the binding method and panics if there is an error.

func (*RoleBindingBuilder) Groups

func (r *RoleBindingBuilder) Groups(groups ...string) *RoleBindingBuilder

Groups adds the specified groups as the subjects of the RoleBinding.

func (*RoleBindingBuilder) SAs

func (r *RoleBindingBuilder) SAs(namespace string, serviceAccountNames ...string) *RoleBindingBuilder

SAs adds the specified service accounts as the subjects of the RoleBinding.

func (*RoleBindingBuilder) Users

func (r *RoleBindingBuilder) Users(users ...string) *RoleBindingBuilder

Users adds the specified users as the subjects of the RoleBinding.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL