mirror of
https://github.com/siderolabs/talos.git
synced 2026-05-05 12:26:21 +02:00
feat: set default mtu for gce platform
This PR is needed so that the eth0 device will have the proper mtu when coming online in google cloud Signed-off-by: Spencer Smith <robertspencersmith@gmail.com>
This commit is contained in:
parent
4a31b66850
commit
c9f0dbbd4c
@ -5,6 +5,7 @@
|
||||
package googlecloud
|
||||
|
||||
import (
|
||||
"github.com/talos-systems/talos/internal/pkg/network"
|
||||
"github.com/talos-systems/talos/pkg/userdata"
|
||||
)
|
||||
|
||||
@ -23,7 +24,26 @@ func (gc *GoogleCloud) Name() string {
|
||||
|
||||
// UserData implements the platform.Platform interface.
|
||||
func (gc *GoogleCloud) UserData() (data *userdata.UserData, err error) {
|
||||
return userdata.Download(GCUserDataEndpoint, userdata.WithHeaders(map[string]string{"Metadata-Flavor": "Google"}))
|
||||
ud, err := userdata.Download(GCUserDataEndpoint, userdata.WithHeaders(map[string]string{"Metadata-Flavor": "Google"}))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if ud.Networking == nil {
|
||||
ud.Networking = &userdata.Networking{
|
||||
OS: &userdata.OSNet{
|
||||
Devices: []userdata.Device{
|
||||
{
|
||||
Interface: network.DefaultInterface,
|
||||
DHCP: true,
|
||||
MTU: 1460,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
return ud, nil
|
||||
}
|
||||
|
||||
// Prepare implements the platform.Platform interface and handles initial host preparation.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user