File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 77 . WaitFor ( redis ) ;
88
99var redisHost = redis . Resource . PrimaryEndpoint . Property ( EndpointProperty . Host ) ;
10- var redisTargetPort = redis . Resource . PrimaryEndpoint . Property ( EndpointProperty . TargetPort ) ;
10+ var redisPort = redis . Resource . PrimaryEndpoint . Property ( EndpointProperty . Port ) ;
1111
1212var pubSub = builder
1313 . AddDaprPubSub ( "pubsub" )
1414 . WithMetadata (
1515 "redisHost" ,
1616 ReferenceExpression . Create (
17- $ "{ redisHost } :{ redisTargetPort } "
17+ $ "{ redisHost } :{ redisPort } "
1818 )
1919 )
2020 . WaitFor ( redis ) ;
2121
22+ if ( redis . Resource . PasswordParameter is not null )
23+ {
24+ pubSub . WithMetadata ( "redisPassword" , redis . Resource . PasswordParameter ) ;
25+ }
26+
2227builder . AddProject < Projects . CommunityToolkit_Aspire_Hosting_Dapr_ServiceA > ( "servicea" )
2328 . WithDaprSidecar ( sidecar =>
2429 {
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ public async Task BeforeStartAsync(DistributedApplicationModel appModel, Cancell
7474
7575 var aggregateResourcesPaths = sidecarOptions ? . ResourcesPaths . Select ( path => NormalizePath ( path ) ) . ToHashSet ( ) ?? [ ] ;
7676
77- var componentReferenceAnnotations = resource . Annotations . OfType < DaprComponentReferenceAnnotation > ( ) ;
77+ var componentReferenceAnnotations = daprSidecar . Annotations . OfType < DaprComponentReferenceAnnotation > ( ) ;
7878
7979 var secrets = new Dictionary < string , string > ( ) ;
8080 var endpointEnvironmentVars = new Dictionary < string , IValueProvider > ( ) ;
You can’t perform that action at this time.
0 commit comments