storage

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetMinIOError            = "get minIO error"
	GenerateMinIOCrError     = "generate minIO cr error"
	UpdateMinIOError         = "update minIO error"
	CreateMinIOSecretError   = "create minIO secret error" //nolint:gosec
	CreateMinIOIngressError  = "create ingress of minIO error"
	CreateMinIOError         = "create minIO CR error"
	CreateDefaultBucketError = "create default bucket in minIO Error"
	GetMinIOProperties       = "get MinIO Properties error"
	UpdateIngressError       = "update minIO ingress error"
	GetMinIOIngressError     = "get minIO ingress error"
	CreateInitJobError       = "create minIO init job error"
	DeleteInitJobError       = "delete minIO init job error"
	GetInitJobError          = "get minIO init job error"
	UpdateInitJobError       = "update minIO init job error"
)

Define error message.

View Source
const (
	ComponentName            = "cluster-minio"
	MinIOClientComponentName = "cluster-minio-init"
)
View Source
const (
	NCPIngressValueTrue     = "true"
	ContourIngressValueTrue = "true"
)
View Source
const (
	Storage = "storage"

	DefaultCredsSecret = "creds"
	DefaultPrefix      = "minio-"
	DefaultZone        = "zone-harbor"
	DefaultRegion      = "us-east-1"
	DefaultBucket      = "harbor"
	DefaultServicePort = 80
)

Variables

View Source
var HarborClusterMinIOGVK = schema.GroupVersionKind{
	Group:   miniov2.SchemeGroupVersion.Group,
	Version: miniov2.SchemeGroupVersion.Version,
	Kind:    miniov2.MinIOCRDResourceKind,
}

Functions

func NewMinIOController

func NewMinIOController(options ...k8s.Option) lcm.Controller

Types

type MinIOController

type MinIOController struct {
	KubeClient  client.Client
	Ctx         context.Context
	Log         logr.Logger
	Scheme      *runtime.Scheme
	Recorder    record.EventRecorder
	MinioClient Minio
	ConfigStore *configstore.Store
}

func (*MinIOController) Apply

func (m *MinIOController) Apply(ctx context.Context, harborcluster *goharborv1.HarborCluster, _ ...lcm.Option) (*lcm.CRStatus, error)

Reconciler implements the reconcile logic of minIO service.

func (*MinIOController) Delete

func (m *MinIOController) Delete(ctx context.Context, harborcluster *goharborv1.HarborCluster) (*lcm.CRStatus, error)

func (*MinIOController) Upgrade

type Minio

type Minio interface {
	IsBucketExists(ctx context.Context, bucket string) (bool, error)
	CreateBucket(ctx context.Context, bucket string) error
}

Minio defines related operations of minio.

func NewMinioClient

func NewMinioClient(endpoint *MinioEndpoint) (Minio, error)

NewMinioClient constructs a new minio client.

type MinioClient

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

MinioClient is an implementation of Minio.

func (MinioClient) CreateBucket

func (m MinioClient) CreateBucket(ctx context.Context, bucket string) error

CreateBucket creates a bucket.

func (MinioClient) IsBucketExists

func (m MinioClient) IsBucketExists(ctx context.Context, bucket string) (bool, error)

IsBucketExists checks if the bucket existing.

type MinioEndpoint

type MinioEndpoint struct {
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string
	// Optional
	Location string
	UseSSL   bool
}

MinioEndpoint contains the related access info of a minio server.

Directories

Path Synopsis
minio

Jump to

Keyboard shortcuts

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