Skip to content

Commit

Permalink
Merge pull request #355 from jpodivin/ssh-secret
Browse files Browse the repository at this point in the history
Addin specialized utility function for genereting mock ssh secrets
  • Loading branch information
stuggi authored Oct 5, 2023
2 parents 5e4b179 + 99baa47 commit a921a2d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/common/test/helpers/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ func (tc *TestHelper) CreateEmptySecret(name types.NamespacedName) *corev1.Secre
return tc.CreateSecret(name, map[string][]byte{})
}

// CreateSSHSecret creates new secret containing mock "ssh-privatekey"
//
// Example usage:
//
// sshSecret := th.CreateSSHSecret(types.NamespacedName{Name: "test-ssh-secret", Namespace: "test-namespace"})
func (tc *TestHelper) CreateSSHSecret(name types.NamespacedName) *corev1.Secret {
return tc.CreateSecret(name, map[string][]byte{"ssh-privatekey": []byte("foo")})
}

// DeleteSecret deletes a Secret resource
//
// Example usage:
Expand Down

0 comments on commit a921a2d

Please sign in to comment.