Skip to content

Commit

Permalink
Revert "init: fix S3 ARN parsing #617"
Browse files Browse the repository at this point in the history
This reverts commit 35f563b.
  • Loading branch information
Claych committed Apr 6, 2023
1 parent 42fa117 commit 760bfed
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions init/fluent_bit_init_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,17 @@ func processConfigFile(path string) {
}
}

func getS3ConfigFile(userInput string) string {
func getS3ConfigFile(arn string) string {
// Preparation for downloading S3 config files
if !s3ClientCreated {
createS3Client()
}

// e.g. "arn:aws:s3:::user-bucket/s3_parser.conf"
s3ARN, err := arn.Parse(userInput)
if err != nil {
logrus.Fatalf("[FluentBit Init Process] Could not parse arn: %s\n", userInput)
}
bucketAndFile := strings.SplitN(s3ARN.Resource, "/", 2)
arnBucketFile := arn[13:]
bucketAndFile := strings.SplitN(arnBucketFile, "/", 2)
if len(bucketAndFile) != 2 {
logrus.Fatalf("[FluentBit Init Process] Could not parse arn: %s\n", userInput)
logrus.Fatalf("[FluentBit Init Process] Unrecognizable arn: %s\n", arn)
}

bucketName := bucketAndFile[0]
Expand Down

0 comments on commit 760bfed

Please sign in to comment.