Skip to content

Commit

Permalink
Merge pull request #217 from flux-framework/bug-disable-view-pin-cont…
Browse files Browse the repository at this point in the history
…roller-gen

bug: openapi-gen and view PATH
  • Loading branch information
vsoch authored Feb 28, 2024
2 parents 97b1244 + 77250c7 commit 004ab42
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ $(CONTROLLER_GEN): $(LOCALBIN)
.PHONY: openapi-gen
openapi-gen: $(OPENAPI_GEN) ## Download controller-gen locally if necessary.
$(OPENAPI_GEN): $(LOCALBIN)
which ${OPENAPI_GEN} > /dev/null || (git clone --depth 1 https://github.com/kubernetes/kube-openapi /tmp/kube-openapi && cd /tmp/kube-openapi && go build -o ${OPENAPI_GEN} ./cmd/openapi-gen)
which ${OPENAPI_GEN} > /dev/null || (git clone https://github.com/kubernetes/kube-openapi /tmp/kube-openapi && cd /tmp/kube-openapi && git checkout 582cce78233bcb0195bc9a84f80662b9502325ee && go build -o ${OPENAPI_GEN} ./cmd/openapi-gen)

.PHONY: swagger-jar
swagger-jar: $(SWAGGER_JAR) ## Download controller-gen locally if necessary.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ require (
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
)
9 changes: 5 additions & 4 deletions pkg/flux/templates/components.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ software="${viewbase}/software"
viewbin="${viewroot}/bin"
fluxpath=${viewbin}/flux

# Set the flux root
{{ if not .Spec.Logging.Quiet }}
# Set the flux root, don't show the viewer if view is disabled (can be confusing)
# The view is used to have configs and that is it
{{ if not .Spec.Logging.Quiet }}{{ if not .Spec.Flux.Container.Disable }}
echo
echo "Flux install root: ${viewroot}"
echo
{{ end }}
{{ end }}{{ end }}

# Important to add AFTER in case software in container duplicated
export PATH=$PATH:${viewbin}
{{ if not .Spec.Flux.Container.Disable }}export PATH=$PATH:${viewbin}{{ end }}

# Wait for marker (from spack.go) to indicate copy is done
goshare-wait-fs -p ${viewbase}/flux-operator-done.txt {{ if .Spec.Logging.Quiet }}> /dev/null 2>&1{{ end }}
Expand Down
5 changes: 4 additions & 1 deletion pkg/flux/templates/wait.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{{ .Container.Commands.Init}} {{ if .Spec.Logging.Quiet }}> /dev/null{{ end }}

# Shared logic to wait for view
# We include the view even for disabling flux because it generates needed config files
{{template "wait-view" .}}
{{ if not .Spec.Flux.Container.Disable }}{{template "paths" .}}{{ end }}

Expand Down Expand Up @@ -52,11 +53,13 @@ chown -R ${fluxuid} ${curvepath}
# If we have disabled the view, we need to use the flux here to generate resources
{{ if .Spec.Flux.Container.Disable }}
hosts=$(cat ${viewroot}/etc/flux/system/hostlist)
{{ if not .Spec.Logging.Quiet }}
echo
echo "📦 Resources"
echo "flux R encode --hosts=${hosts} --local"
{{ end }}
flux R encode --hosts=${hosts} --local > ${viewroot}/etc/flux/system/R
cat ${viewroot}/etc/flux/system/R
{{ if not .Spec.Logging.Quiet }}cat ${viewroot}/etc/flux/system/R{{ end }}
{{ end }}

# Put the state directory in /var/lib on shared view
Expand Down

0 comments on commit 004ab42

Please sign in to comment.