storage

package
v0.0.0-...-3f65eeb Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStorageNotConfigured = fmt.Errorf("storage backend not configured")

Functions

func GetPlatformStorage

GetPlatformStorage returns the storage configuration that should be used based on the cloud platform we are running on, as determined from the infrastructure configuration. Also it returns the recommend number of replicas for this platform.

Following rules apply:

  • If it is a known platform for which we have a backend implementation (e.g. AWS) we return a storage configuration that uses that implementation.
  • If it is a known platform and it doesn't provide any backend implementation, we return an empty storage configuration.
  • If it is a unknown platform we return a storage configuration with EmptyDir. This is useful as it easily allows other teams to experiment with OpenShift in new platforms, if it is LibVirt platform we also return EmptyDir for historical reasons.

func IsMultiStoragesError

func IsMultiStoragesError(err error) bool

Types

type Driver

type Driver interface {
	// CABundle returns the CA bundle that should be used to verify storage
	// certificates. The returned system flag indicates whether the system
	// trust bundle should be used in addition to the returned bundle.
	CABundle() (bundle string, system bool, err error)

	// ConfigEnv returns the environment variables for the image registry
	// pods.
	ConfigEnv() (envvar.List, error)

	// Volumes returns the volumes for the image registry pods.
	Volumes() ([]corev1.Volume, []corev1.VolumeMount, error)

	// VolumeSecrets returns secret data for injection into the secret
	// image-registry-private-configuration. This secret should be used by
	// Volumes.
	VolumeSecrets() (map[string]string, error)

	// CreateStorage configures, creates, and reconsiles the storage
	// backend. It is called when the storage configuration is changed or
	// the storage backend does not exist.
	CreateStorage(*imageregistryv1.Config) error

	// StorageExists returns true if the storage backend is configured and
	// exists.
	StorageExists(*imageregistryv1.Config) (bool, error)

	// RemoveStorage removes the storage backend.
	RemoveStorage(*imageregistryv1.Config) (bool, error)

	// StorageChanged returns true if the storage configuration has changed.
	StorageChanged(*imageregistryv1.Config) bool

	// ID returns the unique identifier of the storage backend. It helps
	// the operator to determine if the storage backend is changed and the
	// data potentially needs to be migrated.
	ID() string
}

type MultiStoragesError

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

MultiStoragesError is returned when we have multiple storage engines configured and we can't determine which one the user wants to use.

func (*MultiStoragesError) Error

func (m *MultiStoragesError) Error() string

Error return MultiStoragesError as string.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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