diff --git a/pkg/bastion/shell.go b/pkg/bastion/shell.go index 4b9bedca..2569232b 100644 --- a/pkg/bastion/shell.go +++ b/pkg/bastion/shell.go @@ -901,7 +901,7 @@ GLOBAL OPTIONS: var hop string if host.HopID != 0 { var hopHost dbmodels.Host - if err := db.Model(host).Association("HopID").Find(&hopHost); err != nil { + if err := db.Model(host).Association("Hop").Find(&hopHost); err != nil { return err } hop = hopHost.Name @@ -1037,7 +1037,7 @@ GLOBAL OPTIONS: if c.Bool("unset-hop") { var hopHost dbmodels.Host - if err := db.Model(&host).Association("HopID").Find(&hopHost); err != nil { + if err := db.Model(&host).Association("Hop").Find(&hopHost); err != nil { return err } if err := model.Association("Hop").Clear(); err != nil { diff --git a/pkg/bastion/ssh.go b/pkg/bastion/ssh.go index 8a52631c..fc8e4acd 100644 --- a/pkg/bastion/ssh.go +++ b/pkg/bastion/ssh.go @@ -144,7 +144,7 @@ func ChannelHandler(srv *ssh.Server, conn *gossh.ServerConn, newChan gossh.NewCh }}, sessionConfigs...) if currentHost.HopID != 0 { var newHost dbmodels.Host - if err := actx.db.Model(currentHost).Association("HopID").Find(&newHost); err != nil { + if err := actx.db.Model(currentHost).Association("Hop").Find(&newHost); err != nil { log.Printf("Error: %v", err) return }