mtu can be set via command line

added also a test for this

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2023-10-06 11:52:56 +02:00
committed by Jonathon Anderson
parent 4cf230cadd
commit a7056e2bb8
3 changed files with 26 additions and 1 deletions

View File

@@ -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

View File

@@ -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 {

View File

@@ -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
}