// if (resp) {
if (!resp.exist) {
minio::s3::MakeBucketArgs args2;
args2.bucket = "para_dm";
minio::s3::MakeBucketResponse resp = client.MakeBucket(args2);
std::cout << std::endl;
}
// }
// else {
// std::cout << "unable to do bucket existence check; "
// << resp.Error().String() << std::endl;
// }
}
run env:
windows
error: bucket name does not follow S3 standards strictly
the utils.cc code:
static const std::regex BUCKET_NAME_REGEX(
"^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$");
static const std::regex OLD_BUCKET_NAMEREGEX(
"^[a-z0-9][a-z0-9\.\-\:]{1,61}[a-z0-9]$", std::regex_constants::icase);
if (strict) {
if (!std::regex_match(bucket_name.data(), BUCKET_NAME_REGEX)) {
return error::Error("bucket name does not follow S3 standards strictly");
}
} else if (!std::regex_match(bucket_name.data(), OLD_BUCKET_NAME_REGEX)) {
return error::Error("bucket name does not follow S3 standards");
}
code: minio::s3::BucketExistsArgs args; args.bucket = "para_dm";
// if (resp) { if (!resp.exist) { minio::s3::MakeBucketArgs args2; args2.bucket = "para_dm"; minio::s3::MakeBucketResponse resp = client.MakeBucket(args2); std::cout << std::endl; } // } // else { // std::cout << "unable to do bucket existence check; " // << resp.Error().String() << std::endl; // } }
run env: windows
error: bucket name does not follow S3 standards strictly
the utils.cc code: static const std::regex BUCKET_NAME_REGEX( "^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$"); static const std::regex OLD_BUCKET_NAMEREGEX( "^[a-z0-9][a-z0-9\.\-\:]{1,61}[a-z0-9]$", std::regex_constants::icase); if (strict) { if (!std::regex_match(bucket_name.data(), BUCKET_NAME_REGEX)) { return error::Error("bucket name does not follow S3 standards strictly"); } } else if (!std::regex_match(bucket_name.data(), OLD_BUCKET_NAME_REGEX)) { return error::Error("bucket name does not follow S3 standards"); }
why here need "!" ?