Skip to content

Commit

Permalink
fix minor problems
Browse files Browse the repository at this point in the history
fix storage type with s3

remove unnecessary variable
  • Loading branch information
ryo ariyama committed Feb 3, 2023
1 parent fe6f8bf commit 02030bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ protected void uploadEnvironmentFileToTemporalStorage(
final TemporalProjectArchiveStorage temporalStorage = createTemporalProjectArchiveStorage(taskConfig); // config exception
try {
temporalStorage.uploadFile(envFileKey, envFilePath); // IOException
String temporalBucket = temporalStorage.getBucketName(systemConfig);
String temporalBucket = temporalStorage.getS3BucketName(systemConfig);
final String temporalStorageS3ARN = createS3BucketARN(temporalBucket, envFileKey);
environmentFile.setValue(temporalStorageS3ARN);
environmentFile.setType("s3");
Expand Down Expand Up @@ -887,12 +887,12 @@ private static String createStorageKey(final TaskRequest request, final String l
.toString();
}

private static String createS3BucketARN(final String Bucket, final String fileKey)
private static String createS3BucketARN(final String bucket, final String fileKey)
{
// S3 File ARN: "arn:aws:s3::{torage_bucket}/{env_file}"
// S3 File ARN: "arn:aws:s3::{storage_bucket}/{env_file}"
return new StringBuilder()
.append("arn:aws:s3:::")
.append(Bucket)
.append(bucket)
.append("/")
.append(fileKey)
.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ public InputStream getContentInputStream(final String key)
}
}

public String getBucketName(final Config systemConfig)
public String getS3BucketName(final Config systemConfig)
{
String type = systemConfig.get(PARAMS_PREFIX + "type", String.class);
String bucket = systemConfig.get(PARAMS_PREFIX + type + ".bucket", String.class);
String bucket = systemConfig.get(PARAMS_PREFIX + "s3.bucket", String.class);
return bucket;
}
}

0 comments on commit 02030bd

Please sign in to comment.