From 351505f3a2b2b4460a4214097d63f53ab00ec42f Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Fri, 31 Aug 2018 16:15:55 -0400 Subject: [PATCH] 13964: Fix string pointer capture Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- lib/dispatchcloud/azure.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/dispatchcloud/azure.go b/lib/dispatchcloud/azure.go index 28efe4f5c9..6cc4e9908d 100644 --- a/lib/dispatchcloud/azure.go +++ b/lib/dispatchcloud/azure.go @@ -264,7 +264,8 @@ func (az *AzureProvider) Create(ctx context.Context, tags := make(map[string]*string) tags["created-at"] = ×tamp for k, v := range newTags { - tags["dispatch-"+k] = &v + newstr := v + tags["dispatch-"+k] = &newstr } tags["dispatch-instance-type"] = &instanceType.Name @@ -552,7 +553,8 @@ func (ai *AzureInstance) SetTags(ctx context.Context, newTags InstanceTags) erro } } for k, v := range newTags { - tags["dispatch-"+k] = &v + newstr := v + tags["dispatch-"+k] = &newstr } vmParameters := compute.VirtualMachine{ @@ -599,7 +601,7 @@ func (ai *AzureInstance) VerifyPublicKey(ctx context.Context, receivedKey ssh.Pu if remoteFingerprint == tg { return nil } else { - return fmt.Errorf("Key fingerprint did not match") + return fmt.Errorf("Key fingerprint did not match, expected %q got %q", tg, remoteFingerprint) } } @@ -619,7 +621,7 @@ func (ai *AzureInstance) VerifyPublicKey(ctx context.Context, receivedKey ssh.Pu log.Printf("%q %q", nodetoken, expectedToken) if strings.TrimSpace(nodetoken) != expectedToken { - return fmt.Errorf("Node token did not match") + return fmt.Errorf("Node token did not match, expected %q got %q", expectedToken, nodetoken) } sess, err = client.NewSession() @@ -637,7 +639,7 @@ func (ai *AzureInstance) VerifyPublicKey(ctx context.Context, receivedKey ssh.Pu log.Printf("%q %q", remoteFingerprint, sp[1]) if remoteFingerprint != sp[1] { - return fmt.Errorf("Key fingerprint did not match") + return fmt.Errorf("Key fingerprint did not match, expected %q got %q", sp[1], remoteFingerprint) } tags["ssh-pubkey-fingerprint"] = sp[1] -- 2.30.2