Skip to content

Commit 9bc31ae

Browse files
ericdandyerniyazN
authored andcommitted
Wait for write propagation after creating an OS Login SSH key (GoogleCloudPlatform#13353)
1 parent 724deef commit 9bc31ae

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

mmv1/products/oslogin/SSHPublicKey.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ timeouts:
3535
delete_minutes: 20
3636
custom_code:
3737
pre_create: 'templates/terraform/pre_create/os_login_ssh_public_key.go.tmpl'
38-
post_create: 'templates/terraform/post_create/sshkeyfingerprint.go.tmpl'
38+
post_create: 'templates/terraform/post_create/sshkeyfingerprint_and_sleep.go.tmpl'
3939
# Skip sweeper since due to URL containing user ID
4040
exclude_sweeper: true
4141
examples:

mmv1/templates/terraform/post_create/sshkeyfingerprint.go.tmpl renamed to mmv1/templates/terraform/post_create/sshkeyfingerprint_and_sleep.go.tmpl

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ id, err = tpgresource.ReplaceVars(d, config, "users/{{"{{"}}user{{"}}"}}/sshPubl
2020
if err != nil {
2121
return fmt.Errorf("Error constructing id: %s", err)
2222
}
23-
d.SetId(id)
23+
d.SetId(id)
24+
25+
// Wait 10s for write propagation; should be usually done in ~7s max.
26+
time.Sleep(10 * time.Second)

0 commit comments

Comments
 (0)