env

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRedisImage    = "redis:8.2.1-alpine"
	CRedisPort     = 6379
	CRedisPassword = "password"

	CKeystoneImage                    = "ghcr.io/aiivashchenko/docker-keystone:27.0.0"
	CKeystoneExternalPort             = 5000
	CKeystoneAdminPort                = 35357
	CKeystoneAdminUsername            = "admin"
	CKeystoneAdminPassword            = "password"
	CKeystoneAdminDomainName          = "Default"
	CKeystoneAdminTenantName          = "admin"
	CkeystoneAdminRoleName            = "admin"
	CKeystoneObjectStoreServiceType   = "object-store"
	CKeystoneServiceProjectName       = "service"
	CKeystoneSwiftServiceName         = "swift"
	CKeystoneSwiftUsername            = "swift"
	CKeystoneSwiftPassword            = "swiftpass"
	CKeystoneSwiftEndpointName        = "swift"
	CKeystoneSwiftEndpointURLTemplate = "http://%s:%d/v1/AUTH_$(tenant_id)s"
	CKeystoneSwiftOperatorRole        = "swift-operator"
	CKeystoneSwiftResellerRole        = "swift-reseller"
	CKeystoneCephUsername             = "ceph"
	CKeystoneCephPassword             = "cephpass"
	CKeystoneCephServiceName          = "ceph"
	CKeystoneCephEndpointName         = "ceph"
	CKeystoneCephEndpointURLTemplate  = "http://%s:%d/swift/v1/AUTH_$(tenant_id)s"
	CKeystoneCephOperatorRole         = "ceph-operator"
	CKeystoneCephResellerRole         = "ceph-reseller"

	CGoFakeS3EC2AccessToken = "a7f1e798b7c2417cba4a02de97dc3cdc"
	CGoFakeS3EC2SecretToken = "18f4f6761ada4e3795fa5273c30349b9"

	CSwiftImage = "ghcr.io/aiivashchenko/docker-swift:2.35.0"
	CSwiftPort  = 8080

	CMinioImage          = "minio/minio:RELEASE.2025-09-07T16-13-09Z-cpuv1"
	CMinioUsername       = "minioadmin"
	CMinioPassword       = "minioadmin"
	CMinioS3Port         = 9000
	CMinioManagementPort = 9001

	CCephX8664Image       = "quay.io/ceph/demo:main-985bb830-main-centos-stream8-x86_64"
	CCephARM64Image       = "quay.io/ceph/demo:main-985bb83-main-centos-arm64-stream8-aarch64"
	CCephPublicNetwork    = "127.0.0.1/32"
	CCephMonIP            = "127.0.0.1"
	CCephDomainName       = "localhost"
	CCephDemoUID          = "cephuid"
	CCephOSDDirectoryMode = "directory"
	CCephAPIPort          = 8080

	CContainerStopDeadline = 10 * time.Second

	CNATPortTemplate = "%d/tcp"
)

Variables

This section is empty.

Functions

func RandomFreePort added in v0.6.0

func RandomFreePort() (int, error)

Types

type CephAccessConfig

type CephAccessConfig struct {
	Keystone StorageKeystoneAccessConfig
	Host     ContainerHost
	Port     ContainerPort
}

type CephRGWTemplateValues

type CephRGWTemplateValues struct {
	AuthHost         string
	AdminProject     string
	AdminDomain      string
	AdminUser        string
	AdminPassword    string
	OperatorRole     string
	ResellerRole     string
	ExternalAuthPort int
}

type ComponentCreationConfig

type ComponentCreationConfig struct {
	InstantiateFunc func(context.Context, *TestEnvironment, string, *ComponentCreationConfig) error
	Dependencies    []string
	DisabledLogs    []string
}

func AsCeph

func AsCeph(keystoneInstance string, opts ...ComponentOption) ComponentCreationConfig

func AsGoFakeS3 added in v0.6.0

func AsGoFakeS3(opts ...ComponentOption) ComponentCreationConfig

func AsKeystone

func AsKeystone(opts ...ComponentOption) ComponentCreationConfig

func AsMiniRedis added in v0.6.0

func AsMiniRedis(opts ...ComponentOption) ComponentCreationConfig

func AsMinio

func AsRedis

func AsSwift

func AsSwift(keystoneInstance string, opts ...ComponentOption) ComponentCreationConfig

type ComponentOption

type ComponentOption interface {
	// contains filtered or unexported methods
}

ComponentOption interface to support Functional options for test-containers.

func WithDisabledSTDErrLog

func WithDisabledSTDErrLog() ComponentOption

WithDisabledSTDErrLog disables STDERR logs for the container.

func WithDisabledSTDOutLog

func WithDisabledSTDOutLog() ComponentOption

WithDisabledSTDOutLog disables STDOUT logs for the container.

type ContainerHost

type ContainerHost struct {
	NAT   string
	Local string
}

type ContainerLogConsumer

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

func NewContainerLogConsumer

func NewContainerLogConsumer(componenetName string, disabled []string) *ContainerLogConsumer

func (*ContainerLogConsumer) Accept

type ContainerPort

type ContainerPort struct {
	Exposed   int
	Forwarded int
}

type GoFakeS3AccessConfig added in v0.6.0

type GoFakeS3AccessConfig struct {
	Host        string
	AccessToken string
	SecretToken string
	Port        int
}

type KeystoneAccessConfig

type KeystoneAccessConfig struct {
	DefaultDomain  *domains.Domain
	ServiceProject *projects.Project
	Host           ContainerHost
	User           string
	Password       string
	TenantName     string
	ExternalPort   ContainerPort
	AdminPort      ContainerPort
}

type MiniRedisAccessConfig added in v0.6.0

type MiniRedisAccessConfig struct {
	Host     string
	Password string
	Port     int
}

type MinioAccessConfig

type MinioAccessConfig struct {
	Host           ContainerHost
	User           string
	Password       string
	S3Port         ContainerPort
	ManagementPort ContainerPort
}

type RedisAccessConfig

type RedisAccessConfig struct {
	Host     ContainerHost
	Password string
	Port     ContainerPort
}

type StorageKeystoneAccessConfig

type StorageKeystoneAccessConfig struct {
	OperatorRole *roles.Role
	ResellerRole *roles.Role
}

type SwiftAccessConfig

type SwiftAccessConfig struct {
	Keystone StorageKeystoneAccessConfig
	Host     ContainerHost
	Port     ContainerPort
}

type SwiftProxyConfigTemplateValues

type SwiftProxyConfigTemplateValues struct {
	AuthHost         string
	AdminTenant      string
	AdminDomain      string
	AdminUser        string
	AdminPassword    string
	OperatorRole     string
	ResellerRole     string
	AdminAuthPort    int
	ExternalAuthPort int
}

type Terminator added in v0.6.0

type Terminator func(context.Context) error

type TestEnvironment

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

func NewTestEnvironment

func NewTestEnvironment(ctx context.Context, envConfig map[string]ComponentCreationConfig) (*TestEnvironment, error)

func (*TestEnvironment) GetCephAccessConfig

func (r *TestEnvironment) GetCephAccessConfig(instanceName string) (*CephAccessConfig, error)

func (*TestEnvironment) GetGoFakeS3AccessConfig added in v0.6.0

func (r *TestEnvironment) GetGoFakeS3AccessConfig(instanceName string) (*GoFakeS3AccessConfig, error)

func (*TestEnvironment) GetKeystoneAccessConfig

func (r *TestEnvironment) GetKeystoneAccessConfig(instanceName string) (*KeystoneAccessConfig, error)

func (*TestEnvironment) GetMiniRedisAccessConfig added in v0.6.0

func (r *TestEnvironment) GetMiniRedisAccessConfig(instanceName string) (*MiniRedisAccessConfig, error)

func (*TestEnvironment) GetMinioAccessConfig

func (r *TestEnvironment) GetMinioAccessConfig(instanceName string) (*MinioAccessConfig, error)

func (*TestEnvironment) GetRedisAccessConfig

func (r *TestEnvironment) GetRedisAccessConfig(instanceName string) (*RedisAccessConfig, error)

func (*TestEnvironment) GetSwiftAccessConfig

func (r *TestEnvironment) GetSwiftAccessConfig(instanceName string) (*SwiftAccessConfig, error)

func (*TestEnvironment) Terminate

func (r *TestEnvironment) Terminate(ctx context.Context) error

Jump to

Keyboard shortcuts

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