mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 10:28:22 +00:00
nit: method name change
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
|||||||
"github.com/Infisical/infisical-merge/packages/models"
|
"github.com/Infisical/infisical-merge/packages/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEnvFilter(t *testing.T) {
|
func TestFilterReservedEnvVars(t *testing.T) {
|
||||||
|
|
||||||
// some test env vars.
|
// some test env vars.
|
||||||
// HOME and PATH are reserved key words and should be filtered out
|
// HOME and PATH are reserved key words and should be filtered out
|
||||||
@@ -22,7 +22,7 @@ func TestEnvFilter(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check to see if there are any reserved key words in secrets to inject
|
// check to see if there are any reserved key words in secrets to inject
|
||||||
filterEnvVars(env)
|
filterReservedEnvVars(env)
|
||||||
|
|
||||||
if len(env) != 2 {
|
if len(env) != 2 {
|
||||||
t.Errorf("Expected 2 secrets to be returned, got %d", len(env))
|
t.Errorf("Expected 2 secrets to be returned, got %d", len(env))
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ var runCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check to see if there are any reserved key words in secrets to inject
|
// check to see if there are any reserved key words in secrets to inject
|
||||||
filterEnvVars(secretsByKey)
|
filterReservedEnvVars(secretsByKey)
|
||||||
|
|
||||||
// now add infisical secrets
|
// now add infisical secrets
|
||||||
for k, v := range secretsByKey {
|
for k, v := range secretsByKey {
|
||||||
@@ -156,7 +156,7 @@ var (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func filterEnvVars(env map[string]models.SingleEnvironmentVariable) {
|
func filterReservedEnvVars(env map[string]models.SingleEnvironmentVariable) {
|
||||||
for _, reservedEnvName := range reservedEnvVars {
|
for _, reservedEnvName := range reservedEnvVars {
|
||||||
if _, ok := env[reservedEnvName]; ok {
|
if _, ok := env[reservedEnvName]; ok {
|
||||||
delete(env, reservedEnvName)
|
delete(env, reservedEnvName)
|
||||||
|
|||||||
Reference in New Issue
Block a user