model

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// build-in dbroles
	RoleBuildInAdmin        string = "atlasAdmin"
	RoleBuildInReadWriteAny string = "readWriteAnyDatabase"
	RoleBuildInReadAny      string = "readAnyDatabase"

	RoleCustomAdmin     UserCustomRoleType = "dbAdmin"
	RoleCustomReadWrite UserCustomRoleType = "readWrite"
	RoleCustomRead      UserCustomRoleType = "read"
)

Variables

This section is empty.

Functions

func NewTeam added in v1.5.0

func NewTeam(name, namespace string) *v1.AtlasTeam

Types

type AProject added in v0.7.0

type AProject struct {
	metav1.TypeMeta `json:",inline"`
	ObjectMeta      *metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec            ProjectSpec        `json:"spec,omitempty"`
}

func LoadUserProjectConfig

func LoadUserProjectConfig(path string) AProject

LoadUserProjectConfig load configuration from file into object

func NewProject

func NewProject(k8sname string) *AProject

func (*AProject) ConvertByte added in v0.7.0

func (p *AProject) ConvertByte() []byte
func (p *AProject) DeletePrivateLink(id string) *AProject

func (*AProject) GetK8sMetaName added in v0.7.0

func (p *AProject) GetK8sMetaName() string

func (*AProject) GetPrivateIDByProviderRegion added in v0.7.0

func (p *AProject) GetPrivateIDByProviderRegion(statusItem status.ProjectPrivateEndpoint) string

func (*AProject) GetProjectName added in v0.7.0

func (p *AProject) GetProjectName() string

func (*AProject) ProjectName added in v0.7.0

func (p *AProject) ProjectName(name string) *AProject

func (*AProject) UpdatePrivateLinkByOrder added in v0.7.0

func (p *AProject) UpdatePrivateLinkByOrder(i int, id string) *AProject

func (*AProject) UpdatePrivateLinkID added in v0.7.0

func (p *AProject) UpdatePrivateLinkID(test v1.PrivateEndpoint) *AProject

func (*AProject) WithAuditing added in v1.4.0

func (p *AProject) WithAuditing(auditing *v1.Auditing) *AProject

func (*AProject) WithCloudAccessRole added in v1.3.0

func (p *AProject) WithCloudAccessRole(role v1.CloudProviderAccessRole) *AProject

func (*AProject) WithEncryptionAtRest added in v1.3.0

func (p *AProject) WithEncryptionAtRest(spec *v1.EncryptionAtRest) *AProject

func (*AProject) WithIntegration added in v1.0.0

func (p *AProject) WithIntegration(spec ProjectIntegration) *AProject

func (*AProject) WithIpAccess added in v0.7.0

func (p *AProject) WithIpAccess(cidrBlock, comment string) *AProject

func (*AProject) WithNetworkPeer added in v1.3.0

func (p *AProject) WithNetworkPeer(peer v1.NetworkPeer) *AProject
func (p *AProject) WithPrivateLink(provider provider.ProviderName, region string) *AProject

func (*AProject) WithSecretRef added in v1.0.0

func (p *AProject) WithSecretRef(name string) *AProject

func (*AProject) WithSecretRefNamespaced added in v1.7.0

func (p *AProject) WithSecretRefNamespaced(name, namespace string) *AProject

func (*AProject) WithX509 added in v1.1.0

func (p *AProject) WithX509(certRef *common.ResourceRefNamespaced) *AProject

type AProjectWithStatus added in v0.7.0

type AProjectWithStatus struct {
	AProject
	Status status.AtlasProjectStatus
}

type AtlasDeployment added in v1.1.0

type AtlasDeployment struct {
	metav1.TypeMeta `json:",inline"`
	ObjectMeta      *metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec            DeploymentSpec     `json:"spec,omitempty"`
}

func LoadUserDeploymentConfig added in v1.1.0

func LoadUserDeploymentConfig(path string) AtlasDeployment

LoadUserDeploymentConfig load configuration into object

