From 2b8231f509b7797bd95ac66ac07f7feb021cdd44 Mon Sep 17 00:00:00 2001 From: James Kwon <96548424+hongil0316@users.noreply.github.com> Date: Thu, 19 Dec 2024 22:46:42 -0500 Subject: [PATCH] add import ssh key for specific project --- modules/gcp/oslogin.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/gcp/oslogin.go b/modules/gcp/oslogin.go index 192eeaae1..9dc3a33b6 100644 --- a/modules/gcp/oslogin.go +++ b/modules/gcp/oslogin.go @@ -20,26 +20,26 @@ func ImportSSHKey(t testing.TestingT, user, key string) { require.NoErrorf(t, ImportSSHKeyE(t, user, key), "Could not add SSH Key to user %s", user) } -// ImportSSHKey will import an SSH key to GCP under the provided user identity. +// ImportSSHKeyE will import an SSH key to GCP under the provided user identity. // The `user` parameter should be the email address of the user. // The `key` parameter should be the public key of the SSH key being uploaded. -// The `projectID` parameter should be the choosen project ID. -// This will fail the test if there is an error. -func ImportProjectSSHKey(t testing.TestingT, user, key, projectID string) { - require.NoErrorf(t, ImportProjectSSHKeyE(t, user, key, projectID), "Could not add SSH Key to user %s", user) +func ImportSSHKeyE(t testing.TestingT, user, key string) error { + return importProjectSSHKeyE(t, user, key, nil) } -// ImportSSHKeyE will import an SSH key to GCP under the provided user identity. +// ImportProjectSSHKey will import an SSH key to GCP under the provided user identity. // The `user` parameter should be the email address of the user. // The `key` parameter should be the public key of the SSH key being uploaded. -func ImportSSHKeyE(t testing.TestingT, user, key string) error { - return importProjectSSHKeyE(t, user, key, nil) +// The `projectID` parameter should be the chosen project ID. +// This will fail the test if there is an error. +func ImportProjectSSHKey(t testing.TestingT, user, key, projectID string) { + require.NoErrorf(t, ImportProjectSSHKeyE(t, user, key, projectID), "Could not add SSH Key to user %s", user) } // ImportProjectSSHKeyE will import an SSH key to GCP under the provided user identity. // The `user` parameter should be the email address of the user. // The `key` parameter should be the public key of the SSH key being uploaded. -// The `projectID` parameter should be the choosen project ID. +// The `projectID` parameter should be the chosen project ID. func ImportProjectSSHKeyE(t testing.TestingT, user, key, projectID string) error { return importProjectSSHKeyE(t, user, key, &projectID) }