diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d3ca8d2..05fd94ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/internal/app/wwctl/node/set/main_test.go b/internal/app/wwctl/node/set/main_test.go index 0a386b4a..188c465c 100644 --- a/internal/app/wwctl/node/set/main_test.go +++ b/internal/app/wwctl/node/set/main_test.go @@ -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 { diff --git a/internal/pkg/node/flags.go b/internal/pkg/node/flags.go index 2b5488d5..c9db4152 100644 --- a/internal/pkg/node/flags.go +++ b/internal/pkg/node/flags.go @@ -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 }