Skip to content

Commit e229bc6

Browse files
committed
reliable workspace and kubeconfig path for template repo and k8s plugin
1 parent 80b1d94 commit e229bc6

3 files changed

Lines changed: 36 additions & 4 deletions

File tree

.devcontainer/docker/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -879,12 +879,14 @@ RUN echo \
879879

880880
#################################################################################
881881
# Load startup artifacts
882-
COPY ./bin/connect /bin/
883-
COPY ./bin/entrypoint /bin/
882+
COPY ./bin/connect /bin/
883+
COPY ./bin/entrypoint /bin/
884+
COPY ./bin/devcontainer-links /bin/
884885

885886
#################################################################################
886887
# Entrypoint & default command
887-
ENTRYPOINT /bin/entrypoint
888+
ENTRYPOINT ["/bin/entrypoint"]
889+
HEALTHCHECK --interval=120s --timeout=30s --start-period=5s --retries=3 CMD [ "true" ]
888890
CMD ["/usr/bin/env", "connect"]
889891

890892
# Ports
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Change ownership of all items in /workspaces to the current user
4+
user="$(id -u)"
5+
sudo chown "${user}" /workspaces/* 2>/dev/null
6+
7+
# Iterate over directories in /workspaces
8+
for dir in /workspaces/*; do
9+
# Check if it's a directory
10+
if [[ -d "${dir}" ]]; then
11+
# Extract the directory name
12+
dir_name=$(basename "${dir}")
13+
14+
# Check if a symlink already exists in the home directory
15+
if [[ -L "${HOME}/${dir_name}" ]]; then
16+
# Remove the existing symlink if it exists
17+
rm "${HOME}/${dir_name}"
18+
elif [[ -e "${HOME}/${dir_name}" ]]; then
19+
# Skip if it's not a symlink (to avoid destructive actions on actual directories or files)
20+
echo "Skipping ${HOME}/${dir_name}, as it's not a symlink."
21+
continue
22+
fi
23+
24+
# Create a new symbolic link
25+
ln -s "${dir}" "${HOME}/${dir_name}"
26+
fi
27+
done
28+
29+
# Allow direnv to set environment variables
30+
direnv allow 2>/dev/null

.github/konductor

0 commit comments

Comments
 (0)