Documentation
¶
Overview ¶
Package sharedstore provides a shared CephObjectStore fixture for tests under tests/integration/object. A single store is created once and torn down after all sub-package tests complete, avoiding the per-package setup/teardown overhead.
Index ¶
- type Config
- type Sharedstore
- func (s *Sharedstore) AdminClient() *admin.API
- func (s *Sharedstore) Destroy()
- func (s *Sharedstore) Installer() *installer.CephInstaller
- func (s *Sharedstore) ObjectStore() *cephv1.CephObjectStore
- func (s *Sharedstore) SnsClient() *sns.Client
- func (s *Sharedstore) TLSEnabled() bool
- func (s *Sharedstore) Teardown(t *testing.T)
- type StoreKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v1.21.0
type Config struct {
// Namespace is the cluster namespace holding the store.
Namespace string
// StoreName names the CephObjectStore and everything derived from it.
StoreName string
// Instances is the RGW gateway count.
Instances int32
// TLSEnable serves the store over https with a generated certificate
// instead of plain http.
TLSEnable bool
// Kind selects a Zoned (default) or Classic store.
Kind StoreKind
// AllowUsersInNamespaces is propagated to the store field of the same name,
// which gates CephObjectStoreUsers that name this store from another
// namespace.
AllowUsersInNamespaces []string
}
Config describes the CephObjectStore for Create to build. Its zero value is a Zoned store, so a caller sets only what it needs.
type Sharedstore ¶ added in v1.20.2
type Sharedstore struct {
// contains filtered or unexported fields
}
func Create ¶ added in v1.20.2
func Create(t *testing.T, k8sh *utils.K8sHelper, installer *installer.CephInstaller, cfg Config) *Sharedstore
Create creates the CephObjectStore cfg describes, along with its Service and — for a Zoned store — its realm, zone, and pools, waits for it to become Ready, and returns a Sharedstore whose Destroy method tears it all down; Destroy should be deferred by the caller.
func (*Sharedstore) AdminClient ¶ added in v1.20.2
func (s *Sharedstore) AdminClient() *admin.API
func (*Sharedstore) Destroy ¶ added in v1.20.2
func (s *Sharedstore) Destroy()
func (*Sharedstore) Installer ¶ added in v1.21.0
func (s *Sharedstore) Installer() *installer.CephInstaller
Installer returns the suite installer, for tests that must run commands (e.g. radosgw-admin) inside the cluster.
func (*Sharedstore) ObjectStore ¶ added in v1.20.2
func (s *Sharedstore) ObjectStore() *cephv1.CephObjectStore
func (*Sharedstore) SnsClient ¶ added in v1.20.2
func (s *Sharedstore) SnsClient() *sns.Client
func (*Sharedstore) TLSEnabled ¶ added in v1.20.2
func (s *Sharedstore) TLSEnabled() bool
func (*Sharedstore) Teardown ¶ added in v1.21.0
func (s *Sharedstore) Teardown(t *testing.T)
Teardown deletes the store's resources the same way Destroy does but without the enclosing t.Run subtest, so — unlike Destroy — it is safe to call from a t.Cleanup, where t.Run panics. It is a no-op once the store has been torn down, so a caller that tears down explicitly can still call it unconditionally from a cleanup. Failures are reported against t.
type StoreKind ¶ added in v1.21.0
type StoreKind int
StoreKind selects the shape of the CephObjectStore a Config describes.
const ( // Zoned is a multisite store. It owns CephObjectRealm, CephObjectZoneGroup // and CephObjectZone CRs, and its pools are CephBlockPool CRs the zone // references as shared pool placements. Zoned StoreKind = iota // Classic is a non-multisite store. Its pools are declared in the store // spec for the operator to provision, so it owns no zone or pool CRs of its // own. The operator only looks for user and bucket dependents on a store of // this shape (or on a multisite store whose zone is its zonegroup's // master), so a test of deletion being blocked by dependents needs it. Classic )