-
Notifications
You must be signed in to change notification settings - Fork 67
feat: replace kubedock with native container-in-container support #709
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
eba7c91
feat: replace kubedock with native container-in-container support
cidrblock cb257c6
fix: address CI failures in lint and devspaces build
cidrblock 5e100ea
fix: address Copilot review feedback
cidrblock fc08be0
fix: address second round of Copilot review feedback
cidrblock 9208bec
chore: add BUILDAH to cspell dictionary
cidrblock 90bb468
fix: address human review - Dev Spaces 3.25+/OCP 4.20+
cidrblock cc0203a
fix: remove /etc/group append from entrypoint
cidrblock 13724c9
docs(entrypoint): clarify comment — subordinate count from UID map, u…
cidrblock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| #!/bin/bash | ||
| # Colored bash prompt for Ansible Dev Spaces, modeled after Fedora's | ||
| # bash-color-prompt (https://github.com/juhp/bash-color-prompt). | ||
| # Installed to /etc/profile.d/ for interactive login shells. | ||
| # cspell: ignore COLORTERM | ||
|
|
||
| # Only apply to interactive bash sessions | ||
| [[ $- != *i* ]] && return | ||
|
|
||
| # Respect NO_COLOR (https://no-color.org/) | ||
| if [[ -n "${NO_COLOR:-}" && -z "${BASH_PROMPT_USE_COLOR:-}" ]]; then | ||
| return | ||
| fi | ||
|
|
||
| # Only activate on terminals that support color | ||
| case "${TERM:-}" in | ||
| *color* | xterm* | screen* | tmux* | linux) ;; | ||
| *) | ||
| [[ -z "${COLORTERM:-}" ]] && return | ||
| ;; | ||
| esac | ||
|
|
||
| _adt_git_branch() { | ||
| local branch | ||
| branch=$(git symbolic-ref --short HEAD 2>/dev/null) || \ | ||
| branch=$(git rev-parse --short HEAD 2>/dev/null) | ||
| [[ -z "$branch" ]] && return | ||
|
|
||
| local dirty | ||
| dirty=$(git status --porcelain --untracked-files=no --ignore-submodules=dirty 2>/dev/null | head -n1) | ||
| if [[ -n "$dirty" ]]; then | ||
| printf ' \001\e[33m\002(%s*)\001\e[0m\002' "$branch" | ||
| else | ||
| printf ' \001\e[32m\002(%s)\001\e[0m\002' "$branch" | ||
| fi | ||
| } | ||
|
|
||
| _adt_build_prompt() { | ||
| local last_exit=$? | ||
| local red='\[\e[31m\]' | ||
| local green='\[\e[32m\]' | ||
| local blue='\[\e[34m\]' | ||
| local bold='\[\e[1m\]' | ||
| local reset='\[\e[0m\]' | ||
|
|
||
| local prefix="" | ||
| if [[ -n "${container:-}" ]]; then | ||
| prefix="⬢ " | ||
| fi | ||
|
|
||
| local status_indicator="" | ||
| if [[ $last_exit -ne 0 ]]; then | ||
| status_indicator="${red}[${last_exit}]${reset} " | ||
| fi | ||
|
|
||
| PS1="${status_indicator}${prefix}${bold}${green}\u@\h${reset}:${bold}${blue}\w${reset}\$(_adt_git_branch)\$ " | ||
| } | ||
|
|
||
| # Preserve any existing PROMPT_COMMAND hooks | ||
| if [[ -n "${PROMPT_COMMAND:-}" ]]; then | ||
| PROMPT_COMMAND="_adt_build_prompt;${PROMPT_COMMAND}" | ||
| else | ||
| PROMPT_COMMAND="_adt_build_prompt" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| #!/usr/bin/env bash | ||
| # Entrypoint for the Ansible Dev Spaces container image. | ||
| # Sets up the dynamic UID mapping required for rootless podman | ||
| # with user namespaces (container-in-container without kubedock). | ||
| # cspell: ignore subuid subgid catatonit | ||
| set -euo pipefail | ||
|
|
||
| if [ ! -d "${HOME}" ]; then | ||
| mkdir -p "${HOME}" | ||
| fi | ||
|
|
||
| if ! whoami &>/dev/null; then | ||
| if [ -w /etc/passwd ]; then | ||
| echo "${USER_NAME:-user}:x:$(id -u):0:${USER_NAME:-user} user:${HOME}:/bin/bash" >>/etc/passwd | ||
| else | ||
| echo "ERROR: Cannot resolve user and /etc/passwd is not writable" >&2 | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| USER=$(whoami) | ||
| CURRENT_UID=$(id -u) | ||
| START_ID=$(( CURRENT_UID + 1 )) | ||
|
|
||
| # Derive the available subordinate ID count from the UID namespace mapping | ||
| # (same count used for both subuid and subgid). | ||
| if [ -r /proc/self/uid_map ]; then | ||
| NAMESPACE_SIZE=$(awk '{print $3}' /proc/self/uid_map | head -n1) | ||
| else | ||
| NAMESPACE_SIZE=65536 | ||
| fi | ||
|
|
||
| SUB_ID_COUNT=$(( NAMESPACE_SIZE - START_ID )) | ||
| if [ "${SUB_ID_COUNT}" -le 0 ]; then | ||
| echo "ERROR: No subordinate IDs available (uid=${CURRENT_UID}, namespace=${NAMESPACE_SIZE})" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| for f in /etc/subuid /etc/subgid; do | ||
| if [ ! -w "$f" ]; then | ||
| echo "ERROR: ${f} is not writable, cannot configure rootless podman" >&2 | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
| echo "${USER}:${START_ID}:${SUB_ID_COUNT}" >/etc/subuid | ||
| echo "${USER}:${START_ID}:${SUB_ID_COUNT}" >/etc/subgid | ||
|
|
||
| exec /usr/libexec/podman/catatonit -- "$@" |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.