Merge pull request #948 from mslacken/SetMtu
mtu can be set via command line
This commit is contained in:
@@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Container file gids are now updated properly during syncuser. #840
|
||||
- Fix build for API.
|
||||
- Bindd mounts for `wwctl exec` are now on the same fs
|
||||
- Fixed the ability to set MTU with wwctl #947
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
@@ -347,6 +347,30 @@ nodes:
|
||||
/dev/disk/by-partlabel/var:
|
||||
format: btrfs
|
||||
path: /var
|
||||
`},
|
||||
{name: "single node set mtu",
|
||||
args: []string{"--mtu", "1234", "--netname=mynet", "n01"},
|
||||
wantErr: false,
|
||||
stdout: "",
|
||||
inDB: `WW_INTERNAL: 43
|
||||
nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
- default`,
|
||||
outDb: `WW_INTERNAL: 43
|
||||
nodeprofiles:
|
||||
default:
|
||||
comment: testit
|
||||
nodes:
|
||||
n01:
|
||||
profiles:
|
||||
- default
|
||||
network devices:
|
||||
mynet:
|
||||
mtu: "1234"
|
||||
`},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
|
||||
@@ -69,7 +69,7 @@ func createFlags(baseCmd *cobra.Command, excludeList []string,
|
||||
case "uint":
|
||||
converters = append(converters, func() error {
|
||||
if !util.InSlice(GetUnsetVerbs(), *ptr) && *ptr != "" {
|
||||
_, err := strconv.ParseUint(myType.Tag.Get(*ptr), 10, 32)
|
||||
_, err := strconv.ParseUint(*ptr, 10, 32)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user