-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from coreydaley/jira_ship_0004_build_env_vars
SHIP-0004: Build Environment Variables
- Loading branch information
Showing
308 changed files
with
18,206 additions
and
17,770 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[submodule "test/e2e/bats/core"] | ||
path = test/e2e/bats/core | ||
url = https://github.com/bats-core/bats-core | ||
[submodule "test/e2e/bats/support"] | ||
path = test/e2e/bats/support | ||
url = https://github.com/bats-core/bats-support | ||
[submodule "test/e2e/bats/assert"] | ||
path = test/e2e/bats/assert | ||
url = https://github.com/bats-core/bats-assert | ||
[submodule "test/e2e/bats/file"] | ||
path = test/e2e/bats/file | ||
url = https://github.com/bats-core/bats-file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package util | ||
|
||
import ( | ||
"strings" | ||
|
||
corev1 "k8s.io/api/core/v1" | ||
) | ||
|
||
func StringSliceToEnvVarSlice(envs []string) []corev1.EnvVar { | ||
envVars := []corev1.EnvVar{} | ||
|
||
for _, e := range envs { | ||
d := strings.Split(e, "=") | ||
envVars = append(envVars, corev1.EnvVar{Name: d[0], Value: d[1]}) | ||
} | ||
return envVars | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package util | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
|
||
corev1 "k8s.io/api/core/v1" | ||
) | ||
|
||
func TestStringSliceToEnvVar(t *testing.T) { | ||
type args struct { | ||
envs []string | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want []corev1.EnvVar | ||
}{ | ||
{ | ||
name: "no envs", | ||
args: args{ | ||
envs: []string{}, | ||
}, | ||
want: []corev1.EnvVar{}, | ||
}, | ||
{ | ||
name: "one env", | ||
args: args{ | ||
envs: []string{"my-name=my-value"}, | ||
}, | ||
want: []corev1.EnvVar{ | ||
{Name: "my-name", Value: "my-value"}, | ||
}, | ||
}, | ||
{ | ||
name: "multiple envs", | ||
args: args{ | ||
envs: []string{"name-one=value-one", "name-two=value-two", "name-three=value-three"}, | ||
}, | ||
want: []corev1.EnvVar{ | ||
{Name: "name-one", Value: "value-one"}, | ||
{Name: "name-two", Value: "value-two"}, | ||
{Name: "name-three", Value: "value-three"}, | ||
}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := StringSliceToEnvVarSlice(tt.args.envs); !reflect.DeepEqual(got, tt.want) { | ||
t.Errorf("StringSliceToEnvVar() = %#v, want %#v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.