cleanup: don't return an internal type from VolumeGroupJournal.Connect()

The VolumeGroupJournal interface does not need to return anything except
for a potential error. Any instance that implements the
VolumeGroupJournal interface can be used to call all functions.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos 2024-03-12 18:01:47 +01:00 committed by mergify[bot]
parent 9276aeb7fc
commit 32de26828f

View File

@ -36,7 +36,7 @@ type VolumeGroupJournal interface {
Connect( Connect(
monitors, monitors,
namespace string, namespace string,
cr *util.Credentials) (*volumeGroupJournalConfig, error) cr *util.Credentials) error
// Destroy frees any resources and invalidates the journal connection. // Destroy frees any resources and invalidates the journal connection.
Destroy() Destroy()
// SetNamespace sets the namespace for the journal. // SetNamespace sets the namespace for the journal.
@ -115,14 +115,14 @@ func (sgj *volumeGroupJournalConfig) Connect(
monitors, monitors,
namespace string, namespace string,
cr *util.Credentials, cr *util.Credentials,
) (*volumeGroupJournalConfig, error) { ) error {
conn, err := sgj.Config.Connect(monitors, namespace, cr) conn, err := sgj.Config.Connect(monitors, namespace, cr)
if err != nil { if err != nil {
return nil, err return err
} }
sgj.Connection = conn sgj.Connection = conn
return sgj, nil return nil
} }
func (sgj *volumeGroupJournalConfig) Destroy() { func (sgj *volumeGroupJournalConfig) Destroy() {