diff --git a/cmd/frostfs-adm/internal/modules/morph/subnet.go b/cmd/frostfs-adm/internal/modules/morph/subnet.go index f289400ab4..95fa9e350b 100644 --- a/cmd/frostfs-adm/internal/modules/morph/subnet.go +++ b/cmd/frostfs-adm/internal/modules/morph/subnet.go @@ -307,8 +307,6 @@ const ( ) // common executor cmdSubnetAdminAdd and cmdSubnetAdminRemove commands. -// -// nolint: funlen func manageSubnetAdmins(cmd *cobra.Command, rm bool) error { // read private key var key keys.PrivateKey @@ -341,17 +339,19 @@ func manageSubnetAdmins(cmd *cobra.Command, rm bool) error { return fmt.Errorf("admin key format: %w", err) } - // prepare call parameters + return invokeMethodWithParams(cmd, id, rm, binAdminKey, key) +} + +func invokeMethodWithParams(cmd *cobra.Command, id subnetid.ID, rm bool, binAdminKey []byte, key keys.PrivateKey) error { prm := make([]any, 0, 3) prm = append(prm, id.Marshal()) var method string if viper.GetBool(flagSubnetAdminClient) { - // read group ID and encode it var groupID internal.SubnetClientGroupID - err = groupID.UnmarshalText([]byte(viper.GetString(flagSubnetAdminAddGroup))) + err := groupID.UnmarshalText([]byte(viper.GetString(flagSubnetAdminAddGroup))) if err != nil { return fmt.Errorf("decode group ID text: %w", err) } @@ -378,7 +378,7 @@ func manageSubnetAdmins(cmd *cobra.Command, rm bool) error { prm = append(prm, binAdminKey) - err = invokeMethod(key, false, method, prm...) + err := invokeMethod(key, false, method, prm...) if err != nil { return fmt.Errorf("morph invocation: %w", err) }