Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the bootstrap script to accept a custom path when using the cli image #1874

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions cmd/bootstrap/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@ main() {
file_container_endpoint=$(echo "${CONTAINER_ENDPOINT}" | sed -e "s#unix://##g")
MOUNTS="${MOUNTS} -v '${file_container_endpoint}:/${CONTAINER_ENGINE}.sock:z'"
fi
INPUT_PATH_ARG=""
INPUT_PATH_ARG="/input"
if [ -n "${INPUT_PATH}" ]; then
MOUNTS="${MOUNTS} -v '${INPUT_PATH}:/input:z'"
INPUT_PATH_ARG="/input"
else
MOUNTS="${MOUNTS} -v '${SKUPPER_OUTPUT_PATH}/namespaces/${NAMESPACE:-default}/input/resources:/input:z'"
fi
MOUNTS="${MOUNTS} -v '${SKUPPER_OUTPUT_PATH}:/output:z'"
MOUNTS="${MOUNTS} -v '${BOOTSTRAP_OUT}:/bootstrap.out:z'"
Expand Down
9 changes: 5 additions & 4 deletions pkg/nonkube/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package bootstrap

import (
"fmt"
"os"
"os/exec"
"path"

"github.com/skupperproject/skupper/api/types"
internalbundle "github.com/skupperproject/skupper/internal/nonkube/bundle"
internalutils "github.com/skupperproject/skupper/internal/utils"
Expand All @@ -11,9 +15,6 @@ import (
"github.com/skupperproject/skupper/pkg/nonkube/compat"
"github.com/skupperproject/skupper/pkg/nonkube/systemd"
"github.com/skupperproject/skupper/pkg/utils"
"os"
"os/exec"
"path"
)

type Config struct {
Expand Down Expand Up @@ -43,7 +44,7 @@ func PreBootstrap(config *Config) error {
fmt.Printf("Input path has not been provided and namespace %s does not exist\n", config.Namespace)
return fmt.Errorf("No sources found at: %s\n", path.Join(api.GetHostNamespaceHome(config.Namespace), string(api.InputSiteStatePath)))
}
} else if inputSourcesDefined {
} else if inputSourcesDefined && !api.IsRunningInContainer() {
return fmt.Errorf("Input path has been provided, but namespace %s has input sources defined at:\n %s\n", config.Namespace, path.Join(api.GetHostNamespaceHome(config.Namespace), string(api.InputSiteStatePath)))
}

Expand Down