forked from TrueCloudLab/frostfs-node
[#979] adm/subnet: Always set group ID parameter in client cmds
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
3550ed9fe4
commit
3fcd7bc948
1 changed files with 13 additions and 16 deletions
|
@ -585,25 +585,22 @@ func manageSubnetClients(cmd *cobra.Command, rm bool) error {
|
||||||
return fmt.Errorf("marshal client ID: %w", err)
|
return fmt.Errorf("marshal client ID: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var prm morphsubnet.ManageClientsPrm
|
// read group ID and encode it
|
||||||
|
var groupID internal.SubnetClientGroupID
|
||||||
|
|
||||||
if viper.GetBool(flagSubnetAdminClient) {
|
err = groupID.UnmarshalText([]byte(viper.GetString(flagSubnetAdminAddGroup)))
|
||||||
// read group ID and encode it
|
if err != nil {
|
||||||
var groupID internal.SubnetClientGroupID
|
return fmt.Errorf("decode group ID text: %w", err)
|
||||||
|
|
||||||
err = groupID.UnmarshalText([]byte(viper.GetString(flagSubnetAdminAddGroup)))
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("decode group ID text: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
binGroupID, err := groupID.Marshal()
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("marshal group ID: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
prm.SetGroup(binGroupID)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binGroupID, err := groupID.Marshal()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("marshal group ID: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var prm morphsubnet.ManageClientsPrm
|
||||||
|
|
||||||
|
prm.SetGroup(binGroupID)
|
||||||
prm.SetSubnet(binID)
|
prm.SetSubnet(binID)
|
||||||
prm.SetClient(binClientID)
|
prm.SetClient(binClientID)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue