From 760bfed37ebc1e3ed0fe7c03a36e0a2c774c0656 Mon Sep 17 00:00:00 2001 From: Clay Cheng Date: Thu, 6 Apr 2023 20:44:12 +0000 Subject: [PATCH] Revert "init: fix S3 ARN parsing #617" This reverts commit 35f563bda396efda1d7b2b0cd3460c17e784bdff. --- init/fluent_bit_init_process.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/init/fluent_bit_init_process.go b/init/fluent_bit_init_process.go index b65161d41..afff69863 100644 --- a/init/fluent_bit_init_process.go +++ b/init/fluent_bit_init_process.go @@ -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]