Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Fix nil panic on null environment variable for step #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions engine/compiler/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func configureSerial(spec *engine.Spec) {
func convertStaticEnv(src map[string]*manifest.Variable) map[string]string {
dst := map[string]string{}
for k, v := range src {
if v == nil {
continue
}
if strings.TrimSpace(v.Secret) == "" {
dst[k] = v.Value
}
Expand All @@ -76,6 +79,9 @@ func convertStaticEnv(src map[string]*manifest.Variable) map[string]string {
func convertSecretEnv(src map[string]*manifest.Variable) []*engine.Secret {
dst := []*engine.Secret{}
for k, v := range src {
if v == nil {
continue
}
if strings.TrimSpace(v.Secret) != "" {
dst = append(dst, &engine.Secret{
Name: v.Secret,
Expand Down