@@ -48,11 +48,16 @@ type databaseComponentFactory interface {
48
48
setup (ctx * pulumi.Context , args factoryArgs , options ... pulumi.ResourceOption ) (databaseComponent , error )
49
49
}
50
50
51
+ type Service struct {
52
+ Annotations pulumix.Input [map [string ]string ]
53
+ }
54
+
51
55
type Args struct {
52
56
Postgres * PostgresDatabaseArgs
53
57
RDS * RDSDatabaseArgs
54
58
ConnectivityDatabaseArgs ConnectivityDatabaseArgs
55
- DisableUpgrade pulumix.Output [bool ]
59
+ DisableUpgrade pulumix.Input [bool ]
60
+ Service Service
56
61
}
57
62
58
63
func (args * Args ) SetDefaults () {
@@ -109,8 +114,9 @@ func (cmp *Component) GetEnvVars() corev1.EnvVarArray {
109
114
},
110
115
corev1.EnvVarArgs {
111
116
Name : pulumi .String ("POSTGRES_URI" ),
112
- Value : pulumi .Sprintf ("postgres://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@%s:%d/%s?%s" ,
113
- cmp .DatabaseComponent .GetEndpoint (),
117
+ Value : pulumi .Sprintf ("postgres://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@%s.%s.svc.cluster.local:%d/%s?%s" ,
118
+ cmp .Service .Metadata .Name ().Elem (),
119
+ cmp .Service .Metadata .Namespace ().Elem (),
114
120
cmp .DatabaseComponent .GetPort (),
115
121
cmp .DatabaseComponent .GetDatabase (),
116
122
pulumix .Apply2 (
@@ -280,7 +286,6 @@ func NewComponent(ctx *pulumi.Context, name string, args ComponentArgs, options
280
286
"username" : cmp .DatabaseComponent .GetUsername ().ToOutput (ctx .Context ()).Untyped ().(pulumi.StringOutput ),
281
287
"password" : pulumix .Apply (cmp .DatabaseComponent .GetPassword (), func (password string ) string {
282
288
return url .QueryEscape (password )
283
- //cmp.DatabaseComponent.GetPassword().ToOutput(ctx.Context()).Untyped().(pulumi.StringOutput)
284
289
}).Untyped ().(pulumi.StringOutput ),
285
290
},
286
291
}, pulumi .Parent (cmp ))
@@ -297,6 +302,9 @@ func NewComponent(ctx *pulumi.Context, name string, args ComponentArgs, options
297
302
Namespace : args .CommonArgs .Namespace .
298
303
ToOutput (ctx .Context ()).
299
304
Untyped ().(pulumi.StringOutput ),
305
+ Annotations : args .Service .Annotations .
306
+ ToOutput (ctx .Context ()).
307
+ Untyped ().(pulumi.StringMapOutput ),
300
308
},
301
309
Spec : & corev1.ServiceSpecArgs {
302
310
Type : pulumi .String ("ExternalName" ),
@@ -311,7 +319,7 @@ func NewComponent(ctx *pulumi.Context, name string, args ComponentArgs, options
311
319
}
312
320
}
313
321
314
- args .DisableUpgrade .ApplyT (func (disableUpgrade bool ) error {
322
+ args .DisableUpgrade .ToOutput ( ctx . Context ()). ApplyT (func (disableUpgrade bool ) error {
315
323
if disableUpgrade {
316
324
return nil
317
325
}
0 commit comments