diff --git a/apis/v1alpha1/common.go b/apis/v1alpha1/common.go index 42f369e..6edccc0 100644 --- a/apis/v1alpha1/common.go +++ b/apis/v1alpha1/common.go @@ -573,7 +573,7 @@ func (in *TLSSpec) GetSecretName() string { // ObjectStorageProviderSpec defines the object storage provider for the cluster. The data will be stored in the storage. type ObjectStorageProviderSpec struct { - // S3 is the S3 storage configuration. + // S3 is the AWS S3 storage configuration. // +optional S3 *S3Storage `json:"s3,omitempty"` @@ -581,13 +581,13 @@ type ObjectStorageProviderSpec struct { // +optional OSS *OSSStorage `json:"oss,omitempty"` - // GCS is the Google GCS storage configuration. + // GCS is the Google cloud storage configuration. // +optional GCS *GCSStorage `json:"gcs,omitempty"` - // Blob is the Azure Blob storage configuration. + // AZBlob is the Azure Blob storage configuration. // +optional - Blob *BlobStorage `json:"blob,omitempty"` + AZBlob *AZBlobStorage `json:"azblob,omitempty"` // Cache is the cache storage configuration for object storage. // +optional @@ -600,7 +600,7 @@ type ObjectStorageProviderAccessor interface { GetS3Storage() *S3Storage GetGCSStorage() *GCSStorage GetOSSStorage() *OSSStorage - GetBlobStorage() *BlobStorage + GetAZBlobStorage() *AZBlobStorage GetCacheFileStorage() *FileStorage } @@ -634,9 +634,9 @@ func (in *ObjectStorageProviderSpec) GetOSSStorage() *OSSStorage { return nil } -func (in *ObjectStorageProviderSpec) GetBlobStorage() *BlobStorage { +func (in *ObjectStorageProviderSpec) GetAZBlobStorage() *AZBlobStorage { if in != nil { - return in.Blob + return in.AZBlob } return nil } @@ -652,7 +652,7 @@ func (in *ObjectStorageProviderSpec) getSetObjectStorageCount() int { if in.GCS != nil { count++ } - if in.Blob != nil { + if in.AZBlob != nil { count++ } return count @@ -797,8 +797,8 @@ func (in *GCSStorage) GetRoot() string { return "" } -// BlobStorage defines the Blob storage specification. -type BlobStorage struct { +// AZBlobStorage defines the Azure Blob storage specification. +type AZBlobStorage struct { // The data will be stored in the container. // +required Container string `json:"container"` @@ -818,14 +818,14 @@ type BlobStorage struct { Endpoint string `json:"endpoint,omitempty"` } -func (in *BlobStorage) GetSecretName() string { +func (in *AZBlobStorage) GetSecretName() string { if in != nil { return in.SecretName } return "" } -func (in *BlobStorage) GetRoot() string { +func (in *AZBlobStorage) GetRoot() string { if in != nil { return in.Root } diff --git a/apis/v1alpha1/validate.go b/apis/v1alpha1/validate.go index fb25119..5aaf9e7 100644 --- a/apis/v1alpha1/validate.go +++ b/apis/v1alpha1/validate.go @@ -98,8 +98,8 @@ func (in *GreptimeDBCluster) Check(ctx context.Context, client client.Client) er } } - if secretName := in.GetObjectStorageProvider().GetBlobStorage().GetSecretName(); secretName != "" { - if err := checkBlobCredentialsSecret(ctx, client, in.GetNamespace(), secretName); err != nil { + if secretName := in.GetObjectStorageProvider().GetAZBlobStorage().GetSecretName(); secretName != "" { + if err := checkAZBlobCredentialsSecret(ctx, client, in.GetNamespace(), secretName); err != nil { return err } } @@ -201,8 +201,8 @@ func (in *GreptimeDBStandalone) Check(ctx context.Context, client client.Client) } } - if secretName := in.GetObjectStorageProvider().GetBlobStorage().GetSecretName(); secretName != "" { - if err := checkBlobCredentialsSecret(ctx, client, in.GetNamespace(), secretName); err != nil { + if secretName := in.GetObjectStorageProvider().GetAZBlobStorage().GetSecretName(); secretName != "" { + if err := checkAZBlobCredentialsSecret(ctx, client, in.GetNamespace(), secretName); err != nil { return err } } @@ -294,7 +294,7 @@ func checkS3CredentialsSecret(ctx context.Context, client client.Client, namespa return checkSecretData(ctx, client, namespace, name, []string{AccessKeyIDSecretKey, SecretAccessKeySecretKey}) } -func checkBlobCredentialsSecret(ctx context.Context, client client.Client, namespace, name string) error { +func checkAZBlobCredentialsSecret(ctx context.Context, client client.Client, namespace, name string) error { return checkSecretData(ctx, client, namespace, name, []string{AccountName, AccountKey}) } diff --git a/apis/v1alpha1/zz_generated.deepcopy.go b/apis/v1alpha1/zz_generated.deepcopy.go index afe5890..f61e560 100644 --- a/apis/v1alpha1/zz_generated.deepcopy.go +++ b/apis/v1alpha1/zz_generated.deepcopy.go @@ -25,16 +25,16 @@ import ( ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BlobStorage) DeepCopyInto(out *BlobStorage) { +func (in *AZBlobStorage) DeepCopyInto(out *AZBlobStorage) { *out = *in } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlobStorage. -func (in *BlobStorage) DeepCopy() *BlobStorage { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AZBlobStorage. +func (in *AZBlobStorage) DeepCopy() *AZBlobStorage { if in == nil { return nil } - out := new(BlobStorage) + out := new(AZBlobStorage) in.DeepCopyInto(out) return out } @@ -895,9 +895,9 @@ func (in *ObjectStorageProviderSpec) DeepCopyInto(out *ObjectStorageProviderSpec *out = new(GCSStorage) **out = **in } - if in.Blob != nil { - in, out := &in.Blob, &out.Blob - *out = new(BlobStorage) + if in.AZBlob != nil { + in, out := &in.AZBlob, &out.AZBlob + *out = new(AZBlobStorage) **out = **in } if in.Cache != nil { diff --git a/config/crd/resources/greptime.io_greptimedbclusters.yaml b/config/crd/resources/greptime.io_greptimedbclusters.yaml index f0cd498..06a804f 100644 --- a/config/crd/resources/greptime.io_greptimedbclusters.yaml +++ b/config/crd/resources/greptime.io_greptimedbclusters.yaml @@ -18318,7 +18318,7 @@ spec: type: integer objectStorage: properties: - blob: + azblob: properties: container: type: string @@ -18542,7 +18542,7 @@ spec: type: integer objectStorage: properties: - blob: + azblob: properties: container: type: string diff --git a/config/crd/resources/greptime.io_greptimedbstandalones.yaml b/config/crd/resources/greptime.io_greptimedbstandalones.yaml index 2a2bde4..b88cd30 100644 --- a/config/crd/resources/greptime.io_greptimedbstandalones.yaml +++ b/config/crd/resources/greptime.io_greptimedbstandalones.yaml @@ -3082,7 +3082,7 @@ spec: type: integer objectStorage: properties: - blob: + azblob: properties: container: type: string diff --git a/docs/api-references/docs.md b/docs/api-references/docs.md index 63ede8b..821e188 100644 --- a/docs/api-references/docs.md +++ b/docs/api-references/docs.md @@ -15,11 +15,11 @@ -#### BlobStorage +#### AZBlobStorage -BlobStorage defines the Blob storage specification. +AZBlobStorage defines the Azure Blob storage specification. @@ -710,10 +710,10 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `s3` _[S3Storage](#s3storage)_ | S3 is the S3 storage configuration. | | | +| `s3` _[S3Storage](#s3storage)_ | S3 is the AWS S3 storage configuration. | | | | `oss` _[OSSStorage](#ossstorage)_ | OSS is the Aliyun OSS storage configuration. | | | -| `gcs` _[GCSStorage](#gcsstorage)_ | GCS is the Google GCS storage configuration. | | | -| `blob` _[BlobStorage](#blobstorage)_ | Blob is the Azure Blob storage configuration. | | | +| `gcs` _[GCSStorage](#gcsstorage)_ | GCS is the Google cloud storage configuration. | | | +| `azblob` _[AZBlobStorage](#azblobstorage)_ | AZBlob is the Azure Blob storage configuration. | | | | `cache` _[CacheStorage](#cachestorage)_ | Cache is the cache storage configuration for object storage. | | | diff --git a/examples/cluster/blob/blob-credentials.yaml b/examples/cluster/azblob/azblob-credentials.yaml similarity index 84% rename from examples/cluster/blob/blob-credentials.yaml rename to examples/cluster/azblob/azblob-credentials.yaml index 1f3bf31..00b7d8e 100644 --- a/examples/cluster/blob/blob-credentials.yaml +++ b/examples/cluster/azblob/azblob-credentials.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret type: Opaque metadata: - name: blob-credentials + name: azblob-credentials stringData: account-name: "your-blob-account-name" account-key: "your-blob-account-key" diff --git a/examples/cluster/blob/cluster.yaml b/examples/cluster/azblob/cluster.yaml similarity index 89% rename from examples/cluster/blob/cluster.yaml rename to examples/cluster/azblob/cluster.yaml index ac4d911..8bf92f2 100644 --- a/examples/cluster/blob/cluster.yaml +++ b/examples/cluster/azblob/cluster.yaml @@ -15,8 +15,8 @@ spec: datanode: replicas: 1 objectStorage: - blob: + azblob: container: "greptimedb" - secretName: "blob-credentials" + secretName: "azblob-credentials" endpoint: "https://.blob.core.windows.net" root: "cluster-with-blob-data" diff --git a/examples/standalone/blob/blob-credentials.yaml b/examples/standalone/azblob/azblob-credentials.yaml similarity index 84% rename from examples/standalone/blob/blob-credentials.yaml rename to examples/standalone/azblob/azblob-credentials.yaml index 1f3bf31..00b7d8e 100644 --- a/examples/standalone/blob/blob-credentials.yaml +++ b/examples/standalone/azblob/azblob-credentials.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret type: Opaque metadata: - name: blob-credentials + name: azblob-credentials stringData: account-name: "your-blob-account-name" account-key: "your-blob-account-key" diff --git a/examples/standalone/blob/standalone.yaml b/examples/standalone/azblob/standalone.yaml similarity index 85% rename from examples/standalone/blob/standalone.yaml rename to examples/standalone/azblob/standalone.yaml index 2743377..554c84e 100644 --- a/examples/standalone/blob/standalone.yaml +++ b/examples/standalone/azblob/standalone.yaml @@ -7,8 +7,8 @@ spec: main: image: greptime/greptimedb:latest objectStorage: - blob: + azblob: container: "greptimedb" - secretName: "blob-credentials" + secretName: "azblob-credentials" endpoint: "https://.blob.core.windows.net" root: "standalone-with-blob" diff --git a/manifests/bundle.yaml b/manifests/bundle.yaml index c40b4bf..189b64e 100644 --- a/manifests/bundle.yaml +++ b/manifests/bundle.yaml @@ -18324,7 +18324,7 @@ spec: type: integer objectStorage: properties: - blob: + azblob: properties: container: type: string @@ -18548,7 +18548,7 @@ spec: type: integer objectStorage: properties: - blob: + azblob: properties: container: type: string @@ -21871,7 +21871,7 @@ spec: type: integer objectStorage: properties: - blob: + azblob: properties: container: type: string diff --git a/manifests/crds.yaml b/manifests/crds.yaml index 58508a3..ca24ee6 100644 --- a/manifests/crds.yaml +++ b/manifests/crds.yaml @@ -18317,7 +18317,7 @@ spec: type: integer objectStorage: properties: - blob: + azblob: properties: container: type: string @@ -18541,7 +18541,7 @@ spec: type: integer objectStorage: properties: - blob: + azblob: properties: container: type: string @@ -21864,7 +21864,7 @@ spec: type: integer objectStorage: properties: - blob: + azblob: properties: container: type: string diff --git a/pkg/dbconfig/common.go b/pkg/dbconfig/common.go index e7272e9..d373d59 100644 --- a/pkg/dbconfig/common.go +++ b/pkg/dbconfig/common.go @@ -59,8 +59,8 @@ func (c *StorageConfig) ConfigureObjectStorage(namespace string, accessor v1alph if err := c.configureGCS(namespace, gcs); err != nil { return err } - } else if blob := accessor.GetBlobStorage(); blob != nil { - if err := c.configureBlob(namespace, blob); err != nil { + } else if blob := accessor.GetAZBlobStorage(); blob != nil { + if err := c.configureAZBlob(namespace, blob); err != nil { return err } } @@ -140,18 +140,18 @@ func (c *StorageConfig) configureGCS(namespace string, gcs *v1alpha1.GCSStorage) return nil } -func (c *StorageConfig) configureBlob(namespace string, blob *v1alpha1.BlobStorage) error { - if blob == nil { +func (c *StorageConfig) configureAZBlob(namespace string, azblob *v1alpha1.AZBlobStorage) error { + if azblob == nil { return nil } c.StorageType = pointer.String("Azblob") - c.Container = pointer.String(blob.Container) - c.StorageRoot = pointer.String(blob.Root) - c.StorageEndpoint = pointer.String(blob.Endpoint) + c.Container = pointer.String(azblob.Container) + c.StorageRoot = pointer.String(azblob.Root) + c.StorageEndpoint = pointer.String(azblob.Endpoint) - if blob.SecretName != "" { - data, err := k8sutil.GetSecretsData(namespace, blob.SecretName, []string{v1alpha1.AccountName, v1alpha1.AccountKey}) + if azblob.SecretName != "" { + data, err := k8sutil.GetSecretsData(namespace, azblob.SecretName, []string{v1alpha1.AccountName, v1alpha1.AccountKey}) if err != nil { return err }