Skip to content

Commit cb86071

Browse files
anjannathadrianriobo
authored andcommitted
Add helper GetHostIP for aws compute module
we use this in the openshift-snc action where we use nip.io based domain for the ocp web console and it requires the IP address instead of domain name to resolve to the correct IP
1 parent 6569700 commit cb86071

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pkg/provider/aws/action/openshift-snc/openshift-snc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ func (r *openshiftSNCRequest) deploy(ctx *pulumi.Context) error {
253253
ctx.Export(fmt.Sprintf("%s-%s", *r.prefix, outputUsername),
254254
pulumi.String(amiUserDefault))
255255
ctx.Export(fmt.Sprintf("%s-%s", *r.prefix, outputHost),
256-
c.GetHostDnsName(true))
256+
c.GetHostIP(true))
257257
if len(*r.timeout) > 0 {
258258
if err = serverless.OneTimeDelayedTask(ctx, r.mCtx,
259259
*r.allocationData.Region, *r.prefix,

pkg/provider/aws/modules/ec2/compute/compute.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ func (c *Compute) GetHostDnsName(public bool) (ip pulumi.StringInput) {
270270
return util.If(public, c.Eip.PublicDns, c.Eip.PrivateDns)
271271
}
272272

273+
func (c *Compute) GetHostIP(public bool) (ip pulumi.StringOutput) {
274+
return util.If(public, c.Eip.PublicIp, c.Eip.PrivateIp)
275+
}
276+
273277
// Check if compute is healthy based on running a remote cmd
274278
func (compute *Compute) Readiness(ctx *pulumi.Context,
275279
cmd string,

0 commit comments

Comments
 (0)