Merge pull request #11284 from zexi/glance-s3-image-check-status

fix(glance): add option of s3 image status check
This commit is contained in:
Zexi Li
2021-06-02 11:17:55 +08:00
committed by GitHub
2 changed files with 9 additions and 7 deletions
+2 -1
View File
@@ -24,6 +24,7 @@ import (
"yunion.io/x/onecloud/pkg/apis/image"
"yunion.io/x/onecloud/pkg/image/drivers/s3"
"yunion.io/x/onecloud/pkg/image/options"
"yunion.io/x/onecloud/pkg/util/procutils"
)
@@ -159,7 +160,7 @@ func (s *S3Storage) GetImage(imagePath string) (int64, io.ReadCloser, error) {
}
func (s *S3Storage) IsCheckStatusEnabled() bool {
return false
return options.Options.S3CheckImageStatus
}
func (s *S3Storage) RemoveImage(fileName string) error {
+7 -6
View File
@@ -44,12 +44,13 @@ type SImageOptions struct {
StorageDriver string `help:"image backend storage" default:"local" choices:"s3|local"`
S3AccessKey string `help:"s3 access key"`
S3SecretKey string `help:"s3 secret key"`
S3Endpoint string `help:"s3 endpoint"`
S3UseSSL bool `help:"s3 access use ssl"`
S3BucketName string `help:"s3 bucket name" default:"onecloud-images"`
S3MountPoint string `help:"s3fs mount point" default:"/opt/cloud/workspace/data/glance/s3images"`
S3AccessKey string `help:"s3 access key"`
S3SecretKey string `help:"s3 secret key"`
S3Endpoint string `help:"s3 endpoint"`
S3UseSSL bool `help:"s3 access use ssl"`
S3BucketName string `help:"s3 bucket name" default:"onecloud-images"`
S3MountPoint string `help:"s3fs mount point" default:"/opt/cloud/workspace/data/glance/s3images"`
S3CheckImageStatus bool `help:"Enable s3 check image status"`
}
var (