Documentation
¶
Index ¶
- Constants
- func CreateAuthMap(k kubernetes.Interface) (*kcorev1.ConfigMap, error)
- func UpdateAuthMap(k kubernetes.Interface, authData AwsAuthData, cm *kcorev1.ConfigMap) error
- func WithRetry(fn func(*Arguments) error, args *Arguments) error
- type Arguments
- type AwsAuthData
- type DataType
- type MapRole
- type MapUser
- type Mapper
- type OperationType
- type Service
- type ServiceConfig
Constants ¶
const ( ConfigMapName = "aws-auth" ConfigMapNamespace = "kube-system" )
Variables ¶
This section is empty.
Functions ¶
func CreateAuthMap ¶
func CreateAuthMap(k kubernetes.Interface) (*kcorev1.ConfigMap, error)
func UpdateAuthMap ¶
func UpdateAuthMap(k kubernetes.Interface, authData AwsAuthData, cm *kcorev1.ConfigMap) error
UpdateAuthMap updates a given ConfigMap
Types ¶
type Arguments ¶
type Arguments struct { OperationType OperationType DataType DataType RoleARN string UserARN string Username string Groups []string WithRetries bool MinRetryTime time.Duration MaxRetryTime time.Duration MaxRetryCount int }
Arguments are the arguments for management of the auth map.
type AwsAuthData ¶
type AwsAuthData struct { MapRoles []*MapRole `yaml:"mapRoles"` MapUsers []*MapUser `yaml:"mapUsers"` }
AwsAuthData represents the data of the aws-auth configmap
func ReadAuthMap ¶
func ReadAuthMap(k kubernetes.Interface) (AwsAuthData, *kcorev1.ConfigMap, error)
ReadAuthMap reads the auth ConfigMap and returns AwsAuthData and the read ConfigMap.
func (*AwsAuthData) SetMapRoles ¶
func (m *AwsAuthData) SetMapRoles(authMap []*MapRole)
SetMapRoles sets the MapRoles element
func (*AwsAuthData) SetMapUsers ¶
func (m *AwsAuthData) SetMapUsers(authMap []*MapUser)
SetMapUsers sets the MapUsers element
type MapRole ¶
type MapRole struct { RoleARN string `yaml:"rolearn"` Username string `yaml:"username"` Groups []string `yaml:"groups,omitempty"` }
MapRole is the basic structure of a mapRoles authentication object
func NewMapRole ¶
NewMapRole returns a new NewMapRole
func (*MapRole) SetRoleARN ¶
SetRoleARN sets the Username value
type MapUser ¶
type MapUser struct { UserARN string `yaml:"userarn"` Username string `yaml:"username"` Groups []string `yaml:"groups,omitempty"` }
MapUser is the basic structure of a mapUsers authentication object
func NewMapUser ¶
NewMapUser returns a new NewMapUser
func (*MapUser) SetUserARN ¶
SetUserARN sets the UserARN value
type Mapper ¶
type Mapper struct {
KubernetesClient kubernetes.Interface
}
Mapper is responsible for managing the auth map.
func NewMapper ¶
func NewMapper(client kubernetes.Interface, discardLogOutput bool) *Mapper
NewMapper returns a new Mapper object.
type OperationType ¶
type OperationType string
OperationType indicates the auth map management operation.
const ( UpsertOperation OperationType = "upsert" RemoveOperation OperationType = "remove" )
type Service ¶
type Service interface { // UpsertMapRole upserts a MapRole into the configmap keyed by username. UpsertMapRole(username string, mapRole MapRole) error // RemoveMapRole removes a MapRole from the configmap by keyed by username RemoveMapRole(username string) error // UpsertMapUser upserts a MapUser into the configmap keyed by username. UpsertMapUser(username string, mapUser MapUser) error // RemoveMapUser removes a MapUser from the configmap keyed by username RemoveMapUser(username string) error }
Service provides aws-auth configmap management behavior.
func NewService ¶
func NewService(cfg *ServiceConfig) (Service, error)
NewService returns an implementation of the Service interface.