diff --git a/agent/command/s3_get.go b/agent/command/s3_get.go index 5eff58974d..8314dfd7f0 100644 --- a/agent/command/s3_get.go +++ b/agent/command/s3_get.go @@ -43,6 +43,9 @@ type s3get struct { // RemoteFile is the file path of the file to get, within its bucket. RemoteFile string `mapstructure:"remote_file" plugin:"expand"` + // remoteFile is the file path without any expansions applied. + remoteFile string + // Region is the S3 region where the bucket is located. It defaults to // "us-east-1". Region string `mapstructure:"region" plugin:"region"` @@ -144,6 +147,8 @@ func (c *s3get) shouldRunForVariant(buildVariantName string) bool { // Apply the expansions from the relevant task config // to all appropriate fields of the s3get. func (c *s3get) expandParams(conf *internal.TaskConfig) error { + c.remoteFile = c.RemoteFile + var err error if err = util.ExpandValues(c, &conf.Expansions); err != nil { return errors.Wrap(err, "applying expansions") @@ -175,7 +180,7 @@ func (c *s3get) Execute(ctx context.Context, trace.SpanFromContext(ctx).SetAttributes( attribute.String(s3GetBucketAttribute, c.Bucket), attribute.Bool(s3GetTemporaryCredentialsAttribute, c.AwsSessionToken != ""), - attribute.String(s3GetRemoteFileAttribute, c.RemoteFile), + attribute.String(s3GetRemoteFileAttribute, c.remoteFile), ) // create pail bucket