func (*AtlasDeployment) DeploymentFileName added in v1.1.0

func (ad *AtlasDeployment) DeploymentFileName(input UserInputs) string

func (*AtlasDeployment) GetDeploymentNameResource added in v1.1.0

func (ad *AtlasDeployment) GetDeploymentNameResource() string

type AtlasKeyType added in v0.6.1

type AtlasKeyType struct {
	DefaultFullAccessKey bool         // use full access key provided with github secrets
	Roles                []AtlasRoles // specify role for non default
	Whitelist            []string

	GlobalLevelKey    bool // if true, tests create "<operator-deployment-name>-api-key"
	GlobalKeyAttached *mongodbatlas.APIKey
}

func NewAtlasKeyType added in v0.6.1

func NewAtlasKeyType(r []AtlasRoles, wl []string) *AtlasKeyType

func NewEmptyAtlasKeyType added in v0.6.1

func NewEmptyAtlasKeyType() *AtlasKeyType

func (*AtlasKeyType) CreateAsGlobalLevelKey added in v0.6.1

func (a *AtlasKeyType) CreateAsGlobalLevelKey() *AtlasKeyType

func (*AtlasKeyType) GetRole added in v0.6.1

func (a *AtlasKeyType) GetRole() []AtlasRoles

func (*AtlasKeyType) IsFullAccess added in v0.6.1

func (a *AtlasKeyType) IsFullAccess() bool

func (*AtlasKeyType) UseDefaultFullAccess added in v1.6.0

func (a *AtlasKeyType) UseDefaultFullAccess() *AtlasKeyType

func (*AtlasKeyType) WithRoles added in v0.6.1

func (a *AtlasKeyType) WithRoles(r []AtlasRoles) *AtlasKeyType

func (*AtlasKeyType) WithWhiteList added in v0.6.1

func (a *AtlasKeyType) WithWhiteList(wl []string) *AtlasKeyType

type AtlasRoles added in v0.6.1

type AtlasRoles = string
const (
	OrgOwner        AtlasRoles = "ORG_OWNER"
	OrgMember       AtlasRoles = "ORG_MEMBER"
	OrgGroupCreator AtlasRoles = "ORG_GROUP_CREATOR"
	OrgBillingAdmin AtlasRoles = "ORG_BILLING_ADMIN"
	OrgReadOnly     AtlasRoles = "ORG_READ_ONLY"

	GroupDeploymentManager   AtlasRoles = "GROUP_CLUSTER_MANAGER"
	GroupDataAccessAdmin     AtlasRoles = "GROUP_DATA_ACCESS_ADMIN"
	GropuDataAccessReadOnly  AtlasRoles = "GROUP_DATA_ACCESS_READ_ONLY"
	GroupDataAccessReadWrite AtlasRoles = "GROUP_DATA_ACCESS_READ_WRITE"
	GroupOwner               AtlasRoles = "GROUP_OWNER"
	GroupReadOnly            AtlasRoles = "GROUP_READ_ONLY"
)

type CatalogSource added in v0.6.1

type CatalogSource struct {
	metav1.TypeMeta `json:",inline"`
	ObjectMeta      *metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec            CatalogSourceSpec  `json:"spec,omitempty"`
}

func NewCatalogSource added in v0.6.1

func NewCatalogSource(imageURL string) CatalogSource

type CatalogSourceSpec added in v0.6.1

type CatalogSourceSpec struct {
	SourceType  string `json:"sourceType"`
	Image       string `json:"image"`
	DisplayName string `json:"displayName"`
	Publisher   string `json:"publisher"`
}

type DBUser

type DBUser struct {
	metav1.TypeMeta `json:",inline"`
	ObjectMeta      *metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec UserSpec `json:"spec,omitempty"`
}

func NewDBUser

func NewDBUser(userName string) *DBUser

func (*DBUser) AddBuildInAdminRole added in v0.6.1

func (s *DBUser) AddBuildInAdminRole() *DBUser

func (*DBUser) AddBuildInReadAnyRole added in v0.6.1

