Skip to content

Commit

Permalink
Fix error about marshal yaml (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
rujche authored Nov 15, 2024
1 parent 2e14836 commit 3b33dc6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions cli/azd/pkg/project/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,41 @@ func (r *ResourceConfig) MarshalYAML() (interface{}, error) {
if err != nil {
return nil, err
}
case ResourceTypeDbPostgres:
err := marshalRawProps(raw.Props.(PostgresProps))
if err != nil {
return nil, err
}
case ResourceTypeDbMySQL:
err := marshalRawProps(raw.Props.(MySQLProps))
if err != nil {
return nil, err
}
case ResourceTypeDbMongo:
err := marshalRawProps(raw.Props.(MongoDBProps))
if err != nil {
return nil, err
}
case ResourceTypeDbCosmos:
err := marshalRawProps(raw.Props.(CosmosDBProps))
if err != nil {
return nil, err
}
case ResourceTypeMessagingServiceBus:
err := marshalRawProps(raw.Props.(ServiceBusProps))
if err != nil {
return nil, err
}
case ResourceTypeMessagingEventHubs:
err := marshalRawProps(raw.Props.(EventHubsProps))
if err != nil {
return nil, err
}
case ResourceTypeMessagingKafka:
err := marshalRawProps(raw.Props.(KafkaProps))
if err != nil {
return nil, err
}
}

return raw, nil
Expand Down
2 changes: 1 addition & 1 deletion cli/azd/pkg/project/scaffold_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func infraSpec(projectConfig *ProjectConfig) (*scaffold.InfraSpec, error) {
infraSpec.DbRedis = &scaffold.DatabaseRedis{}
case ResourceTypeDbMongo:
infraSpec.DbCosmosMongo = &scaffold.DatabaseCosmosMongo{
DatabaseName: res.Props.(CosmosDBProps).DatabaseName,
DatabaseName: res.Props.(MongoDBProps).DatabaseName,
}
case ResourceTypeDbPostgres:
infraSpec.DbPostgres = &scaffold.DatabasePostgres{
Expand Down

0 comments on commit 3b33dc6

Please sign in to comment.