Skip to content

Commit

Permalink
ensure we do not erase existing flags in the container
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Dec 17, 2022
1 parent b9fff4c commit 0012ae8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions api/v1alpha1/minicluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ func (f *MiniCluster) Validate() bool {
valid := true
fluxRunners := 0

// If we only have one container, assume we want to run flux with it
// This makes it easier for the user to not require the flag
if len(f.Spec.Containers) == 1 {
f.Spec.Containers[0].FluxRunner = true
}

for i, container := range f.Spec.Containers {
name := fmt.Sprintf("MiniCluster.Container.%d", i)
fmt.Printf("🤓 %s.Image %s\n", name, container.Image)
Expand Down
11 changes: 10 additions & 1 deletion controllers/flux/templates/wait.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,16 @@ printf "\n🐸 Diagnostics: ${diagnostics}\n"
# Flux option flags
option_flags="%s"
if [ "${option_flags}" != "" ]; then
export FLUX_OPTION_FLAGS=${option_flags}
# Make sure we don't get rid of any already defined flags
existing_flags="${FLUX_OPTION_FLAGS:-}"

# provide them first so they are replaced by new ones here
if [ "${existing_flags}" != "" ]; then
export FLUX_OPTION_FLAGS="${existing_flags} ${option_flags}"
else
export FLUX_OPTION_FLAGS="${option_flags}"
fi
printf "\n🚩️ Flux Option Flags ${FLUX_OPTION_FLAGS}\n"
fi

mkdir -p /etc/flux/imp/conf.d/
Expand Down

0 comments on commit 0012ae8

Please sign in to comment.