From 8102c8361ba96c633fc9a9604a2625c96dc444dc Mon Sep 17 00:00:00 2001 From: Peter Sutter Date: Mon, 11 Mar 2024 17:01:46 +0100 Subject: [PATCH 1/4] use gardenlinux base image --- .ci/build | 4 ++-- dockerfile-configs/common-components.yaml | 24 +++++++++++------------ hacks/ghelp | 2 -- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.ci/build b/.ci/build index c99ba69..8ca32af 100755 --- a/.ci/build +++ b/.ci/build @@ -1,6 +1,6 @@ #!/bin/bash -eu -UBUNTU_VERSION=22.04 +GARDENLINUX_VERSION=nightly SOURCE_PATH=${SOURCE_PATH:-} GENERATED_DOCKERFILES_PATH=${GENERATED_DOCKERFILES_PATH:-} @@ -15,6 +15,6 @@ fi "${SOURCE_PATH}"/generator/generate-dockerfile.py \ --dockerfile-config "${SOURCE_PATH}"/dockerfile-configs/common-components.yaml \ - --from-image "ubuntu:${UBUNTU_VERSION}" \ + --from-image "ghcr.io/gardenlinux/gardenlinux:${GARDENLINUX_VERSION}" \ --title "gardener shell" \ --dockerfile "${GENERATED_DOCKERFILES_PATH}"/ops-toolbelt.dockerfile \ No newline at end of file diff --git a/dockerfile-configs/common-components.yaml b/dockerfile-configs/common-components.yaml index ab649da..efbd32d 100644 --- a/dockerfile-configs/common-components.yaml +++ b/dockerfile-configs/common-components.yaml @@ -2,12 +2,19 @@ # # SPDX-License-Identifier: Apache-2.0 +- bash: + - name: debian testing apt-source + command: | + echo "deb https://cdn-aws.deb.debian.org/debian testing main" >> /etc/apt/sources.list + info: ~ + - apt-get: - curl - tree - vim-tiny - htop - less + - locales - tmux - bash-completion - python3-distutils @@ -32,6 +39,8 @@ provides: netcat - name: python3-minimal provides: python3 + - name: python3-tabulate + provides: tabulate - bash: - name: install-security-upgrades @@ -45,13 +54,6 @@ version: v1.3 from: https://github.com/bronze1man/yaml2json/releases/download/{version}/yaml2json_linux_amd64 info: transform yaml string to json string without the type infomation. - - name: pip - from: https://bootstrap.pypa.io/pip/get-pip.py - to: /get-pip.py - command: | - python3 /get-pip.py;\ - rm /get-pip.py - info: ~ - name: kubetail from: https://raw.githubusercontent.com/johanhaleby/kubetail/master/kubetail info: Bash script that enables you to aggregate (tail/follow) logs from multiple pods into one stream @@ -73,17 +75,15 @@ - bash: - name: generate_locale - command: locale-gen "en_US.UTF-8" + command: | + echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen;\ + locale-gen info: ~ - env: - LANG=en_US.UTF-8 - LANGUAGE=en_US.UTF-8 -- pip: - - mdv - - tabulate - - copy: - name: dotfiles from: ./dotfiles diff --git a/hacks/ghelp b/hacks/ghelp index e1f9506..59563aa 100755 --- a/hacks/ghelp +++ b/hacks/ghelp @@ -70,13 +70,11 @@ if ghelp_info is None: exit(1) apttools = retrieve_packages_info(ghelp_info["apt"], "apt", "show", "=", "\n\n" , "Package", "Version", "Description") -piptools = retrieve_packages_info(ghelp_info["pip"], "pip", "show", "==", "---", "Name", "Version", "Summary") downloaded_tools = retrieve_downloaded_tools_info(ghelp_info["downloaded"]) hack_tools = retrieve_hacks_info() table = [] table.extend(apttools) -table.extend(piptools) table.extend(downloaded_tools) table.extend(hack_tools) From cbf8b965221087fee90fdfe37276c2551840ba6b Mon Sep 17 00:00:00 2001 From: Peter Sutter Date: Wed, 13 Mar 2024 23:06:00 +0100 Subject: [PATCH 2/4] PR feedback: fix retrieve_packages_info --- hacks/ghelp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hacks/ghelp b/hacks/ghelp index 59563aa..006fcc3 100755 --- a/hacks/ghelp +++ b/hacks/ghelp @@ -29,6 +29,9 @@ def parse_package_info(package_info, provided_binaries, name_key, version_key, i def retrieve_packages_info(installed_tools_list, package_manager, show_command, version_delimiter, delimiter, name_key, version_key, info_key): tools = [] + if not installed_tools_list: + return tools + provided_binaries = {} tool_names = [] for entry in installed_tools_list: @@ -70,11 +73,13 @@ if ghelp_info is None: exit(1) apttools = retrieve_packages_info(ghelp_info["apt"], "apt", "show", "=", "\n\n" , "Package", "Version", "Description") +piptools = retrieve_packages_info(ghelp_info["pip"], "pip", "show", "==", "---", "Name", "Version", "Summary") downloaded_tools = retrieve_downloaded_tools_info(ghelp_info["downloaded"]) hack_tools = retrieve_hacks_info() table = [] table.extend(apttools) +table.extend(piptools) table.extend(downloaded_tools) table.extend(hack_tools) From 72cef834cb257eb864ce4623c300d7cd1e134e1e Mon Sep 17 00:00:00 2001 From: Peter Sutter Date: Wed, 13 Mar 2024 23:16:05 +0100 Subject: [PATCH 3/4] PR feedback: use latest gardenlinux release --- .ci/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/build b/.ci/build index 8ca32af..a00a5cf 100755 --- a/.ci/build +++ b/.ci/build @@ -1,6 +1,6 @@ #!/bin/bash -eu -GARDENLINUX_VERSION=nightly +GARDENLINUX_VERSION=1443.0 SOURCE_PATH=${SOURCE_PATH:-} GENERATED_DOCKERFILES_PATH=${GENERATED_DOCKERFILES_PATH:-} From 1e2b237c4fa4b10631b30a898af4b1afe86b7dd5 Mon Sep 17 00:00:00 2001 From: Peter Sutter Date: Fri, 22 Mar 2024 10:38:33 +0100 Subject: [PATCH 4/4] remove obsolete apt update --- dockerfile-configs/common-components.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/dockerfile-configs/common-components.yaml b/dockerfile-configs/common-components.yaml index efbd32d..6413fd8 100644 --- a/dockerfile-configs/common-components.yaml +++ b/dockerfile-configs/common-components.yaml @@ -42,13 +42,6 @@ - name: python3-tabulate provides: tabulate -- bash: - - name: install-security-upgrades - command: | - apt-get --yes update && apt-get -s dist-upgrade | grep "^Inst" | grep -i securi | awk -F " " {'print $2'} | xargs apt-get install;\ - rm -rf /var/lib/apt/lists - info: ~ - - curl: - name: yaml2json version: v1.3