Merge branch '15370-loopback-dispatchcloud'
[arvados.git] / lib / dispatchcloud / worker / verify.go
index c718702101bdcf08502c252f3c59e7d88eeb6735..559bb28973d27fc81662a262a00cefe5e020627c 100644 (file)
@@ -9,7 +9,7 @@ import (
        "errors"
        "fmt"
 
-       "git.curoverse.com/arvados.git/lib/cloud"
+       "git.arvados.org/arvados.git/lib/cloud"
        "golang.org/x/crypto/ssh"
 )
 
@@ -23,7 +23,8 @@ var (
 
 type TagVerifier struct {
        cloud.Instance
-       Secret string
+       Secret         string
+       ReportVerified func(cloud.Instance)
 }
 
 func (tv TagVerifier) InitCommand() cloud.InitCommand {
@@ -31,6 +32,9 @@ func (tv TagVerifier) InitCommand() cloud.InitCommand {
 }
 
 func (tv TagVerifier) VerifyHostKey(pubKey ssh.PublicKey, client *ssh.Client) error {
+       if tv.ReportVerified != nil {
+               tv.ReportVerified(tv.Instance)
+       }
        if err := tv.Instance.VerifyHostKey(pubKey, client); err != cloud.ErrNotImplemented || tv.Secret == "" {
                // If the wrapped instance indicates it has a way to
                // verify the key, return that decision.