File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,15 @@ func (s *ClusterScope) NetworkName() string {
131
131
return ptr .Deref (s .GCPCluster .Spec .Network .Name , "default" )
132
132
}
133
133
134
+ // NetworkMtu returns the Network MTU of 1440 which is the default, otherwise returns back what is being set.
135
+ // https://cloud.google.com/vpc/docs/mtu
136
+ func (s * ClusterScope ) NetworkMtu () int64 {
137
+ if s .GCPCluster .Spec .Network .Mtu == 0 {
138
+ return int64 (1440 )
139
+ }
140
+ return s .GCPCluster .Spec .Network .Mtu
141
+ }
142
+
134
143
// NetworkLink returns the partial URL for the network.
135
144
func (s * ClusterScope ) NetworkLink () string {
136
145
return fmt .Sprintf ("projects/%s/global/networks/%s" , s .NetworkProject (), s .NetworkName ())
@@ -206,6 +215,7 @@ func (s *ClusterScope) NetworkSpec() *compute.Network {
206
215
Description : infrav1 .ClusterTagKey (s .Name ()),
207
216
AutoCreateSubnetworks : createSubnet ,
208
217
ForceSendFields : []string {"AutoCreateSubnetworks" },
218
+ Mtu : s .NetworkMtu (),
209
219
}
210
220
211
221
return network
You can’t perform that action at this time.
0 commit comments