Skip to content

Commit

Permalink
Merge pull request #81 from tyzbit/flux-agent-kairos-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Itxaka authored Jul 3, 2024
2 parents a770e56 + b53ce29 commit e237cd8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions flux/flux-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ fi

# Determine what VCS we need to bootstrap
for vcs in bitbucket_server git github gitlab; do
if [[ $(kairos-agent config get flux.$vcs 2>/dev/null) != "null" ]]; then
# kairos-agent used to return `null` when a key wasn't set, now returns empty.
# we handle both
if [[ $(kairos-agent config get flux.$vcs 2>/dev/null) != "" ]] && [[ $(kairos-agent config get flux.$vcs 2>/dev/null) != "null" ]]; then
version_control=$vcs
break
fi
Expand All @@ -51,7 +53,7 @@ mapfile -t args < <(kairos-agent config get "flux.$version_control" 2>/dev/null)
declare -a cmdline

for setting in "${envs[@]}"; do
if [[ $setting != "null" ]]; then
if [[ $setting != "null" ]] && [[ $setting != "" ]]; then
env=$(echo "$setting" | cut -d: -f1)
value=$(echo "$setting" | cut -d':' -f2 | sed -E 's/^ //g')
if [[ "${value}x" != "x" ]]; then
Expand All @@ -62,7 +64,7 @@ done

# Set commandline args
for setting in "${args[@]}"; do
if [[ $setting != "null" ]]; then
if [[ $setting != "null" ]] && [[ $setting != "" ]]; then
arg=$(echo "$setting" | cut -d: -f1)
value=$(echo "$setting" | cut -d':' -f2 | sed -E 's/^ //g')
if [[ "${value}x" != "x" ]]; then
Expand Down

0 comments on commit e237cd8

Please sign in to comment.