Skip to content

Commit

Permalink
PR Feedback - clarify comments on Vault helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurret committed Mar 29, 2022
1 parent ec44f6e commit ff27cc4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions acceptance/framework/vault/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func GenerateGossipSecret() (string, error) {
}

// ConfigureGossipVaultSecret generates a gossip encryption key,
// stores it in vault as a secret and configures a policy to access it.
// stores it in Vault as a secret and configures a policy to access it.
func ConfigureGossipVaultSecret(t *testing.T, vaultClient *vapi.Client) string {
// Create the Vault Policy for the gossip key.
logger.Log(t, "Creating gossip policy")
Expand All @@ -105,7 +105,7 @@ func ConfigureGossipVaultSecret(t *testing.T, vaultClient *vapi.Client) string {
return gossipKey
}

// ConfigureEnterpriseLicenseVaultSecret stores it in vault as a secret and configures a policy to access it.
// ConfigureEnterpriseLicenseVaultSecret stores it in Vault as a secret and configures a policy to access it.
func ConfigureEnterpriseLicenseVaultSecret(t *testing.T, vaultClient *vapi.Client, cfg *config.TestConfig) {
// Create the enterprise license secret.
logger.Log(t, "Creating the Enterprise License secret")
Expand All @@ -121,7 +121,7 @@ func ConfigureEnterpriseLicenseVaultSecret(t *testing.T, vaultClient *vapi.Clien
require.NoError(t, err)
}

// ConfigureSnapshotAgentSecret stores it in vault as a secret and configures a policy to access it.
// ConfigureSnapshotAgentSecret stores it in Vault as a secret and configures a policy to access it.
func ConfigureSnapshotAgentSecret(t *testing.T, vaultClient *vapi.Client, cfg *config.TestConfig, config []byte) {
logger.Log(t, "Creating the Snapshot Agent Config secret")
params := map[string]interface{}{
Expand All @@ -136,7 +136,7 @@ func ConfigureSnapshotAgentSecret(t *testing.T, vaultClient *vapi.Client, cfg *c
require.NoError(t, err)
}

// ConfigureKubernetesAuthRole configures a role for the component for the Kubernetes auth method
// ConfigureKubernetesAuthRole configures a role in Vault for the component for the Kubernetes auth method
// that will be used by the test Helm chart installation.
func ConfigureKubernetesAuthRole(t *testing.T, vaultClient *vapi.Client, consulReleaseName, ns, authPath, component, policies string) {
componentServiceAccountName := fmt.Sprintf("%s-consul-%s", consulReleaseName, component)
Expand All @@ -158,8 +158,8 @@ func ConfigureKubernetesAuthRole(t *testing.T, vaultClient *vapi.Client, consulR
require.NoError(t, err)
}

// ConfigureKubernetesAuthRole configures a role that allows all service accounts within the installation
// namespace access to the Consul server CA.
// ConfigureConsulCAKubernetesAuthRole configures a role in Vault that allows all service accounts
// within the installation namespace access to the Consul server CA.
func ConfigureConsulCAKubernetesAuthRole(t *testing.T, vaultClient *vapi.Client, ns, authPath string) {
// Create the CA role that all components will use to fetch the Server CA certs.
params := map[string]interface{}{
Expand Down Expand Up @@ -188,7 +188,7 @@ func ConfigurePKICA(t *testing.T, vaultClient *vapi.Client) {
require.NoError(t, err)
}

// ConfigurePKICertificates configures roles so that Consul server TLS certificates
// ConfigurePKICertificates configures roles in Vault so that Consul server TLS certificates
// can be issued by Vault.
func ConfigurePKICertificates(t *testing.T, vaultClient *vapi.Client, consulReleaseName, ns, datacenter string) string {
// Create the Vault PKI Role.
Expand Down Expand Up @@ -222,7 +222,7 @@ path %q {
}

// ConfigureACLTokenVaultSecret generates a token secret ID for a given name,
// stores it in vault as a secret and configures a policy to access it.
// stores it in Vault as a secret and configures a policy to access it.
func ConfigureACLTokenVaultSecret(t *testing.T, vaultClient *vapi.Client, tokenName string) string {
// Create the Vault Policy for the token.
logger.Logf(t, "Creating %s token policy", tokenName)
Expand Down

0 comments on commit ff27cc4

Please sign in to comment.