Skip to content

Commit

Permalink
Fix S3 Region not recognised (rilldata#1583)
Browse files Browse the repository at this point in the history
* changing aws.region to region

* fixing ci
  • Loading branch information
rakeshsharma14317 authored Jan 10, 2023
1 parent 7c9de8c commit c30a094
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion runtime/compilers/rillv1beta/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (c *Codec) PutSource(ctx context.Context, repo drivers.RepoStore, instanceI
out.Path = val
}

if val, ok := props["aws.region"].(string); ok {
if val, ok := props["region"].(string); ok {
out.Region = val
}

Expand Down
4 changes: 2 additions & 2 deletions runtime/connectors/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var spec = connectors.Spec{
Hint: "Note that glob patterns aren't yet supported",
},
{
Key: "aws.region",
Key: "region",
DisplayName: "AWS region",
Description: "AWS Region for the bucket.",
Placeholder: "us-east-1",
Expand All @@ -54,7 +54,7 @@ var spec = connectors.Spec{

type Config struct {
Path string `mapstructure:"path"`
AWSRegion string `mapstructure:"aws.region"`
AWSRegion string `mapstructure:"region"`
}

func ParseConfig(props map[string]any) (*Config, error) {
Expand Down
4 changes: 2 additions & 2 deletions runtime/services/catalog/artifacts/artifacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ csv.delimiter: '|'
Name: "S3Source",
Connector: "s3",
Properties: toProtoStruct(map[string]any{
"path": "s3://bucket/path/file.csv",
"aws.region": "us-east-2",
"path": "s3://bucket/path/file.csv",
"region": "us-east-2",
}),
},
},
Expand Down
4 changes: 2 additions & 2 deletions runtime/services/catalog/artifacts/yaml/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Source struct {
Path string `yaml:"path,omitempty"`
CsvDelimiter string `yaml:"csv.delimiter,omitempty" mapstructure:"csv.delimiter,omitempty"`
URI string `yaml:"uri,omitempty"`
Region string `yaml:"region,omitempty" mapstructure:"aws.region,omitempty"`
Region string `yaml:"region,omitempty" mapstructure:"region,omitempty"`
}

type MetricsView struct {
Expand Down Expand Up @@ -87,7 +87,7 @@ func fromSourceArtifact(source *Source, path string) (*drivers.CatalogEntry, err
props["path"] = source.URI
}
if source.Region != "" {
props["aws.region"] = source.Region
props["region"] = source.Region
}
if source.CsvDelimiter != "" {
props["csv.delimiter"] = source.CsvDelimiter
Expand Down

0 comments on commit c30a094

Please sign in to comment.