File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,15 @@ func (b *AutoscalingGroupModelBuilder) buildInstanceTemplate(c *fi.CloudupModelB
8484 if err != nil {
8585 return nil , err
8686 }
87+
88+ HasExternalIP := fi .PtrTo (false )
89+ if subnet .Type == kops .SubnetTypePublic || subnet .Type == kops .SubnetTypeUtility || ig .IsBastion () {
90+ HasExternalIP = fi .PtrTo (true )
91+ }
92+ if ig .Spec .AssociatePublicIP != nil {
93+ HasExternalIP = ig .Spec .AssociatePublicIP
94+ }
95+
8796 t := & gcetasks.InstanceTemplate {
8897 Name : s (name ),
8998 NamePrefix : s (namePrefix ),
@@ -97,7 +106,7 @@ func (b *AutoscalingGroupModelBuilder) buildInstanceTemplate(c *fi.CloudupModelB
97106 Preemptible : fi .PtrTo (fi .ValueOf (ig .Spec .GCPProvisioningModel ) == "SPOT" ),
98107 GCPProvisioningModel : ig .Spec .GCPProvisioningModel ,
99108
100- HasExternalIP : fi . PtrTo ( subnet . Type == kops . SubnetTypePublic || subnet . Type == kops . SubnetTypeUtility || ig . IsBastion ()) ,
109+ HasExternalIP : HasExternalIP ,
101110
102111 Scopes : []string {
103112 "compute-rw" ,
You can’t perform that action at this time.
0 commit comments