Documentation ¶
Overview ¶
Package planner helps determine the desired state.
Index ¶
- Constants
- func CheckCompatible(current, existing InstanceConfiguration) error
- type DNSRegister
- type GroupMode
- type IncompatibleInstanceError
- type InstanceConfiguration
- type Paths
- func (*Paths) ContainerConfigDir() string
- func (p *Paths) ContainerConfigs() []string
- func (*Paths) JoinJSONBaseName() string
- func (p *Paths) JoinJSONSource(index int) string
- func (*Paths) JoinJSONSourceDir(index int) string
- func (*Paths) OSRunDir() string
- func (*Paths) SambaStateDir() string
- func (p *Paths) ServiceWatchJSON() string
- func (*Paths) ServiceWatchStateDir() string
- func (p *Paths) Share() string
- func (p *Paths) ShareMountPath() string
- func (*Paths) UsersConfigBaseName() string
- func (*Paths) UsersConfigDir() string
- func (*Paths) WinbindSocketsDir() string
- type Planner
- func (p *Planner) Args() *SambaContainerArgs
- func (pl *Planner) ClusterSize() int32
- func (pl *Planner) DNSRegister() DNSRegister
- func (pl *Planner) Grouping() (GroupMode, string)
- func (pl *Planner) InstanceName() string
- func (pl *Planner) IsClustered() bool
- func (pl *Planner) MayCluster() bool
- func (pl *Planner) NodeSelector() (map[string]string, error)
- func (pl *Planner) NodeSpread() bool
- func (planner *Planner) Paths() *Paths
- func (pl *Planner) Prune() (changed bool, err error)
- func (pl *Planner) Realm() string
- func (pl *Planner) SambaContainerDebugLevel() string
- func (pl *Planner) SecurityMode() SecurityMode
- func (pl *Planner) ServiceType() string
- func (pl *Planner) Update() (changed bool, err error)
- func (pl *Planner) UserSecuritySource() UserSecuritySource
- func (pl *Planner) Workgroup() string
- type SambaContainerArgs
- func (*SambaContainerArgs) CTDBDaemon() []string
- func (*SambaContainerArgs) CTDBManageNodes() []string
- func (*SambaContainerArgs) CTDBMigrate() []string
- func (*SambaContainerArgs) CTDBMustHaveNode() []string
- func (*SambaContainerArgs) CTDBNodeStatus() []string
- func (*SambaContainerArgs) CTDBSetNode() []string
- func (s *SambaContainerArgs) DNSRegister() []string
- func (*SambaContainerArgs) EnsureSharePaths() []string
- func (s *SambaContainerArgs) Initializer(cmd string) []string
- func (s *SambaContainerArgs) Run(name string) []string
- func (*SambaContainerArgs) UpdateConfigWatch() []string
- type SecurityMode
- type UserSecuritySource
Constants ¶
const ( // DNSRegisterNever means the system should never register itself. DNSRegisterNever = DNSRegister("never") // DNSRegisterExternalIP means the system should register its // external IP address. DNSRegisterExternalIP = DNSRegister("external-ip") // DNSRegisterClusterIP means the system should register its // in-cluster IP address. DNSRegisterClusterIP = DNSRegister("cluster-ip") )
const ( // UserMode means users and groups are locally configured UserMode = SecurityMode("user") // ADMode means users and groups are sourced from an Active Directory // domain. ADMode = SecurityMode("active-directory") )
const ( // GroupModeNever disallows grouping shares. this is the default GroupModeNever = GroupMode("never") // GroupModeExplicit enables grouping with specific group naming GroupModeExplicit = GroupMode("explicit") // GroupModeUnset is equivalent to groupModeNever GroupModeUnset = GroupMode("") )
Variables ¶
This section is empty.
Functions ¶
func CheckCompatible ¶
func CheckCompatible(current, existing InstanceConfiguration) error
CheckCompatible returns an error if the instance configurations are not compatible with each other. A compatible instance is one that can share the same smbd.
Types ¶
type DNSRegister ¶
type DNSRegister string
DNSRegister describes how an instance should register itself with a DNS system (typically AD).
type GroupMode ¶
type GroupMode string
GroupMode describes how/if SmbShares are allowed to be grouped together in on server instance
type IncompatibleInstanceError ¶
type IncompatibleInstanceError struct {
// contains filtered or unexported fields
}
IncompatibleInstanceError indicates SmbShare resources are not compatible with each other and can not hosted by the same server.
func (IncompatibleInstanceError) Error ¶
func (iie IncompatibleInstanceError) Error() string
Error interface method.
type InstanceConfiguration ¶
type InstanceConfiguration struct { SecurityConfig *api.SmbSecurityConfig CommonConfig *api.SmbCommonConfig GlobalConfig *conf.OperatorConfig }
InstanceConfiguration bundles together the various inputs that define the configuration of a server group instance.
type Paths ¶
type Paths struct {
// contains filtered or unexported fields
}
Paths for relevant files and dirs within the containers.
func (*Paths) ContainerConfigDir ¶
ContainerConfigDir absolute path.
func (*Paths) ContainerConfigs ¶
ContainerConfigs returns a slice containing all configuration files that the samba-container should process.
func (*Paths) JoinJSONBaseName ¶
JoinJSONBaseName file name component.
func (*Paths) JoinJSONSource ¶
JoinJSONSource absolute path based on the given index value.
func (*Paths) JoinJSONSourceDir ¶
JoinJSONSourceDir absolute path based on the given index value.
func (*Paths) ServiceWatchJSON ¶
ServiceWatchJSON file absolute path.
func (*Paths) ServiceWatchStateDir ¶
ServiceWatchStateDir absolute path.
func (*Paths) ShareMountPath ¶
ShareMountPath returns the mount path.
func (*Paths) UsersConfigBaseName ¶
UsersConfigBaseName file name component.
func (*Paths) WinbindSocketsDir ¶
WinbindSocketsDir absolute path.
type Planner ¶
type Planner struct { // InstanceConfiguration is used as the configuration "intent". // The planner treats it as read only. InstanceConfiguration // ConfigState covers the shared configuration state that is mapped // into all containers/pods and generally interpreted by sambacc // for managing the behavior of samba containers. The planner treats // it as read/write. ConfigState *smbcc.SambaContainerConfig }
Planner arranges the state of the instance to be.
func New ¶
func New( ic InstanceConfiguration, state *smbcc.SambaContainerConfig) *Planner
New instance of a planner based on the configuration CRs as well an existing configuration state (if it existed).
func (*Planner) Args ¶
func (p *Planner) Args() *SambaContainerArgs
Args returns a SambaContainerArgs type for starting containers in this instance.
func (*Planner) ClusterSize ¶
ClusterSize returns the (minimum) size of the cluster.
func (*Planner) DNSRegister ¶
func (pl *Planner) DNSRegister() DNSRegister
DNSRegister returns a DNSRegister type for this instance.
func (*Planner) InstanceName ¶
InstanceName returns the instance's name.
func (*Planner) IsClustered ¶
IsClustered returns true if the instance is configured for clustering.
func (*Planner) MayCluster ¶
MayCluster returns true if the operator is permitted to create clustered instances.
func (*Planner) NodeSelector ¶
NodeSelector returns a mapping of k8s label names to values that are used to select what nodes resources are scheduled to run on.
func (*Planner) NodeSpread ¶
NodeSpread returns true if pods are required to be spread over multiple nodes.
func (*Planner) SambaContainerDebugLevel ¶
SambaContainerDebugLevel returns a string that can be passed to Samba tools for debugging.
func (*Planner) SecurityMode ¶
func (pl *Planner) SecurityMode() SecurityMode
SecurityMode returns the high level security mode to be used.
func (*Planner) ServiceType ¶
ServiceType returns the value that should be used for a Service fronting the SMB port for this instance.
func (*Planner) Update ¶
Update the held configuration based on the state of the instance configuration.
func (*Planner) UserSecuritySource ¶
func (pl *Planner) UserSecuritySource() UserSecuritySource
UserSecuritySource returns the UserSecuritySource type for the particular instance.
type SambaContainerArgs ¶
type SambaContainerArgs struct {
// contains filtered or unexported fields
}
SambaContainerArgs generates sets for arguments for samba-container instances.
func (*SambaContainerArgs) CTDBDaemon ¶
func (*SambaContainerArgs) CTDBDaemon() []string
CTDBDaemon container arguments generator.
func (*SambaContainerArgs) CTDBManageNodes ¶
func (*SambaContainerArgs) CTDBManageNodes() []string
CTDBManageNodes container arguments generator.
func (*SambaContainerArgs) CTDBMigrate ¶
func (*SambaContainerArgs) CTDBMigrate() []string
CTDBMigrate container arguments generator.
func (*SambaContainerArgs) CTDBMustHaveNode ¶
func (*SambaContainerArgs) CTDBMustHaveNode() []string
CTDBMustHaveNode container arguments generator.
func (*SambaContainerArgs) CTDBNodeStatus ¶
func (*SambaContainerArgs) CTDBNodeStatus() []string
CTDBNodeStatus container arguments generator.
func (*SambaContainerArgs) CTDBSetNode ¶
func (*SambaContainerArgs) CTDBSetNode() []string
CTDBSetNode container arguments generator.
func (*SambaContainerArgs) DNSRegister ¶
func (s *SambaContainerArgs) DNSRegister() []string
DNSRegister container arguments generator.
func (*SambaContainerArgs) EnsureSharePaths ¶
func (*SambaContainerArgs) EnsureSharePaths() []string
EnsureSharePaths container arguments generator.
func (*SambaContainerArgs) Initializer ¶
func (s *SambaContainerArgs) Initializer(cmd string) []string
Initializer container arguments generator.
func (*SambaContainerArgs) Run ¶
func (s *SambaContainerArgs) Run(name string) []string
Run container arguments generator.
func (*SambaContainerArgs) UpdateConfigWatch ¶
func (*SambaContainerArgs) UpdateConfigWatch() []string
UpdateConfigWatch container arguments generator.
type SecurityMode ¶
type SecurityMode string
SecurityMode describes the high level user-authentication used by a share or instance.