func (s *DBUser) AddBuildInReadAnyRole() *DBUser

func (*DBUser) AddBuildInReadWriteRole added in v0.6.1

func (s *DBUser) AddBuildInReadWriteRole() *DBUser

func (*DBUser) AddCustomRole added in v0.6.1

func (s *DBUser) AddCustomRole(role UserCustomRoleType, db string, collection string) *DBUser

func (*DBUser) DeleteAllRoles added in v0.6.1

func (s *DBUser) DeleteAllRoles() *DBUser

func (*DBUser) GetFilePath

func (s *DBUser) GetFilePath(projectName string) string

func (*DBUser) SaveConfigurationTo

func (s *DBUser) SaveConfigurationTo(folder string)

func (*DBUser) WithAuthDatabase

func (u *DBUser) WithAuthDatabase(name string) *DBUser

func (*DBUser) WithProjectRef

func (s *DBUser) WithProjectRef(name string) *DBUser

func (*DBUser) WithSecretRef

func (s *DBUser) WithSecretRef(name string) *DBUser

func (*DBUser) WithX509 added in v1.1.0

func (s *DBUser) WithX509(username string) *DBUser

type DeploymentSpec added in v1.1.0

type DeploymentSpec v1.AtlasDeploymentSpec

func (DeploymentSpec) GetDeploymentName added in v1.1.0

func (spec DeploymentSpec) GetDeploymentName() string

type ProjectIntegration added in v1.0.0

type ProjectIntegration project.Integration

func NewPIntegration added in v1.0.0

func NewPIntegration(iType string) *ProjectIntegration

func (*ProjectIntegration) WithAPIKeyRef added in v1.0.0

func (i *ProjectIntegration) WithAPIKeyRef(name, ns string) *ProjectIntegration

func (*ProjectIntegration) WithAPITokenRef added in v1.0.0

func (i *ProjectIntegration) WithAPITokenRef(name, ns string) *ProjectIntegration

func (*ProjectIntegration) WithAccountID added in v1.0.0

func (i *ProjectIntegration) WithAccountID(id string) *ProjectIntegration

func (*ProjectIntegration) WithChannelName added in v1.0.0

func (i *ProjectIntegration) WithChannelName(c string) *ProjectIntegration

func (*ProjectIntegration) WithFlowName added in v1.0.0

func (i *ProjectIntegration) WithFlowName(f string) *ProjectIntegration

func (*ProjectIntegration) WithLicenseKeyRef added in v1.0.0

func (i *ProjectIntegration) WithLicenseKeyRef(name, ns string) *ProjectIntegration

func (*ProjectIntegration) WithOrgName added in v1.0.0

func (i *ProjectIntegration) WithOrgName(o string) *ProjectIntegration

func (*ProjectIntegration) WithReadTokenRef added in v1.0.0

func (i *ProjectIntegration) WithReadTokenRef(name, ns string) *ProjectIntegration

func (*ProjectIntegration) WithRegion added in v1.0.0

func (i *ProjectIntegration) WithRegion(region string) *ProjectIntegration

func (*ProjectIntegration) WithRoutingKeyRef added in v1.0.0

func (i *ProjectIntegration) WithRoutingKeyRef(name, ns string) *ProjectIntegration

func (*ProjectIntegration) WithSecretRef added in v1.0.0

func (i *ProjectIntegration) WithSecretRef(name, ns string) *ProjectIntegration

func (*ProjectIntegration) WithServiceKeyRef added in v1.0.0

func (i *ProjectIntegration) WithServiceKeyRef(name, ns string) *ProjectIntegration

func (*ProjectIntegration) WithTeamName added in v1.0.0

func (i *ProjectIntegration) WithTeamName(t string) *ProjectIntegration

func (*ProjectIntegration) WithURL added in v1.0.0

func (i *ProjectIntegration) WithURL(url string) *ProjectIntegration

func (*ProjectIntegration) WithWriteTokenRef added in v1.0.0

