Documentation ¶
Index ¶
- Constants
- func Run(ctx context.Context, vsuc *VSphereSetupUserConfig, govc GovcClient) error
- func SetupGOVCEnv(ctx context.Context, vsuc *VSphereSetupUserConfig) error
- func ValidateVSphereObjects(ctx context.Context, c *VSphereSetupUserConfig, govc GovcClient) error
- type Connection
- type GovcClient
- type Objects
- type VSphereSetupUserConfig
- type VSphereUserSpec
Constants ¶
View Source
const ( DefaultUsername = "eksa" DefaultGroup = "EKSAUsers" DefaultGlobalRole = "EKSAGlobalRole" DefaultUserRole = "EKSAUserRole" DefaultAdminRole = "EKSACloudAdminRole" )
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(ctx context.Context, vsuc *VSphereSetupUserConfig, govc GovcClient) error
Run sets up a vSphere user with appropriate group, role, and permissions to create EKS-A kubernetes clusters.
func SetupGOVCEnv ¶
func SetupGOVCEnv(ctx context.Context, vsuc *VSphereSetupUserConfig) error
SetupGOVCEnv creates appropriate govc environment variables to build govc client.
func ValidateVSphereObjects ¶
func ValidateVSphereObjects(ctx context.Context, c *VSphereSetupUserConfig, govc GovcClient) error
ValidateVSphereObjects validates objects do not exist before configuring user.
Types ¶
type Connection ¶
type GovcClient ¶
type GovcClient interface { CreateUser(ctx context.Context, username string, password string) error UserExists(ctx context.Context, username string) (bool, error) CreateGroup(ctx context.Context, name string) error GroupExists(ctx context.Context, name string) (bool, error) AddUserToGroup(ctx context.Context, name string, username string) error RoleExists(ctx context.Context, name string) (bool, error) CreateRole(ctx context.Context, name string, privileges []string) error SetGroupRoleOnObject(ctx context.Context, principal string, role string, object string, domain string) error }
GovcClient specifies govc functions required to configure a vsphere user.
type VSphereSetupUserConfig ¶
type VSphereSetupUserConfig struct { ApiVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Spec VSphereUserSpec `yaml:"spec"` }
func GenerateConfig ¶
func GenerateConfig(ctx context.Context, filepath string) (*VSphereSetupUserConfig, error)
type VSphereUserSpec ¶
type VSphereUserSpec struct { Datacenter string `yaml:"datacenter"` VSphereDomain string `yaml:"vSphereDomain"` Connection Connection `yaml:"connection"` Objects Objects `yaml:"objects"` // Below are optional fields with defaults Username string `yaml:"username"` GroupName string `yaml:"group"` GlobalRole string `yaml:"globalRole"` UserRole string `yaml:"userRole"` AdminRole string `yaml:"adminRole"` }
Click to show internal directories.
Click to hide internal directories.