Documentation ¶
Index ¶
Constants ¶
View Source
const ( // AccessKeyID is a constant for the key in a backup secret that holds the OCS S3 access key id. AccessKeyID = "accessKeyID" // SecretAccessKey is a constant for the key in a backup secret that holds the OCS S3 secret access key. SecretAccessKey = "secretAccessKey" // Endpoint is a constant for the key in a backup secret that holds an OCS S3 endpoint. Endpoint = "endpoint" // DisableSSL is a constant for the key in a backup secret that specifies whether SSL should be disabled or not. DisableSSL = "disableSSL" // InsecureSkipVerify is a constant for the key in a backup secret that specifies whether the client verifies the server's certificate chain and host name. InsecureSkipVerify = "insecureSkipVerify" // Region is a constant for the key in a backup secret that points to a region. Region = "region" )
View Source
const (
// ErrCodeNoSuchBucket for service response error code "BucketNotEmpty". The bucket you tried to delete is not empty.
ErrCodeBucketNotEmpty = "BucketNotEmpty"
)
View Source
const Type = "OCS"
Type is the type of resources managed by the S3 controllers.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewClientFromSecretRef ¶
func NewClientFromSecretRef(ctx context.Context, client client.Client, secretRef corev1.SecretReference, region string) (*Client, error)
NewClientFromSecretRef creates a new s3 Client for the given s3 credentials from given k8s <secretRef> and the OCS <region>.
func (*Client) CreateBucketIfNotExists ¶
CreateBucketIfNotExists creates the s3 bucket with name <bucket> in <region>.
func (*Client) DeleteBucketIfExists ¶
DeleteBucketIfExists deletes the s3 bucket with name <bucket>. If it does not exist, no error is returned.
type Credentials ¶
type Credentials struct { AccessKeyID string SecretAccessKey string Endpoint string DisableSSL bool InsecureSkipVerify bool }
Credentials stores AWS credentials.
func GetCredentialsFromSecretRef ¶
func GetCredentialsFromSecretRef(ctx context.Context, client client.Client, secretRef corev1.SecretReference) (*Credentials, error)
GetCredentialsFromSecretRef reads the secret given by the the secret reference and returns the read Credentials object.
func ReadCredentialsSecret ¶
func ReadCredentialsSecret(secret *corev1.Secret) (*Credentials, error)
ReadCredentialsSecret reads a secret containing credentials.
Click to show internal directories.
Click to hide internal directories.