func (i *ProjectIntegration) WithWriteTokenRef(name, ns string) *ProjectIntegration

type ProjectSpec

type ProjectSpec v1.AtlasProjectSpec

type TestDataProvider added in v0.6.1

type TestDataProvider struct {
	ConfPaths                   []string                  // init deployments configuration
	ConfUpdatePaths             []string                  // update configuration
	Resources                   UserInputs                // struct of all user resources project, deployments, database users
	Actions                     []func(*TestDataProvider) // additional actions for the current data set
	PortGroup                   int                       // ports for the test application starts from _
	SkipAppConnectivityCheck    bool
	Context                     context.Context
	K8SClient                   client.Client
	InitialDeployments          []*v1.AtlasDeployment
	Project                     *v1.AtlasProject
	Prefix                      string
	Users                       []*v1.AtlasDatabaseUser
	Teams                       []*v1.AtlasTeam
	ManagerContext              context.Context
	AWSResourcesGenerator       *helper.AwsResourcesGenerator
	ObjectDeletionProtection    bool
	SubObjectDeletionProtection bool
}

Full Data set for the current test case

func DataProvider added in v1.4.0

func DataProvider(keyTestPrefix string, r *AtlasKeyType, portGroup int, actions []func(*TestDataProvider)) *TestDataProvider

func DataProviderWithResources added in v1.4.0

func DataProviderWithResources(keyTestPrefix string, project AProject, r *AtlasKeyType, initDeploymentConfigs []string, updateDeploymentConfig []string, users []DBUser, portGroup int, actions []func(*TestDataProvider)) TestDataProvider

func (TestDataProvider) WithInitialDeployments added in v1.4.0

func (data TestDataProvider) WithInitialDeployments(deployments ...*v1.AtlasDeployment) *TestDataProvider

func (TestDataProvider) WithObjectDeletionProtection added in v1.9.0

func (data TestDataProvider) WithObjectDeletionProtection(protected bool) *TestDataProvider

func (TestDataProvider) WithProject added in v1.4.0

func (data TestDataProvider) WithProject(project *v1.AtlasProject) *TestDataProvider

func (TestDataProvider) WithSubObjectDeletionProtection added in v1.9.0

func (data TestDataProvider) WithSubObjectDeletionProtection(protected bool) *TestDataProvider

func (TestDataProvider) WithUsers added in v1.4.0

func (data TestDataProvider) WithUsers(users ...*v1.AtlasDatabaseUser) *TestDataProvider

type UserCustomRoleType added in v0.6.1

type UserCustomRoleType string

type UserInputs

type UserInputs struct {
	TestID             string
	AtlasKeyAccessType AtlasKeyType
	ProjectID          string
	KeyName            string
	Namespace          string
	ProjectPath        string
	Deployments        []AtlasDeployment
	Users              []DBUser
	Project            *AProject
}

func NewSimpleUserInputs added in v1.4.0

func NewSimpleUserInputs(keyTestPrefix string, r *AtlasKeyType) UserInputs

NewUsersInputs prepare users inputs

func NewUserInputs

func NewUserInputs(keyTestPrefix string, project AProject, users []DBUser, r *AtlasKeyType) UserInputs

NewUsersInputs prepare users inputs

func (*UserInputs) GetAppFolder

func (u *UserInputs) GetAppFolder() string

func (*UserInputs) GetAtlasProjectFullKubeName added in v0.7.0

func (u *UserInputs) GetAtlasProjectFullKubeName() string

func (*UserInputs) GetOperatorFolder

func (u *UserInputs) GetOperatorFolder() string

func (*UserInputs) GetResourceFolder

func (u *UserInputs) GetResourceFolder() string

func (*UserInputs) GetServiceCatalogSourceFolder added in v0.6.1

func (u *UserInputs) GetServiceCatalogSourceFolder() string

func (*UserInputs) GetUsersFolder

func (u *UserInputs) GetUsersFolder() string

type UserSpec

type UserSpec v1.AtlasDatabaseUserSpec

Jump to

Keyboard shortcuts

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