From 90f5cf0f208b73c4868bdefcffa3d8d7206cf8f4 Mon Sep 17 00:00:00 2001 From: timdeluxe <5765175+timdeluxe@users.noreply.github.com> Date: Wed, 6 Dec 2023 11:18:44 +0100 Subject: [PATCH 01/42] feat: Adding azure relogin feature --- README.md | 9 ++++----- feature/kubernetes/install.sh | 1 + flavour/azure/flavour.yaml | 5 ++++- flavour/azure/flavourinit.sh | 17 +++++++++++++++++ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 722edbb..a2a6a4a 100644 --- a/README.md +++ b/README.md @@ -307,7 +307,10 @@ To start a new session in the CloudControl context, run `createSession ` Can be used to connect to infrastructure in the Azure cloud. Because we're using a container, a device login will happen, requiring the user to go to a website, enter a code and login. -This only happens once during initialization phase. + +The azure login tokens usually expire after some time. You can run the `azure-relogin` script +(located in ~/bin, thus available without path) to re-execute the same login commands as the +initialization process does. #### Configuration @@ -774,7 +777,3 @@ flowchart TD click F "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/test.yml" "Test workflow" click H "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow" ```mermaid -github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow" -```mermaid -maid - diff --git a/feature/kubernetes/install.sh b/feature/kubernetes/install.sh index bd27a55..41c0215 100644 --- a/feature/kubernetes/install.sh +++ b/feature/kubernetes/install.sh @@ -21,6 +21,7 @@ EOF fi echo "#!/bin/sh" > ~/bin/k8s-relogin + echo "~/bin/azure-relogin" >> ~/bin/k8s-relogin AZ_DO_KUBELOGIN_CONVERT="${AZ_USE_ARM_SPI:-false}" for CLUSTER in $(echo "${AZ_K8S_CLUSTERS}" | tr "," "\n"); do diff --git a/flavour/azure/flavour.yaml b/flavour/azure/flavour.yaml index 4946c93..f65a3b6 100644 --- a/flavour/azure/flavour.yaml +++ b/flavour/azure/flavour.yaml @@ -2,7 +2,10 @@ title: "[Azure](https://github.com/dodevops/cloudcontrol/pkgs/container/cloudcon description: | Can be used to connect to infrastructure in the Azure cloud. Because we're using a container, a device login will happen, requiring the user to go to a website, enter a code and login. - This only happens once during initialization phase. + + The azure login tokens usually expire after some time. You can run the `azure-relogin` script + (located in ~/bin, thus available without path) to re-execute the same login commands as the + initialization process does. configuration: - "Environment AZ_SUBSCRIPTION: The Azure subscription to use in this container" - "Environment AZ_TENANTID: The Azure tenant id to log into (optional)" diff --git a/flavour/azure/flavourinit.sh b/flavour/azure/flavourinit.sh index 3ae6c5a..8bf5c9e 100644 --- a/flavour/azure/flavourinit.sh +++ b/flavour/azure/flavourinit.sh @@ -19,6 +19,20 @@ then exit 1 fi +echo "#!/bin/sh" > ~/bin/azure-relogin +cat <>~/bin/azure-relogin +AZ_ACCOUNT_SHOW_OUTPUT="$(az account show 2>&1)" +if [ $? -eq 0 ]; then + echo "Azure login still valid, no relogin required" + exit 0 +else + echo "Azure login expired, relogin required, see following error:" + echo "${AZ_ACCOUNT_SHOW_OUTPUT}" + echo "Performing relogin now..." +fi +EOF +echo az login "${tenantArg[@]}" >> ~/bin/azure-relogin + if [ "X${AZ_SUBSCRIPTION}X" == "XX" ] then echo -n "* Subscription: " @@ -32,6 +46,9 @@ then echo "Can not set subscription" exit 1 fi +echo az account set --subscription "${AZ_SUBSCRIPTION}" >> ~/bin/azure-relogin + +chmod +x ~/bin/azure-relogin echo "Preparing bashrc" cat <>~/.bashrc From 12f9af0fddcc4361432cf74fde4bee2bfdbc07c8 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Thu, 7 Dec 2023 13:08:47 +0100 Subject: [PATCH 02/42] feat: Support krew closes #95 --- feature/krew/feature.yaml | 6 +++++ feature/krew/goss/.env | 1 + feature/krew/goss/goss.yaml | 11 +++++++++ feature/krew/install.sh | 49 +++++++++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 feature/krew/feature.yaml create mode 100644 feature/krew/goss/.env create mode 100644 feature/krew/goss/goss.yaml create mode 100644 feature/krew/install.sh diff --git a/feature/krew/feature.yaml b/feature/krew/feature.yaml new file mode 100644 index 0000000..78b16a1 --- /dev/null +++ b/feature/krew/feature.yaml @@ -0,0 +1,6 @@ +icon: "🟦" +title: "krew" +description: "Installs [Krew](https://krew.sigs.k8s.io/)" +configuration: + - "Environment KREW_VERSION (optional): Valid Krew version to install (defaults to latest)" + - "Environment KREW_PLUGINS (optional): A comma separated list of kubectl plugins to install via krew" diff --git a/feature/krew/goss/.env b/feature/krew/goss/.env new file mode 100644 index 0000000..b14f529 --- /dev/null +++ b/feature/krew/goss/.env @@ -0,0 +1 @@ +KREW_PLUGINS=example \ No newline at end of file diff --git a/feature/krew/goss/goss.yaml b/feature/krew/goss/goss.yaml new file mode 100644 index 0000000..946ce59 --- /dev/null +++ b/feature/krew/goss/goss.yaml @@ -0,0 +1,11 @@ +command: + krew: + exec: "/home/cloudcontrol/.krew/bin/kubectl-krew version" + exit-status: 0 + stdout: + - "/home/cloudcontrol/.krew" + krew-plugins: + exec: "/home/cloudcontrol/.krew/bin/kubectl-krew list" + exit-status: 0 + stdout: + - "example" diff --git a/feature/krew/install.sh b/feature/krew/install.sh new file mode 100644 index 0000000..ba2dd69 --- /dev/null +++ b/feature/krew/install.sh @@ -0,0 +1,49 @@ +. /feature-installer-utils.sh + +if [ -n "${KREW_VERSION}" ] +then + KREW_VERSION=$(checkAndCleanVersion "${KREW_VERSION}") +else + KREW_VERSION="latest" +fi + +FLAVOUR="X$(cat /home/cloudcontrol/flavour)X" +if [[ "X${FLAVOUR}X" =~ X(azure|simple|tanzu|gcloud)X ]] +then + execHandle 'Installing git' sudo apk add git +elif [ "${FLAVOUR}" == "XawsX" ] +then + execHandle 'Installing git' sudo yum install -y git +fi + +TEMPDIR=$(mktemp -d) +cd "${TEMPDIR}" || exit + +ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" +KREW="krew-linux_${ARCH}" +execHandle "Downloading krew" curl -f -s -L "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" --output "${KREW}.tar.gz" +execHandle "Unpacking krew" tar zxvf "${KREW}.tar.gz" &>/dev/null +execHandle "Installing krew" "./${KREW}" install krew + +if [ -n "${KREW_PLUGINS}" ] +then + IFS=',' read -r -a krew_plugins_array <<< "${KREW_PLUGINS:=""}" + for plugin in "${krew_plugins_array[@]}" + do + execHandle "Installing kubectl plugin $plugin" "./${KREW}" install "${plugin}" + done +fi + +if [[ $(cat /home/cloudcontrol/.shell) == "fish" ]] +then + cat <> ~/.config/fish/conf.d/krew.fish + set -gx PATH $PATH $HOME/.krew/bin +EOF +else + cat <> /home/cloudcontrol/.bashrc + export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" +EOF +fi + +cd - &>/dev/null || exit +rm -rf "${TEMPDIR}" From 6d090e992a466594311a2abb92846185459e2196 Mon Sep 17 00:00:00 2001 From: DO! DevOps bot Date: Thu, 7 Dec 2023 12:09:16 +0000 Subject: [PATCH 03/42] docs: Automatic docs update --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 722edbb..5eafb6c 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Following features and tools are supported: * ⛵️ Helm * 🛠 JQ * ⌨️ kc Quick Kubernetes Context switch +* 🟦 krew * 🐚 Kubectlnodeshell * 🐳 Kubernetes * 📦 Packages @@ -57,6 +58,7 @@ Following features and tools are supported: * [Helm](#helm) * [JQ](#jq) * [kc Quick Kubernetes Context switch](#kc) + * [krew](#krew) * [Kubectlnodeshell](#kubectlnodeshell) * [Kubernetes](#kubernetes) * [Packages](#packages) @@ -433,6 +435,17 @@ Installs [kc](https://github.com/dodevops/cloudcontrol/blob/master/feature/kc/kc * USE_kc: Enable this feature * DEBUG_kc: Debug this feature +### krew + +Installs [Krew](https://krew.sigs.k8s.io/) + +#### Configuration + +* USE_krew: Enable this feature +* DEBUG_krew: Debug this feature +* Environment KREW_VERSION (optional): Valid Krew version to install (defaults to latest) +* Environment KREW_PLUGINS (optional): A comma separated list of kubectl plugins to install via krew + ### Kubectlnodeshell Installs [kubectl node-shell](https://github.com/kvaps/kubectl-node-shell) @@ -774,7 +787,3 @@ flowchart TD click F "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/test.yml" "Test workflow" click H "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow" ```mermaid -github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow" -```mermaid -maid - From 271e8d31b9d5c75ba07d3b064678a887bbb990d7 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Mon, 11 Dec 2023 13:28:29 +0100 Subject: [PATCH 04/42] feat: Optimized test runner to work more smoothly Added .might-fail feature go dep updates BREAKING CHANGE: Removed bitwarden feature --- .github/workflows/test.yml | 2 +- README.md | 33 ++++++-------- README.md.gotmpl | 22 ++++++---- cmd/tests/test-features.go | 15 +++++-- feature/azcopy/goss/.might-fail | 1 + feature/azcopy/goss/goss.yaml | 4 +- go.mod | 27 +++++++----- go.sum | 32 ++++++++++++++ internal/tests/lib/container/docker.go | 3 +- internal/tests/lib/testRunner.go | 61 ++++++++++++++++++++++---- 10 files changed, 145 insertions(+), 55 deletions(-) create mode 100644 feature/azcopy/goss/.might-fail diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b17dd9c..9f306b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -107,7 +107,7 @@ jobs: curl -sL "https://github.com/goss-org/goss/releases/download/${{ env.GOSSVERSION }}/goss-${GOSS_ARCH}" -o goss chmod +x goss go build cmd/tests/test-features.go - ./test-features -f ${{ matrix.flavour }} -i test-image-${{ matrix.flavour }}-${{ matrix.arch}}:local -p ${{ matrix.arch }} -t ${PWD}/.testbed -g ${PWD}/goss -l debug + ./test-features -c -f ${{ matrix.flavour }} -i test-image-${{ matrix.flavour }}-${{ matrix.arch }}:local -p ${{ matrix.arch }} -t ${PWD}/.testbed -g ${PWD}/goss -l debug - name: Cleanup run: | rm -rf .testbed diff --git a/README.md b/README.md index 3a2bdf6..c9c43b6 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ Currently supported cloud flavours are: Following features and tools are supported: * 🐟 Fish Shell * 📷 AzCopy -* 🔐 Bitwarden * 🪪 Certificates * ⚙️ Direnv * ⛵️ Helm @@ -52,7 +51,6 @@ Following features and tools are supported: * [Features](#features) * [Fish Shell](#_fish) * [AzCopy](#azcopy) - * [Bitwarden](#bitwarden) * [Certificates](#certificates) * [Direnv](#direnv) * [Helm](#helm) @@ -373,15 +371,6 @@ Installs [AzCopy](https://github.com/Azure/azure-storage-azcopy) * USE_azcopy: Enable this feature * DEBUG_azcopy: Debug this feature -### Bitwarden - -Installs the [Bitwarden CLI](https://bitwarden.com/help/cli/) - -#### Configuration - -* USE_bitwarden: Enable this feature -* DEBUG_bitwarden: Debug this feature - ### Certificates Adds specified trusted certificate authorities into the container @@ -728,20 +717,19 @@ To build all flavours with the same tag, use ## Testing To run the test suite for a specific flavour, you need to create a local directory that holds flavour-specific data -(e.g. keys for authentication) and optionally an .env-file with flavour-specific environment variables. +(e.g. keys for authentication) and optionally an .env-file with flavour-specific environment variables. This is called + a "testbed" directory. First, you need to compile the test runner: - cd tests - docker run --rm -e GOOS=[os, e.g. darwin, linux, windows] -e GOARCH=[architecture, e.g. arm64, amd64] -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.19-alpine go build -o test-features + docker run --rm -e GOOS=[os, e.g. darwin, linux, windows] -e GOARCH=[architecture, e.g. arm64, amd64] -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.19-alpine go build -o test-features cmd/tests/test-features After that, download the latest goss binary for the target architecture you will test (linux/amd64 or linux/arm64) from the [Goss site](https://github.com/goss-org/goss) and put it somewhere local. Once that is done, run the tests like following: - cd tests - ./test-features -f [flavour] -i [image:tag] -t [path to flavour-data] -p [test architecture, e.g. linux/amd64] -g [path to the goss binary] + ./test-features -f [flavour] -i [image:tag] -t [path to testbed directory] -p [test architecture, e.g. linux/amd64] -g [path to the goss binary] This will run the tests of all features that supply a test suite one by one and, if all succeed, will test all features together for integration testing. Check out `test-features --help` for other options. @@ -755,12 +743,19 @@ When the testrunner encounters such file it will check if CloudControl fails to You can add a regular expression pattern into `.will-fail` to test if the container or command output matches it. +### Unstable tests + +As we're dealing with a lot of moving targets in the features, sometimes a test might not be reliable. For these +situations we support a .might-fail file. Just add it as a text file into the test suite subdirectory and put some text +into it describing the problem. Failed test won't fail the test suite then but instead the description will be shown. + ### Test debugging -To check why a test failed, run the test-runner using the -x bash parameter to see the different commands it issues. +To check why a test failed, use the -l parameter to enable debug logging. Additionally, you can use the -n parameter +to specify the specific feature to test and use the -x parameter to stop testing if one test fails. -Then, take the failing command and instead of `dgoss run` execute `docker run` with the same arguments to analyze the -tests locally. +When a test fails, the test container will not be removed automatically (unless you specified the -c parameter), so +you can inspect the failing container as well. ## Building documentation ## diff --git a/README.md.gotmpl b/README.md.gotmpl index 01b3b70..07fb2ee 100644 --- a/README.md.gotmpl +++ b/README.md.gotmpl @@ -384,20 +384,19 @@ To build all flavours with the same tag, use ## Testing To run the test suite for a specific flavour, you need to create a local directory that holds flavour-specific data -(e.g. keys for authentication) and optionally an .env-file with flavour-specific environment variables. +(e.g. keys for authentication) and optionally an .env-file with flavour-specific environment variables. This is called + a "testbed" directory. First, you need to compile the test runner: - cd tests - docker run --rm -e GOOS=[os, e.g. darwin, linux, windows] -e GOARCH=[architecture, e.g. arm64, amd64] -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.19-alpine go build -o test-features + docker run --rm -e GOOS=[os, e.g. darwin, linux, windows] -e GOARCH=[architecture, e.g. arm64, amd64] -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.19-alpine go build -o test-features cmd/tests/test-features After that, download the latest goss binary for the target architecture you will test (linux/amd64 or linux/arm64) from the [Goss site](https://github.com/goss-org/goss) and put it somewhere local. Once that is done, run the tests like following: - cd tests - ./test-features -f [flavour] -i [image:tag] -t [path to flavour-data] -p [test architecture, e.g. linux/amd64] -g [path to the goss binary] + ./test-features -f [flavour] -i [image:tag] -t [path to testbed directory] -p [test architecture, e.g. linux/amd64] -g [path to the goss binary] This will run the tests of all features that supply a test suite one by one and, if all succeed, will test all features together for integration testing. Check out `test-features --help` for other options. @@ -411,12 +410,19 @@ When the testrunner encounters such file it will check if CloudControl fails to You can add a regular expression pattern into `.will-fail` to test if the container or command output matches it. +### Unstable tests + +As we're dealing with a lot of moving targets in the features, sometimes a test might not be reliable. For these +situations we support a .might-fail file. Just add it as a text file into the test suite subdirectory and put some text +into it describing the problem. Failed test won't fail the test suite then but instead the description will be shown. + ### Test debugging -To check why a test failed, run the test-runner using the -x bash parameter to see the different commands it issues. +To check why a test failed, use the -l parameter to enable debug logging. Additionally, you can use the -n parameter +to specify the specific feature to test and use the -x parameter to stop testing if one test fails. -Then, take the failing command and instead of `dgoss run` execute `docker run` with the same arguments to analyze the -tests locally. +When a test fails, the test container will not be removed automatically (unless you specified the -c parameter), so +you can inspect the failing container as well. ## Building documentation ## diff --git a/cmd/tests/test-features.go b/cmd/tests/test-features.go index 2282ef3..7250e7a 100644 --- a/cmd/tests/test-features.go +++ b/cmd/tests/test-features.go @@ -138,8 +138,7 @@ func main() { includeFeatures := parser.List("n", "include", &argparse.Options{Help: "Only include these features when testing"}) excludeFeatures := parser.List("e", "exclude", &argparse.Options{Help: "Exclude these features when testing"}) skipIntegrationTest := parser.Flag("s", "skip-integration", &argparse.Options{ - Help: "Skip integration test at the end", - Default: false, + Help: "Skip integration test at the end", }) maxWait := parser.Int("w", "wait", &argparse.Options{ Help: "Maximum number of seconds goss_wait should wait", @@ -149,6 +148,12 @@ func main() { Help: "Loglevel to use", Default: "error", }) + failFast := parser.Flag("x", "failfast", &argparse.Options{ + Help: "Whether to stop testing directly when one test failes", + }) + cleanup := parser.Flag("c", "cleanup", &argparse.Options{ + Help: "Clean up container in case of error", + }) err := parser.Parse(os.Args) if err != nil { @@ -272,7 +277,7 @@ func main() { for _, feature := range featuresToTest { var featureTimer = time.Now() - if err := lib.TestFeature(feature, testBed, containerAdapter); err != nil { + if err := lib.TestFeature(feature, testBed, containerAdapter, *cleanup); err != nil { logrus.Errorf( "❌ %s (%s) ⏱ %ds :\n\n%s\n", feature.Name, @@ -285,6 +290,10 @@ func main() { ErrorMessage: err.Error(), ElapsedSeconds: int(math.Round(time.Since(featureTimer).Seconds())), }) + if *failFast { + logrus.Error("Failfast activated, so failing directly.") + os.Exit(1) + } } else { logrus.Infof( "✅ %s (%s) ⏱ %ds", diff --git a/feature/azcopy/goss/.might-fail b/feature/azcopy/goss/.might-fail new file mode 100644 index 0000000..545ab2e --- /dev/null +++ b/feature/azcopy/goss/.might-fail @@ -0,0 +1 @@ +Might fail because of https://github.com/Azure/azure-storage-azcopy/issues/2483 \ No newline at end of file diff --git a/feature/azcopy/goss/goss.yaml b/feature/azcopy/goss/goss.yaml index 1fa0616..cd84c9f 100644 --- a/feature/azcopy/goss/goss.yaml +++ b/feature/azcopy/goss/goss.yaml @@ -1,6 +1,6 @@ command: azcopy: - exec: "/home/cloudcontrol/bin/azcopy --version" + exec: "/home/cloudcontrol/bin/azcopy --help" exit-status: 0 stdout: - - azcopy version + - AzCopy diff --git a/go.mod b/go.mod index a432475..4c47b05 100644 --- a/go.mod +++ b/go.mod @@ -6,10 +6,10 @@ require ( github.com/MakeNowJust/heredoc v1.0.0 github.com/Masterminds/sprig/v3 v3.2.3 github.com/akamensky/argparse v1.4.0 - github.com/docker/docker v20.10.22+incompatible - github.com/opencontainers/image-spec v1.0.2 - github.com/otiai10/copy v1.9.0 - github.com/sirupsen/logrus v1.9.0 + github.com/docker/docker v24.0.7+incompatible + github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b + github.com/otiai10/copy v1.14.0 + github.com/sirupsen/logrus v1.9.3 github.com/thoas/go-funk v0.9.3 gopkg.in/yaml.v3 v3.0.1 ) @@ -17,14 +17,16 @@ require ( require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.0 // indirect - github.com/Microsoft/go-winio v0.6.0 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/containerd/containerd v1.7.11 // indirect + github.com/containerd/log v0.1.0 // indirect github.com/docker/distribution v2.8.1+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/uuid v1.1.1 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/huandu/xstrings v1.3.3 // indirect - github.com/imdario/mergo v0.3.11 // indirect + github.com/imdario/mergo v0.3.13 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.0 // indirect github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect @@ -33,11 +35,12 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/spf13/cast v1.3.1 // indirect - golang.org/x/crypto v0.3.0 // indirect - golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect - golang.org/x/net v0.2.0 // indirect - golang.org/x/sys v0.2.0 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/mod v0.11.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.1.12 // indirect + golang.org/x/tools v0.10.0 // indirect gotest.tools/v3 v3.4.0 // indirect ) diff --git a/go.sum b/go.sum index 9debe30..0c26192 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,14 @@ github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/akamensky/argparse v1.4.0 h1:YGzvsTqCvbEZhL8zZu2AiA5nq805NZh75JNj4ajn1xc= github.com/akamensky/argparse v1.4.0/go.mod h1:S5kwC7IuDcEr5VeXtGPRVZ5o/FdhcMlQz4IZQuw64xA= +github.com/containerd/containerd v1.7.11 h1:lfGKw3eU35sjV0aG2eYZTiwFEY1pCzxdzicHP3SZILw= +github.com/containerd/containerd v1.7.11/go.mod h1:5UluHxHTX2rdvYuZ5OJTC5m/KJNs0Zs9wVoJm9zf5ZE= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -18,6 +24,8 @@ github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6 github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v20.10.22+incompatible h1:6jX4yB+NtcbldT90k7vBSaWJDB3i+zkVJT9BEK8kQkk= github.com/docker/docker v20.10.22+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= +github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -28,10 +36,14 @@ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= @@ -46,13 +58,18 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8= +github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/otiai10/copy v1.9.0 h1:7KFNiCgZ91Ru4qW4CWPf/7jqtxLagGRmIxWldPP9VY4= github.com/otiai10/copy v1.9.0/go.mod h1:hsfX19wcn0UWIHUQ3/4fHuehhk2UyArQ9dVFAn3FczI= +github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= +github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/otiai10/mint v1.4.0 h1:umwcf7gbpEwf7WFzqmWwSv0CzbeMsae2u9ZvpP8j2q4= github.com/otiai10/mint v1.4.0/go.mod h1:gifjb2MYOoULtKLqUAEILUG/9KONW6f7YsJ6vQLTlFI= +github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -61,6 +78,8 @@ github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXY github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -80,10 +99,14 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -92,10 +115,14 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -107,6 +134,8 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -123,6 +152,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= +golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -133,6 +164,7 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= diff --git a/internal/tests/lib/container/docker.go b/internal/tests/lib/container/docker.go index 46fe9da..0faec44 100644 --- a/internal/tests/lib/container/docker.go +++ b/internal/tests/lib/container/docker.go @@ -72,7 +72,7 @@ func (d DockerAdapter) FindImage(image string, platform string) error { if len(localImages) == 0 { remoteImages, err := dockerCli.ImageSearch(context.Background(), image, types.ImageSearchOptions{Limit: 1}) - if err != nil { + if err != nil && !strings.Contains(err.Error(), "404") { panic(fmt.Sprintf("Can not search remote images: %s", err.Error())) } if len(remoteImages) == 0 { @@ -137,6 +137,7 @@ func (d DockerAdapter) StopContainer(containerID string) error { } func (d DockerAdapter) RunCommand(containerID string, cmd []string) (string, error) { + logrus.Debugf("Running command %s on container %s", strings.Join(cmd, " "), containerID) dockerCli := d.getClient() var executeID string if idResponse, err := dockerCli.ContainerExecCreate(context.Background(), containerID, types.ExecConfig{ diff --git a/internal/tests/lib/testRunner.go b/internal/tests/lib/testRunner.go index e18187b..739e2f6 100644 --- a/internal/tests/lib/testRunner.go +++ b/internal/tests/lib/testRunner.go @@ -26,7 +26,7 @@ file: ` // TestFeature tests a specific feature. -func TestFeature(feature Feature, testBed TestBed, containerAdapter container.AdapterBase) error { +func TestFeature(feature Feature, testBed TestBed, containerAdapter container.AdapterBase, cleanup bool) error { var testSuites []string if testSuitesGlob, err := filepath.Glob(filepath.Join(feature.FullPath, "goss*")); err != nil { return fmt.Errorf("error searching for testsuites in %s: %w", feature.FullPath, err) @@ -47,8 +47,11 @@ func TestFeature(feature Feature, testBed TestBed, containerAdapter container.Ad containerErr := func() error { var testDir string + var hasProblems = false var willFail = false var failPattern = ".*" + var mightFail = false + var mightFailDescription = "" if _, err := os.Stat(filepath.Join(testSuite, ".will-fail")); err == nil { willFail = true @@ -60,6 +63,16 @@ func TestFeature(feature Feature, testBed TestBed, containerAdapter container.Ad } } + if _, err := os.Stat(filepath.Join(testSuite, ".might-fail")); err == nil { + mightFail = true + logrus.Debug("Found .might-fail file, test might fail.") + if tmp, err := os.ReadFile(filepath.Join(testSuite, ".might-fail")); err != nil { + return fmt.Errorf("loading the contents of %s failed: %w", filepath.Join(testSuite, ".might-fail"), err) + } else { + mightFailDescription = strings.TrimSuffix(string(tmp), "\n") + } + } + if tempReturn, err := os.MkdirTemp("", "cctest-*"); err != nil { return fmt.Errorf("error creating temporary directory for testbed: %w", err) } else { @@ -87,7 +100,7 @@ func TestFeature(feature Feature, testBed TestBed, containerAdapter container.Ad if _, err := fileutils.CopyFile( filepath.Join(testSuite, "goss.yaml"), filepath.Join(testDir, "goss.yaml"), - ); err != nil && !willFail { + ); err != nil && !willFail && !mightFail { return fmt.Errorf("can not copy goss.yaml: %w", err) } @@ -144,15 +157,24 @@ func TestFeature(feature Feature, testBed TestBed, containerAdapter container.Ad binds, testBed.Platform, ); err != nil { + hasProblems = true return fmt.Errorf("error starting container: %w", err) } else { + logrus.Debugf("Started container %s", startedContainerId) containerId = startedContainerId } // deferring the removal of the container defer func() { - if err := containerAdapter.StopContainer(containerId); err != nil { - panic(fmt.Errorf("can not stop goss container: %w", err)) + if cleanup || !hasProblems { + logrus.Debugf("Stopping container %s", containerId) + if err := containerAdapter.StopContainer(containerId); err != nil { + panic(fmt.Errorf("can not stop goss container: %w", err)) + } else { + logrus.Debugf("Stopped container with id %s", containerId) + } + } else { + logrus.Debugf("Not stopping container because cleanup was disabled and problems exist.") } }() @@ -168,11 +190,14 @@ func TestFeature(feature Feature, testBed TestBed, containerAdapter container.Ad var runCommandError *container.RunCommandError switch { case errors.As(err, &runCommandError): - if !willFail { + if mightFail { + logrus.Warnf("Waiting for Goss in %s failed with %s, but it might fail because: \n%s", testSuite, err.Error(), mightFailDescription) + } else if !willFail { + hasProblems = true return &GossError{ returnCode: runCommandError.ReturnCode, logOutput: fmt.Sprintf( - "Command output:\n%s\n\nContainer output:\n%s\n&s", + "Command output:\n%s\n\nContainer output:\n%s\n%s", runCommandError.CommandOutput, runCommandError.ContainerOutput, runCommandError.Error(), @@ -182,6 +207,7 @@ func TestFeature(feature Feature, testBed TestBed, containerAdapter container.Ad failPattern, []byte(fmt.Sprintf("%s%s", runCommandError.CommandOutput, runCommandError.ContainerOutput)), ); err != nil || !found { + hasProblems = true return &GossError{ returnCode: 0, logOutput: fmt.Sprintf( @@ -194,9 +220,12 @@ func TestFeature(feature Feature, testBed TestBed, containerAdapter container.Ad } } default: - return err + if !willFail && !mightFail { + return err + } } } else if err == nil && willFail { + hasProblems = true return &GossError{ returnCode: 0, logOutput: fmt.Sprintf("Container was created successfully when it shouldn't have been: %s", waitOutput), @@ -216,7 +245,10 @@ func TestFeature(feature Feature, testBed TestBed, containerAdapter container.Ad "documentation", }, ); err != nil { - if !willFail { + if mightFail { + logrus.Warnf("Testing %s failed with %s, but it might fail because: \n%s", testSuite, err.Error(), mightFailDescription) + } else if !willFail { + hasProblems = true var runCommandError *container.RunCommandError switch { case errors.As(err, &runCommandError): @@ -229,10 +261,13 @@ func TestFeature(feature Feature, testBed TestBed, containerAdapter container.Ad ), } default: - return err + if !willFail && !mightFail { + return err + } } } } else if err == nil && willFail { + hasProblems = true return &GossError{ returnCode: 0, logOutput: "Container was created successfully when it shouldn't have been.", @@ -296,6 +331,14 @@ func IntegrationTests(features []Feature, testBed TestBed, containerAdapter cont ) continue } + if _, err := os.Stat(filepath.Join(testSuite, ".might-fail")); err == nil { + logrus.Infof( + "Test %s for feature %s is ignored for integration testing, because it might fail", + filepath.Base(testSuite), + feature.Name, + ) + continue + } envs = append(envs, fmt.Sprintf("USE_%s=yes", feature.Name)) for _, envFile := range []string{ From 876a83c617534755a79aaca7b7425a4e52cfd080 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Mon, 18 Dec 2023 09:28:57 +0100 Subject: [PATCH 05/42] fix: Removed bitwarden because of very unstable implementation BREAKING CHANGE: Bitwarden feature not available anymore --- feature/bitwarden/feature.yaml | 3 --- feature/bitwarden/goss/goss.yaml | 5 ----- feature/bitwarden/install.sh | 11 ----------- 3 files changed, 19 deletions(-) delete mode 100644 feature/bitwarden/feature.yaml delete mode 100644 feature/bitwarden/goss/goss.yaml delete mode 100644 feature/bitwarden/install.sh diff --git a/feature/bitwarden/feature.yaml b/feature/bitwarden/feature.yaml deleted file mode 100644 index 7b2bf02..0000000 --- a/feature/bitwarden/feature.yaml +++ /dev/null @@ -1,3 +0,0 @@ -icon: "🔐" -title: "Bitwarden" -description: "Installs the [Bitwarden CLI](https://bitwarden.com/help/cli/)" diff --git a/feature/bitwarden/goss/goss.yaml b/feature/bitwarden/goss/goss.yaml deleted file mode 100644 index 378f2fc..0000000 --- a/feature/bitwarden/goss/goss.yaml +++ /dev/null @@ -1,5 +0,0 @@ -command: - bw: - exec: "/home/cloudcontrol/bin/bw --version" - exit-status: 0 - timeout: 30000 diff --git a/feature/bitwarden/install.sh b/feature/bitwarden/install.sh deleted file mode 100644 index 1222b16..0000000 --- a/feature/bitwarden/install.sh +++ /dev/null @@ -1,11 +0,0 @@ -. /feature-installer-utils.sh - -FLAVOUR="X$(cat /home/cloudcontrol/flavour)X" -if [[ "X${FLAVOUR}X" =~ X(azure|simple|tanzu|gcloud)X ]] -then - execHandle "Installing required libraries" sudo apk add nodejs npm -fi - -cd ~ || exit 1 -execHandle "Installing bitwarden client" npm install @bitwarden/cli -execHandle "Linking bitwarden client" ln -s /home/cloudcontrol/node_modules/.bin/bw bin/bw From fa3081817646ddee4383064c02a34a6a3a63b9ad Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Mon, 18 Dec 2023 10:49:04 +0100 Subject: [PATCH 06/42] fix: Fixed krew installation messing up the path variable Optimized testrunner during this --- feature/krew/goss.fish/.env | 2 ++ feature/krew/goss.fish/.ignore-integration | 0 feature/krew/goss.fish/goss.yaml | 17 +++++++++++++++ feature/krew/goss/goss.yaml | 6 ++++++ feature/krew/install.sh | 4 ++-- internal/tests/lib/testRunner.go | 24 ++++++++++++++++------ 6 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 feature/krew/goss.fish/.env create mode 100644 feature/krew/goss.fish/.ignore-integration create mode 100644 feature/krew/goss.fish/goss.yaml diff --git a/feature/krew/goss.fish/.env b/feature/krew/goss.fish/.env new file mode 100644 index 0000000..df1a2ff --- /dev/null +++ b/feature/krew/goss.fish/.env @@ -0,0 +1,2 @@ +KREW_PLUGINS=example +USE_fish=yes \ No newline at end of file diff --git a/feature/krew/goss.fish/.ignore-integration b/feature/krew/goss.fish/.ignore-integration new file mode 100644 index 0000000..e69de29 diff --git a/feature/krew/goss.fish/goss.yaml b/feature/krew/goss.fish/goss.yaml new file mode 100644 index 0000000..cfb004b --- /dev/null +++ b/feature/krew/goss.fish/goss.yaml @@ -0,0 +1,17 @@ +command: + krew: + exec: "/home/cloudcontrol/.krew/bin/kubectl-krew version" + exit-status: 0 + stdout: + - "/home/cloudcontrol/.krew" + krew-plugins: + exec: "/home/cloudcontrol/.krew/bin/kubectl-krew list" + exit-status: 0 + stdout: + - "example" + path-includes-home: + exec: "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/cloudcontrol/bin && fish -c 'echo $PATH'" + exit-status: 0 + stdout: + - "/home/cloudcontrol/bin" + - "/home/cloudcontrol/.krew/bin" diff --git a/feature/krew/goss/goss.yaml b/feature/krew/goss/goss.yaml index 946ce59..3ca2a71 100644 --- a/feature/krew/goss/goss.yaml +++ b/feature/krew/goss/goss.yaml @@ -9,3 +9,9 @@ command: exit-status: 0 stdout: - "example" + path-includes-home: + exec: "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin && . /usr/local/bin/cloudcontrol run && . /home/cloudcontrol/.bashrc && echo $PATH" + exit-status: 0 + stdout: + - "/home/cloudcontrol/bin" + - "/home/cloudcontrol/.krew/bin" diff --git a/feature/krew/install.sh b/feature/krew/install.sh index ba2dd69..c1af8b1 100644 --- a/feature/krew/install.sh +++ b/feature/krew/install.sh @@ -37,11 +37,11 @@ fi if [[ $(cat /home/cloudcontrol/.shell) == "fish" ]] then cat <> ~/.config/fish/conf.d/krew.fish - set -gx PATH $PATH $HOME/.krew/bin + set -gx PATH \$PATH \$HOME/.krew/bin EOF else cat <> /home/cloudcontrol/.bashrc - export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" + export PATH="\${KREW_ROOT:-\$HOME/.krew}/bin:\$PATH" EOF fi diff --git a/internal/tests/lib/testRunner.go b/internal/tests/lib/testRunner.go index 739e2f6..274a375 100644 --- a/internal/tests/lib/testRunner.go +++ b/internal/tests/lib/testRunner.go @@ -82,8 +82,12 @@ func TestFeature(feature Feature, testBed TestBed, containerAdapter container.Ad return fmt.Errorf("error chmodding temporary directory to 0777: %w", err) } defer func() { - if err := os.RemoveAll(testDir); err != nil { - panic(fmt.Errorf("can not remove temporary directory: %w", err)) + if cleanup || !hasProblems { + if err := os.RemoveAll(testDir); err != nil { + panic(fmt.Errorf("can not remove temporary directory: %w", err)) + } + } else { + logrus.Infof("Not removing temporary directory %s because cleanup wasn't enabled.", testDir) } }() logrus.Debugf("Preparing test suite in %s", testDir) @@ -237,12 +241,16 @@ func TestFeature(feature Feature, testBed TestBed, containerAdapter container.Ad containerId, []string{ "/goss/goss", - "-g", + "--gossfile", "/goss/goss.yaml", + "--loglevel", + "DEBUG", "validate", - "--color", "--format", "documentation", + "--format-options", + "verbose", + "--no-color", }, ); err != nil { if mightFail { @@ -480,12 +488,16 @@ func IntegrationTests(features []Feature, testBed TestBed, containerAdapter cont containerId, []string{ "/goss/goss", - "-g", + "--gossfile", "/goss/goss.yaml", + "--loglevel", + "DEBUG", "validate", - "--color", "--format", "documentation", + "--format-options", + "verbose", + "--no-color", }, ); err != nil { var runCommandError *container.RunCommandError From 979dcdfbdffcf8aed0f7b1ed9b50c466437e543d Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Mon, 18 Dec 2023 10:53:05 +0100 Subject: [PATCH 07/42] fix: Updated goss to work with optimized testrunner --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f306b4..d179c75 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ on: - pull_request env: - GOSSVERSION: v0.3.21 + GOSSVERSION: v0.4.4 jobs: test: From 4686af24fe5df3c7f2c04b6c18ea88a7a0285af7 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Mon, 18 Dec 2023 11:26:17 +0100 Subject: [PATCH 08/42] fix: Moved integration skip to the bash version of the feature test --- feature/krew/{goss => goss.bash}/.env | 0 feature/krew/{goss.fish => goss.bash}/.ignore-integration | 0 feature/krew/{goss => goss.bash}/goss.yaml | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename feature/krew/{goss => goss.bash}/.env (100%) rename feature/krew/{goss.fish => goss.bash}/.ignore-integration (100%) rename feature/krew/{goss => goss.bash}/goss.yaml (100%) diff --git a/feature/krew/goss/.env b/feature/krew/goss.bash/.env similarity index 100% rename from feature/krew/goss/.env rename to feature/krew/goss.bash/.env diff --git a/feature/krew/goss.fish/.ignore-integration b/feature/krew/goss.bash/.ignore-integration similarity index 100% rename from feature/krew/goss.fish/.ignore-integration rename to feature/krew/goss.bash/.ignore-integration diff --git a/feature/krew/goss/goss.yaml b/feature/krew/goss.bash/goss.yaml similarity index 100% rename from feature/krew/goss/goss.yaml rename to feature/krew/goss.bash/goss.yaml From dbbfa9be5ffc148fbeb065994ce497cbd09fd798 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Tue, 19 Dec 2023 20:00:18 +0100 Subject: [PATCH 09/42] feat: Supports azure arm64 image --- .github/workflows/image.yml | 2 +- flavour/azure/flavour.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 90498da..8077969 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -22,7 +22,7 @@ jobs: - name: aws platforms: "linux/amd64,linux/arm64" - name: azure - platforms: "linux/amd64" + platforms: "linux/amd64,linux/arm64" - name: gcloud platforms: "linux/amd64,linux/arm64" - name: simple diff --git a/flavour/azure/flavour.yaml b/flavour/azure/flavour.yaml index f65a3b6..6653cdb 100644 --- a/flavour/azure/flavour.yaml +++ b/flavour/azure/flavour.yaml @@ -12,3 +12,4 @@ configuration: - "Environment AZ_USE_ARM_SPI: Uses the environment variables ARM_CLIENT_ID and ARM_CLIENT_SECRET for service principal auth [false]" platforms: - linux/amd64 + - linux/arm64 From e69fa5f006ad10da014c5b8a47e3c77cab8ed45c Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Tue, 19 Dec 2023 20:01:22 +0100 Subject: [PATCH 10/42] feat: Support ARM environment variable instead of special AZ variables This achieves better compatibility to the Azure CLI and Terraform. This DEPRECATES the AZ-environment variables. --- flavour/azure/flavour.yaml | 6 ++++-- flavour/azure/flavourinit.sh | 25 ++++++++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/flavour/azure/flavour.yaml b/flavour/azure/flavour.yaml index 6653cdb..598b323 100644 --- a/flavour/azure/flavour.yaml +++ b/flavour/azure/flavour.yaml @@ -7,8 +7,10 @@ description: | (located in ~/bin, thus available without path) to re-execute the same login commands as the initialization process does. configuration: - - "Environment AZ_SUBSCRIPTION: The Azure subscription to use in this container" - - "Environment AZ_TENANTID: The Azure tenant id to log into (optional)" + - "Environment AZ_SUBSCRIPTION: The Azure subscription to use in this container (deprecated)" + - "Environment ARM_SUBSCRIPTION_ID: The Azure subscription to use in this container" + - "Environment AZ_TENANTID: The Azure tenant id to log into (optional, deprecated)" + - "Environment ARM_TENANT_ID: The Azure tenant id to log into (optional)" - "Environment AZ_USE_ARM_SPI: Uses the environment variables ARM_CLIENT_ID and ARM_CLIENT_SECRET for service principal auth [false]" platforms: - linux/amd64 diff --git a/flavour/azure/flavourinit.sh b/flavour/azure/flavourinit.sh index 8bf5c9e..0d05d70 100644 --- a/flavour/azure/flavourinit.sh +++ b/flavour/azure/flavourinit.sh @@ -4,6 +4,12 @@ echo "Logging in..." tenantArg=() if [ "X${AZ_TENANTID}X" != "XX" ] +then + echo "Warning: This configuration uses the DEPRECATED AZ_TENANTID environment variable. Please use ARM_TENANT_ID instead." + ARM_TENANT_ID=${AZ_TENANTID} +fi + +if [ "X${ARM_TENANT_ID}X" != "XX" ] then tenantArg+=("--tenant" "${AZ_TENANTID}") fi @@ -15,7 +21,7 @@ fi if ! az login "${tenantArg[@]}" then - echo "Can not login into Azure" + echo "Error: Can not login into Azure" exit 1 fi @@ -35,18 +41,23 @@ echo az login "${tenantArg[@]}" >> ~/bin/azure-relogin if [ "X${AZ_SUBSCRIPTION}X" == "XX" ] then - echo -n "* Subscription: " - read -r AZ_SUBSCRIPTION - echo + echo "Warning: This configuration uses the DEPRECATED AZ_SUBSCRIPTION environment variable. Please use ARM_SUBSCRIPTION_ID instead." + ARM_SUBSCRIPTION_ID=$AZ_SUBSCRIPTION +fi + +if [ "X${ARM_SUBSCRIPTION_ID}X" == "XX" ] +then + echo -n "Error: Please specify a subscription using the environment variable ARM_SUBSCRIPTION_ID" + exit 1 fi echo "Setting subscription..." -if ! az account set --subscription "${AZ_SUBSCRIPTION}" +if ! az account set --subscription "${ARM_SUBSCRIPTION_ID}" then - echo "Can not set subscription" + echo "Error: Can not set subscription" exit 1 fi -echo az account set --subscription "${AZ_SUBSCRIPTION}" >> ~/bin/azure-relogin +echo az account set --subscription "${ARM_SUBSCRIPTION_ID}" >> ~/bin/azure-relogin chmod +x ~/bin/azure-relogin From 72662a135a018705976f66db178522dcd12e6f22 Mon Sep 17 00:00:00 2001 From: DO! DevOps bot Date: Tue, 19 Dec 2023 19:02:12 +0000 Subject: [PATCH 11/42] docs: Automatic docs update --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c9c43b6..ce874e7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ required and configured to manage modern cloud infrastructures. The toolbox comes in different "flavours" depending on what cloud you are working in. Currently supported cloud flavours are: * [AWS](https://github.com/dodevops/cloudcontrol/pkgs/container/cloudcontrol-aws) (based on [amazon/aws-cli](https://hub.docker.com/r/amazon/aws-cli)) [linux/amd64, linux/arm64] -* [Azure](https://github.com/dodevops/cloudcontrol/pkgs/container/cloudcontrol-azure) (based on [mcr.microsoft.com/azure-cli](https://hub.docker.com/_/microsoft-azure-cli)) [linux/amd64] +* [Azure](https://github.com/dodevops/cloudcontrol/pkgs/container/cloudcontrol-azure) (based on [mcr.microsoft.com/azure-cli](https://hub.docker.com/_/microsoft-azure-cli)) [linux/amd64, linux/arm64] * [Google Cloud](https://github.com/dodevops/cloudcontrol/pkgs/container/cloudcontrol-gcloud) (based on [google-cloud-cli](https://console.cloud.google.com/gcr/images/google.com:cloudsdktool/GLOBAL/google-cloud-cli)) [linux/amd64, linux/arm64] * [Simple](https://github.com/dodevops/cloudcontrol/pkgs/container/cloudcontrol-simple) (based on [alpine](https://hub.docker.com/_/alpine)) [linux/amd64, linux/arm64] * [Tanzu](https://github.com/dodevops/cloudcontrol/pkgs/container/cloudcontrol-tanzu) (based on [alpine](https://hub.docker.com/_/alpine)) [linux/amd64] @@ -314,8 +314,10 @@ initialization process does. #### Configuration -* Environment AZ_SUBSCRIPTION: The Azure subscription to use in this container -* Environment AZ_TENANTID: The Azure tenant id to log into (optional) +* Environment AZ_SUBSCRIPTION: The Azure subscription to use in this container (deprecated) +* Environment ARM_SUBSCRIPTION_ID: The Azure subscription to use in this container +* Environment AZ_TENANTID: The Azure tenant id to log into (optional, deprecated) +* Environment ARM_TENANT_ID: The Azure tenant id to log into (optional) * Environment AZ_USE_ARM_SPI: Uses the environment variables ARM_CLIENT_ID and ARM_CLIENT_SECRET for service principal auth [false] ### gcloud From fef840ab958e8d925816f83e5969f21ce95f56be Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Thu, 21 Dec 2023 13:10:51 +0100 Subject: [PATCH 12/42] docs: added note about timeframe for deprecation --- flavour/azure/flavourinit.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flavour/azure/flavourinit.sh b/flavour/azure/flavourinit.sh index 0d05d70..d69425c 100644 --- a/flavour/azure/flavourinit.sh +++ b/flavour/azure/flavourinit.sh @@ -5,7 +5,7 @@ tenantArg=() if [ "X${AZ_TENANTID}X" != "XX" ] then - echo "Warning: This configuration uses the DEPRECATED AZ_TENANTID environment variable. Please use ARM_TENANT_ID instead." + echo "Warning: This configuration uses the DEPRECATED AZ_TENANTID environment variable. Please use ARM_TENANT_ID instead. Support for this will be removed in the next major version after 10/2024." ARM_TENANT_ID=${AZ_TENANTID} fi @@ -41,7 +41,7 @@ echo az login "${tenantArg[@]}" >> ~/bin/azure-relogin if [ "X${AZ_SUBSCRIPTION}X" == "XX" ] then - echo "Warning: This configuration uses the DEPRECATED AZ_SUBSCRIPTION environment variable. Please use ARM_SUBSCRIPTION_ID instead." + echo "Warning: This configuration uses the DEPRECATED AZ_SUBSCRIPTION environment variable. Please use ARM_SUBSCRIPTION_ID instead. Support for this will be removed in the next major version after 10/2024." ARM_SUBSCRIPTION_ID=$AZ_SUBSCRIPTION fi From 8a7dc42941138d6678b88e9b4bf75811cf659a79 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Wed, 27 Dec 2023 13:22:43 +0100 Subject: [PATCH 13/42] fix: Fixed azure flavourinit --- flavour/azure/flavourinit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flavour/azure/flavourinit.sh b/flavour/azure/flavourinit.sh index d69425c..628117f 100644 --- a/flavour/azure/flavourinit.sh +++ b/flavour/azure/flavourinit.sh @@ -39,7 +39,7 @@ fi EOF echo az login "${tenantArg[@]}" >> ~/bin/azure-relogin -if [ "X${AZ_SUBSCRIPTION}X" == "XX" ] +if [ "X${AZ_SUBSCRIPTION}X" != "XX" ] then echo "Warning: This configuration uses the DEPRECATED AZ_SUBSCRIPTION environment variable. Please use ARM_SUBSCRIPTION_ID instead. Support for this will be removed in the next major version after 10/2024." ARM_SUBSCRIPTION_ID=$AZ_SUBSCRIPTION From 8bf02005b89bdde0f595595f2c2c2fa7e46813db Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Fri, 29 Dec 2023 07:34:14 +0100 Subject: [PATCH 14/42] fix: Fixed azure relogin script escaping --- flavour/azure/flavourinit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flavour/azure/flavourinit.sh b/flavour/azure/flavourinit.sh index 628117f..8475b6d 100644 --- a/flavour/azure/flavourinit.sh +++ b/flavour/azure/flavourinit.sh @@ -27,7 +27,7 @@ fi echo "#!/bin/sh" > ~/bin/azure-relogin cat <>~/bin/azure-relogin -AZ_ACCOUNT_SHOW_OUTPUT="$(az account show 2>&1)" +AZ_ACCOUNT_SHOW_OUTPUT="\$(az account show 2>&1)" if [ $? -eq 0 ]; then echo "Azure login still valid, no relogin required" exit 0 From 40701ffd6b0c650d29ff3f169806dc40888e4920 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Fri, 29 Dec 2023 07:58:51 +0100 Subject: [PATCH 15/42] chore: Added CODEOWNERS and updated dependencies --- .github/CODEOWNERS | 1 + ccc/go.mod | 37 ++++++++------ ccc/go.sum | 119 +++++++++++++++++++++++---------------------- go.mod | 3 +- go.sum | 31 +++--------- 5 files changed, 91 insertions(+), 100 deletions(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..714142f --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @timdeluxe @dodevops/codeowners \ No newline at end of file diff --git a/ccc/go.mod b/ccc/go.mod index 6946f8d..df779ac 100644 --- a/ccc/go.mod +++ b/ccc/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/MichaelMure/go-term-markdown v0.1.4 - github.com/gin-gonic/gin v1.8.1 + github.com/gin-gonic/gin v1.9.1 gopkg.in/yaml.v2 v2.4.0 nullprogram.com/x/optparse v1.0.0 ) @@ -12,33 +12,40 @@ require ( require ( github.com/MichaelMure/go-term-text v0.3.1 // indirect github.com/alecthomas/chroma v0.7.1 // indirect + github.com/bytedance/sonic v1.9.1 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect github.com/disintegration/imaging v1.6.2 // indirect github.com/dlclark/regexp2 v1.1.6 // indirect github.com/eliukblau/pixterm/pkg/ansimage v0.0.0-20191210081756-9fb6cf8c2f75 // indirect github.com/fatih/color v1.9.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-playground/locales v0.14.0 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-playground/validator/v10 v10.10.0 // indirect - github.com/goccy/go-json v0.9.7 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/gomarkdown/markdown v0.0.0-20191123064959-2c17d62f5098 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/kyokomi/emoji/v2 v2.2.8 // indirect - github.com/leodido/go-urn v1.2.1 // indirect + github.com/leodido/go-urn v1.2.4 // indirect github.com/lucasb-eyer/go-colorful v1.0.3 // indirect github.com/mattn/go-colorable v0.1.4 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.12 // indirect - github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/rivo/uniseg v0.1.0 // indirect - github.com/ugorji/go/codec v1.2.7 // indirect - golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect + golang.org/x/arch v0.3.0 // indirect + golang.org/x/crypto v0.9.0 // indirect golang.org/x/image v0.0.0-20191206065243-da761ea9ff43 // indirect - golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect - golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect - golang.org/x/text v0.3.6 // indirect - google.golang.org/protobuf v1.28.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/text v0.9.0 // indirect + google.golang.org/protobuf v1.30.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/ccc/go.sum b/ccc/go.sum index 60e28da..51cb434 100644 --- a/ccc/go.sum +++ b/ccc/go.sum @@ -11,7 +11,12 @@ github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBo github.com/alecthomas/kong v0.2.1-0.20190708041108-0548c6b1afae/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI= github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkxI1zYWl1QLnEqAqEARBEYa8FQnQcY= github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -25,20 +30,21 @@ github.com/eliukblau/pixterm/pkg/ansimage v0.0.0-20191210081756-9fb6cf8c2f75 h1: github.com/eliukblau/pixterm/pkg/ansimage v0.0.0-20191210081756-9fb6cf8c2f75/go.mod h1:0gZuvTO1ikSA5LtTI6E13LEOdWQNjIo5MTQOvrV0eFg= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= -github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= -github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= -github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/gomarkdown/markdown v0.0.0-20191123064959-2c17d62f5098 h1:Qxs3bNRWe8GTcKMxYOSXm0jx6j0de8XUtb/fsP3GZ0I= github.com/gomarkdown/markdown v0.0.0-20191123064959-2c17d62f5098/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU= @@ -47,18 +53,13 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/kyokomi/emoji/v2 v2.2.8 h1:jcofPxjHWEkJtkIbcLHvZhxKgCPl6C7MyjTrD4KDqUE= github.com/kyokomi/emoji/v2 v2.2.8/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac= github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -67,77 +68,77 @@ github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.12 h1:Y41i/hVW3Pgwr8gV+J23B9YEY0zxjptBuCWEaxmAOow= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= golang.org/dl v0.0.0-20190829154251-82a15e2f2ead/go.mod h1:IUMfjQLJQd4UTqG1Z90tenwKoCX93Gn3MAQJMOSBsDQ= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20191206065243-da761ea9ff43 h1:gQ6GUSD102fPgli+Yb4cR/cGaHF7tNBt+GYoRCpGC7s= golang.org/x/image v0.0.0-20191206065243-da761ea9ff43/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraCFObP8S1v6PRp0bLrtU= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= nullprogram.com/x/optparse v1.0.0 h1:xGFgVi5ZaWOnYdac2foDT3vg0ZZC9ErXFV57mr4OHrI= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/go.mod b/go.mod index 4c47b05..609c405 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,8 @@ require ( github.com/Microsoft/go-winio v0.6.1 // indirect github.com/containerd/containerd v1.7.11 // indirect github.com/containerd/log v0.1.0 // indirect - github.com/docker/distribution v2.8.1+incompatible // indirect + github.com/distribution/reference v0.5.0 // indirect + github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect diff --git a/go.sum b/go.sum index 0c26192..d9be6d6 100644 --- a/go.sum +++ b/go.sum @@ -7,8 +7,6 @@ github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7Y github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= -github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/akamensky/argparse v1.4.0 h1:YGzvsTqCvbEZhL8zZu2AiA5nq805NZh75JNj4ajn1xc= @@ -20,10 +18,12 @@ github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.22+incompatible h1:6jX4yB+NtcbldT90k7vBSaWJDB3i+zkVJT9BEK8kQkk= -github.com/docker/docker v20.10.22+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= +github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= @@ -32,15 +32,13 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= @@ -56,19 +54,10 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= -github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8= github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= -github.com/otiai10/copy v1.9.0 h1:7KFNiCgZ91Ru4qW4CWPf/7jqtxLagGRmIxWldPP9VY4= -github.com/otiai10/copy v1.9.0/go.mod h1:hsfX19wcn0UWIHUQ3/4fHuehhk2UyArQ9dVFAn3FczI= github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= -github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/otiai10/mint v1.4.0 h1:umwcf7gbpEwf7WFzqmWwSv0CzbeMsae2u9ZvpP8j2q4= -github.com/otiai10/mint v1.4.0/go.mod h1:gifjb2MYOoULtKLqUAEILUG/9KONW6f7YsJ6vQLTlFI= github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -76,8 +65,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= @@ -86,8 +73,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/thoas/go-funk v0.9.3 h1:7+nAEx3kn5ZJcnDm2Bh23N2yOtweO14bi//dvRtgLpw= github.com/thoas/go-funk v0.9.3/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -97,13 +84,11 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= @@ -113,7 +98,6 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= @@ -132,7 +116,6 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -150,7 +133,6 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= @@ -161,7 +143,6 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 02155ce7bf2945d5d8ca4202417374f7afe158c5 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Fri, 29 Dec 2023 08:02:05 +0100 Subject: [PATCH 16/42] chore: Further updates --- ccc/go.mod | 12 ++++++------ ccc/go.sum | 50 ++++++++++++++++++++++++++++++++++++++++---------- go.sum | 2 -- 3 files changed, 46 insertions(+), 18 deletions(-) diff --git a/ccc/go.mod b/ccc/go.mod index df779ac..2bcf473 100644 --- a/ccc/go.mod +++ b/ccc/go.mod @@ -25,7 +25,7 @@ require ( github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.14.0 // indirect github.com/goccy/go-json v0.10.2 // indirect - github.com/gomarkdown/markdown v0.0.0-20191123064959-2c17d62f5098 // indirect + github.com/gomarkdown/markdown v0.0.0-20230922105210-14b16010c2ee // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/kyokomi/emoji/v2 v2.2.8 // indirect @@ -41,11 +41,11 @@ require ( github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/image v0.0.0-20191206065243-da761ea9ff43 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/image v0.10.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/ccc/go.sum b/ccc/go.sum index 51cb434..4446aff 100644 --- a/ccc/go.sum +++ b/ccc/go.sum @@ -46,8 +46,9 @@ github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QX github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/gomarkdown/markdown v0.0.0-20191123064959-2c17d62f5098 h1:Qxs3bNRWe8GTcKMxYOSXm0jx6j0de8XUtb/fsP3GZ0I= github.com/gomarkdown/markdown v0.0.0-20191123064959-2c17d62f5098/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU= +github.com/gomarkdown/markdown v0.0.0-20230922105210-14b16010c2ee h1:gvsnG+uIVkOue7HrYAG2ZnOdLoJTqsLyuBFJaU0kX4M= +github.com/gomarkdown/markdown v0.0.0-20230922105210-14b16010c2ee/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -103,30 +104,59 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/dl v0.0.0-20190829154251-82a15e2f2ead/go.mod h1:IUMfjQLJQd4UTqG1Z90tenwKoCX93Gn3MAQJMOSBsDQ= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20191206065243-da761ea9ff43 h1:gQ6GUSD102fPgli+Yb4cR/cGaHF7tNBt+GYoRCpGC7s= golang.org/x/image v0.0.0-20191206065243-da761ea9ff43/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.10.0 h1:gXjUUtwtx5yOE0VKWq1CH4IJAClq4UGgUA3i+rpON9M= +golang.org/x/image v0.10.0/go.mod h1:jtrku+n79PfroUbvDdeUWMAI+heR786BofxrbiSF+J0= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= diff --git a/go.sum b/go.sum index d9be6d6..79540bb 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= From 1b70bfa98a86ded461bb88f6d30cc6b740af3467 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Fri, 29 Dec 2023 08:40:54 +0100 Subject: [PATCH 17/42] feat: Support for k9s closes #96 --- assets/feature-installer-utils.sh | 18 ++++++++++++++++++ feature/k9s/feature.yaml | 5 +++++ feature/k9s/goss/.env | 1 + feature/k9s/goss/goss.yaml | 6 ++++++ feature/k9s/install.sh | 20 ++++++++++++++++++++ 5 files changed, 50 insertions(+) create mode 100644 feature/k9s/feature.yaml create mode 100644 feature/k9s/goss/.env create mode 100644 feature/k9s/goss/goss.yaml create mode 100644 feature/k9s/install.sh diff --git a/assets/feature-installer-utils.sh b/assets/feature-installer-utils.sh index 4fa4368..5eb02f6 100644 --- a/assets/feature-installer-utils.sh +++ b/assets/feature-installer-utils.sh @@ -60,3 +60,21 @@ function checkAndCleanVersion { echo "${VERSION}" fi } + +# Usage: downloadFromGithub USER REPO VERSION PACKAGE_PREFIX PACKAGE_SUFFIX TARGET +# Downloads a release package from github using the common architecture names +# The package will be downloaded from github.com/USER/REPO/releases/VERSION/download/PACKAGE to the given TARGET file +# where PACKAGE consists of PACKAGE_PREFIXARCHITECTURE.PACKAGE_SUFFIX. +# Example: PACKAGE_PREFIX=krew_linux_, PACKAGE_SUFFIX=tar.gz on an arm architecture will download krew_linux_arm64.tar.gz +function downloadFromGithub { + USER=$1 + REPO=$2 + VERSION=$3 + PACKAGE_PREFIX=$4 + PACKAGE_SUFFIX=$5 + TARGET=$6 + + ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" + PACKAGE="${PACKAGE_PREFIX}${ARCH}.${PACKAGE_SUFFIX}" + execHandle "Downloading ${USER}/${REPO}@${VERSION}" curl -f -s -L "https://github.com/${USER}/${REPO}/releases/${VERSION}/download/${PACKAGE}" --output "${TARGET}" +} \ No newline at end of file diff --git a/feature/k9s/feature.yaml b/feature/k9s/feature.yaml new file mode 100644 index 0000000..d1a73b9 --- /dev/null +++ b/feature/k9s/feature.yaml @@ -0,0 +1,5 @@ +icon: "🐾" +title: "k9s" +description: "Installs [k9s](https://k9scli.io/)" +configuration: + - "Environment K9S_VERSION (optional): Valid k9s version to install (defaults to latest)" diff --git a/feature/k9s/goss/.env b/feature/k9s/goss/.env new file mode 100644 index 0000000..e7e4106 --- /dev/null +++ b/feature/k9s/goss/.env @@ -0,0 +1 @@ +DEBUG_k9s=yes \ No newline at end of file diff --git a/feature/k9s/goss/goss.yaml b/feature/k9s/goss/goss.yaml new file mode 100644 index 0000000..b247081 --- /dev/null +++ b/feature/k9s/goss/goss.yaml @@ -0,0 +1,6 @@ +command: + k9s: + exec: "/home/cloudcontrol/bin/k9s version" + exit-status: 0 + stdout: + - "Version:" diff --git a/feature/k9s/install.sh b/feature/k9s/install.sh new file mode 100644 index 0000000..d46cf18 --- /dev/null +++ b/feature/k9s/install.sh @@ -0,0 +1,20 @@ +. /feature-installer-utils.sh + +if [ -n "${K9S_VERSION}" ] +then + K9S_VERSION=$(checkAndCleanVersion "${K9S_VERSION}") +else + K9S_VERSION="latest" +fi + +TEMPDIR=$(mktemp -d) +cd "${TEMPDIR}" || exit + +downloadFromGithub derailed k9s "${K9S_VERSION}" k9s_Linux_ tar.gz k9s.tar.gz + +execHandle "Unpacking k9s" tar xzf k9s.tar.gz +execHandle "Installing k9s" mv k9s /home/cloudcontrol/bin +execHandle "Making k9s executable" chmod +x /home/cloudcontrol/bin/k9s + +cd - &>/dev/null || exit +rm -rf "${TEMPDIR}" \ No newline at end of file From d314dce6e4f84eb66f2fbc60b467401ee8c29741 Mon Sep 17 00:00:00 2001 From: DO! DevOps bot Date: Fri, 29 Dec 2023 07:41:11 +0000 Subject: [PATCH 18/42] docs: Automatic docs update --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index ce874e7..260d1d7 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Following features and tools are supported: * ⚙️ Direnv * ⛵️ Helm * 🛠 JQ +* 🐾 k9s * ⌨️ kc Quick Kubernetes Context switch * 🟦 krew * 🐚 Kubectlnodeshell @@ -55,6 +56,7 @@ Following features and tools are supported: * [Direnv](#direnv) * [Helm](#helm) * [JQ](#jq) + * [k9s](#k9s) * [kc Quick Kubernetes Context switch](#kc) * [krew](#krew) * [Kubectlnodeshell](#kubectlnodeshell) @@ -419,6 +421,16 @@ Installs the [JSON parser and processor jq](https://stedolan.github.io/jq/) * USE_jq: Enable this feature * DEBUG_jq: Debug this feature +### k9s + +Installs [k9s](https://k9scli.io/) + +#### Configuration + +* USE_k9s: Enable this feature +* DEBUG_k9s: Debug this feature +* Environment K9S_VERSION (optional): Valid k9s version to install (defaults to latest) + ### kc Quick Kubernetes Context switch Installs [kc](https://github.com/dodevops/cloudcontrol/blob/master/feature/kc/kc.sh), a quick context switcher for kubernetes. From 11cdb3504c23c4a7c1001bc76c2fc79230dcac7f Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Fri, 29 Dec 2023 08:42:00 +0100 Subject: [PATCH 19/42] chore: Corrected CODEOWNERS file --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 714142f..6a5a05e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @timdeluxe @dodevops/codeowners \ No newline at end of file +* @dodevops/codeowners \ No newline at end of file From ed010036bea5714cff4d2b1cb19eef412fd72d51 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Fri, 29 Dec 2023 09:08:01 +0100 Subject: [PATCH 20/42] chore: Added dependabot configuration --- .github/dependabot.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..a0daa43 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +# Set update schedule for GitHub Actions +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "daily" + allow: + - dependency-type: "direct" + - package-ecosystem: "npm" + directory: "/ccc-client" + schedule: + interval: "daily" + allow: + - dependency-type: "direct" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" From e770f46f6bac3ec649ac23c1fcf27764c5b8f7e7 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Fri, 29 Dec 2023 09:24:38 +0100 Subject: [PATCH 21/42] chore: Modified dependabot to only use security updates --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a0daa43..1c9af97 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,6 @@ # Set update schedule for GitHub Actions +# open-pull-requests-limit is set to 0 because we only want security updates and those override this limit +# see https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates#overriding-the-default-behavior-with-a-configuration-file version: 2 updates: - package-ecosystem: "gomod" @@ -7,13 +9,16 @@ updates: interval: "daily" allow: - dependency-type: "direct" + open-pull-requests-limit: 0 - package-ecosystem: "npm" directory: "/ccc-client" schedule: interval: "daily" allow: - dependency-type: "direct" + open-pull-requests-limit: 0 - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" + open-pull-requests-limit: 0 \ No newline at end of file From 09506e302454688fd6ed8c8650cd6a6cff1e98ff Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Wed, 3 Jan 2024 08:11:35 +0100 Subject: [PATCH 22/42] chore: Only run cloud tests when not originating from a fork --- .github/workflows/test.yml | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d179c75..92079bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,30 @@ env: GOSSVERSION: v0.4.4 jobs: + notify: + runs-on: ubuntu-latest + if: ${{ github.event.pull_request.head.repo.fork }} + steps: + - name: Notifiy about skips on forks + run: | + echo "::notice title=Skipping cloud tests::Because we're running from a fork, we'll skip cloud tests." + build-exclude: + runs-on: ubuntu-latest + outputs: + jobs: ${{ steps.build-exclude.outputs.jobs }} + steps: + - id: build-exclude + run: | + cat < tmp.js + exclude=[{"flavour": "tanzu", "arch": "linux/arm64"}] + if (${{ github.event.pull_request.head.repo.fork }}) { + exclude = exclude.concat([{"flavour": "aws"}, {"flavour": "azure"}, {"flavour": "gcloud"}]) + } + console.log(JSON.stringify(exclude)) + EOT + echo "jobs=$(node tmp.js)" >> "$GITHUB_OUTPUT" test: + needs: build-exclude strategy: matrix: flavour: @@ -21,12 +44,7 @@ jobs: - linux/amd64 # Commented until Github supports arm64 runners #- linux/arm64 - exclude: - - flavour: "azure" - arch: "linux/arm64" - - flavour: "tanzu" - arch: "linux/arm64" - + exclude: ${{ fromJSON(needs.build-exclude.outputs.jobs) }} runs-on: ubuntu-latest From 532aa8dcaf10c35fe12c09c7e4c6ef097b8ff2e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Jan 2024 09:46:44 +0000 Subject: [PATCH 23/42] chore(deps): bump tj-actions/changed-files in /.github/workflows Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 35.5.6 to 41.0.0. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v35.5.6...v41.0.0) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- .github/workflows/check_commits.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_commits.yml b/.github/workflows/check_commits.yml index 73e168b..63872fe 100644 --- a/.github/workflows/check_commits.yml +++ b/.github/workflows/check_commits.yml @@ -27,7 +27,7 @@ jobs: pattern: '^(Merge pull request #[0-9]+ from dodevops/develop)|(Merge branch ''main'' into develop)|(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)' error: 'Commit messages do not follow https://www.conventionalcommits.org/en/v1.0.0/' - name: Get Changed Files - uses: tj-actions/changed-files@v35.5.6 + uses: tj-actions/changed-files@v41.0.0 - name: Check if CHANGELOG wasn't included run: | if echo ${{ steps.changed-files.outputs.all_changed_files }} | grep CHANGELOG.md; then From 49df0b9e6aabae6bc72ced54c1002f532a47fc24 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Fri, 5 Jan 2024 11:27:03 +0100 Subject: [PATCH 24/42] fix: Put a sleep in the RunCommand implementation as it might break the container runtime with flooding it with status requests --- internal/tests/lib/container/docker.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/tests/lib/container/docker.go b/internal/tests/lib/container/docker.go index 0faec44..8a383c9 100644 --- a/internal/tests/lib/container/docker.go +++ b/internal/tests/lib/container/docker.go @@ -14,6 +14,7 @@ import ( "github.com/thoas/go-funk" "io" "strings" + "time" ) // generate a platform spec from a platform string. @@ -199,6 +200,7 @@ func (d DockerAdapter) RunCommand(containerID string, cmd []string) (string, err } return fmt.Sprintf("Command output: %s\n\nContainer output: %s\n%s", commandLogbuf.String(), containerLogBuf.String(), err), nil } + time.Sleep(2 * time.Second) } } } From fb52d2a5d77fa2c507d216c40cc18e2a9a82af2f Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Mon, 4 Mar 2024 10:12:10 +0100 Subject: [PATCH 25/42] chore: Disabling AWS tests for pricing reasons --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 92079bd..4abdb71 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,8 @@ jobs: strategy: matrix: flavour: - - aws + # Commented for pricing reasons + #- aws - azure # Commented until gcloud playground exists #- gcloud From 1b8ec9dfb61cce73bc9a260a9a1967e04ffd062d Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Mon, 11 Mar 2024 14:38:47 +0100 Subject: [PATCH 26/42] fix: Correct TENANTID variable after deprecation --- .github/workflows/check_commits.yml | 2 +- flavour/azure/flavourinit.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check_commits.yml b/.github/workflows/check_commits.yml index 63872fe..d593144 100644 --- a/.github/workflows/check_commits.yml +++ b/.github/workflows/check_commits.yml @@ -24,7 +24,7 @@ jobs: uses: tim-actions/commit-message-checker-with-regex@v0.3.1 with: commits: ${{ steps.get-pr-commits.outputs.commits }} - pattern: '^(Merge pull request #[0-9]+ from dodevops/develop)|(Merge branch ''main'' into develop)|(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)' + pattern: '^(Merge pull request #[0-9]+)|(Merge branch ''main'' into develop)|(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)' error: 'Commit messages do not follow https://www.conventionalcommits.org/en/v1.0.0/' - name: Get Changed Files uses: tj-actions/changed-files@v41.0.0 diff --git a/flavour/azure/flavourinit.sh b/flavour/azure/flavourinit.sh index 8475b6d..6952fc4 100644 --- a/flavour/azure/flavourinit.sh +++ b/flavour/azure/flavourinit.sh @@ -11,7 +11,7 @@ fi if [ "X${ARM_TENANT_ID}X" != "XX" ] then - tenantArg+=("--tenant" "${AZ_TENANTID}") + tenantArg+=("--tenant" "${ARM_TENANT_ID}") fi if ${AZ_USE_ARM_SPI:-false}; From cbabee65a1bf947a228073132d23105c6302377d Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Wed, 10 Apr 2024 10:11:45 +0200 Subject: [PATCH 27/42] feat: Add missing annotations to multi arch images --- .github/workflows/image.yml | 26 ++++++++++++++++---------- build/labels.txt.mo | 16 ++++++++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 build/labels.txt.mo diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 8077969..58876c0 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -2,9 +2,6 @@ name: "Build Images" on: push: - branches: - - main - - develop release: types: - published @@ -39,7 +36,7 @@ jobs: uses: actions/checkout@v2 - name: Install cosign - uses: sigstore/cosign-installer@v2.8.1 + uses: sigstore/cosign-installer@v3.5.0 # Set up QEMU to be able to build to multiple architectures - name: Set up QEMU @@ -67,7 +64,11 @@ jobs: type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} - name: Prepare build + id: prepare run: | + export BUILD_DATE=$(date -Iseconds) + export FLAVOUR=${{ matrix.flavour.name }} + cat build/Dockerfile.prefix > Dockerfile cat "flavour/${{ matrix.flavour.name }}/Dockerfile.flavour" >> Dockerfile @@ -75,10 +76,15 @@ jobs: curl -sSL https://raw.githubusercontent.com/tests-always-included/mo/master/mo -o mo chmod +x mo - cat build/Dockerfile.suffix.mo | BUILD_DATE=$(date -Iseconds) FLAVOUR=${{ matrix.flavour.name }} ./mo > build/Dockerfile.suffix - + cat build/Dockerfile.suffix.mo | ./mo > build/Dockerfile.suffix cat build/Dockerfile.suffix >> Dockerfile + { + echo 'labels<> "$GITHUB_OUTPUT" + rm mo env: FLAVOUR: "${{ matrix.flavour.name }}" @@ -89,17 +95,17 @@ jobs: - name: Build and push Docker image id: build-and-push - uses: docker/build-push-action@v4.0.0 + uses: docker/build-push-action@v5.3.0 with: context: . push: true pull: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + annotations: | + ${{ steps.prepare.outputs.labels }} no-cache: true platforms: ${{ matrix.flavour.platforms }} - name: Sign the published Docker image - env: - COSIGN_EXPERIMENTAL: "true" - run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }} + run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign --yes {}@${{ steps.build-and-push.outputs.digest }} diff --git a/build/labels.txt.mo b/build/labels.txt.mo new file mode 100644 index 0000000..3a75d41 --- /dev/null +++ b/build/labels.txt.mo @@ -0,0 +1,16 @@ +index:io.artifacthub.package.readme-url=https://raw.githubusercontent.com/dodevops/cloudcontrol/develop/README.md +index:org.opencontainers.image.created={{BUILD_DATE}} +index:org.opencontainers.image.description="The cloud engineer's toolbox - {{FLAVOUR}} flavour" +index:org.opencontainers.image.documentation=https://github.com/dodevops/cloudcontrol +index:org.opencontainers.image.source=https://github.com/dodevops/cloudcontrol +index:org.opencontainers.image.title="cloudcontrol-{{FLAVOUR}}" +index:org.opencontainers.image.url=https://github.com/dodevops/cloudcontrol +index:org.opencontainers.image.vendor="DO! DevOps" +manifest:io.artifacthub.package.readme-url=https://raw.githubusercontent.com/dodevops/cloudcontrol/develop/README.md +manifest:org.opencontainers.image.created={{BUILD_DATE}} +manifest:org.opencontainers.image.description="The cloud engineer's toolbox - {{FLAVOUR}} flavour" +manifest:org.opencontainers.image.documentation=https://github.com/dodevops/cloudcontrol +manifest:org.opencontainers.image.source=https://github.com/dodevops/cloudcontrol +manifest:org.opencontainers.image.title="cloudcontrol-{{FLAVOUR}}" +manifest:org.opencontainers.image.url=https://github.com/dodevops/cloudcontrol +manifest:org.opencontainers.image.vendor="DO! DevOps" From ceb9a18dba800782279fd818ff688a91abc8b1cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Jan 2024 04:36:20 +0000 Subject: [PATCH 28/42] chore(deps-dev): bump vite from 4.4.9 to 4.5.2 in /ccc-client Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.4.9 to 4.5.2. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v4.5.2/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v4.5.2/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- ccc-client/package-lock.json | 8 ++++---- ccc-client/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ccc-client/package-lock.json b/ccc-client/package-lock.json index 6f83bfd..7f68345 100644 --- a/ccc-client/package-lock.json +++ b/ccc-client/package-lock.json @@ -24,7 +24,7 @@ "miragejs": "^0.1.47", "typescript": "^5.0.0", "unplugin-fonts": "^1.0.3", - "vite": "^4.2.0", + "vite": "^4.5.2", "vite-plugin-vuetify": "^1.0.0", "vue-tsc": "^1.2.0" } @@ -1747,9 +1747,9 @@ } }, "node_modules/vite": { - "version": "4.4.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", - "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", + "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", "devOptional": true, "dependencies": { "esbuild": "^0.18.10", diff --git a/ccc-client/package.json b/ccc-client/package.json index 70ea3c8..eefa3b2 100644 --- a/ccc-client/package.json +++ b/ccc-client/package.json @@ -21,7 +21,7 @@ "@vitejs/plugin-vue": "^4.0.0", "typescript": "^5.0.0", "unplugin-fonts": "^1.0.3", - "vite": "^4.2.0", + "vite": "^4.5.2", "vite-plugin-vuetify": "^1.0.0", "vue-tsc": "^1.2.0", "miragejs": "^0.1.47", From 5af3b64a526532ddc6d21583374c09a78cbf5a0f Mon Sep 17 00:00:00 2001 From: timdeluxe <5765175+timdeluxe@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:04:44 +0200 Subject: [PATCH 29/42] fix: Fixing README template section about building README.md --- README.md.gotmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md.gotmpl b/README.md.gotmpl index 07fb2ee..8e193d2 100644 --- a/README.md.gotmpl +++ b/README.md.gotmpl @@ -428,7 +428,7 @@ you can inspect the failing container as well. To rebuild this documentation, first compile the documentation maker: - docker run --rm -e GOOS=[os, e.g. darwin, linux, windows] -e GOARCH=[architecture, e.g. arm64, amd64] -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.19-alpine go run cmd/doc/mkdoc + docker run --rm -e GOOS=[os, e.g. darwin, linux, windows] -e GOARCH=[architecture, e.g. arm64, amd64] -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.19-alpine go build cmd/doc/mkdoc.go Then run it to rebuild README.md based on README.md.gotmpl: From 380fb7cb4488fae13c5575cd53ee4d1836466d21 Mon Sep 17 00:00:00 2001 From: DO! DevOps bot Date: Thu, 13 Jun 2024 13:05:12 +0000 Subject: [PATCH 30/42] docs: Automatic docs update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 260d1d7..0f4307d 100644 --- a/README.md +++ b/README.md @@ -775,7 +775,7 @@ you can inspect the failing container as well. To rebuild this documentation, first compile the documentation maker: - docker run --rm -e GOOS=[os, e.g. darwin, linux, windows] -e GOARCH=[architecture, e.g. arm64, amd64] -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.19-alpine go run cmd/doc/mkdoc + docker run --rm -e GOOS=[os, e.g. darwin, linux, windows] -e GOARCH=[architecture, e.g. arm64, amd64] -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.19-alpine go build cmd/doc/mkdoc.go Then run it to rebuild README.md based on README.md.gotmpl: From 251dad5a487fa5a2882fe1cbf43e087099b2e5d7 Mon Sep 17 00:00:00 2001 From: timdeluxe <5765175+timdeluxe@users.noreply.github.com> Date: Thu, 13 Jun 2024 14:55:42 +0200 Subject: [PATCH 31/42] feat: Adding sops feature --- README.md | 13 +++++++++++++ feature/sops/feature.yaml | 6 ++++++ feature/sops/goss/.env | 1 + feature/sops/goss/goss.yaml | 6 ++++++ feature/sops/install.sh | 23 +++++++++++++++++++++++ 5 files changed, 49 insertions(+) create mode 100644 feature/sops/feature.yaml create mode 100644 feature/sops/goss/.env create mode 100644 feature/sops/goss/goss.yaml create mode 100644 feature/sops/install.sh diff --git a/README.md b/README.md index 260d1d7..d9f4626 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Following features and tools are supported: * 📦 Packages * 📦 Packer * 👟 Run +* 🔑 sops * 📜 Stern * 🌏 Terraform * 🐗 Terragrunt @@ -64,6 +65,7 @@ Following features and tools are supported: * [Packages](#packages) * [Packer](#packer) * [Run](#run) + * [sops](#sops) * [Stern](#stern) * [Terraform](#terraform) * [Terragrunt](#terragrunt) @@ -540,6 +542,17 @@ Runs commands inside the shell when entering the cloud control container * DEBUG_run: Debug this feature * Environment RUN_COMMANDS: Valid shell commands to run +### sops + +Installs [sops](https://github.com/getsops/sops) + +#### Configuration + +* USE_sops: Enable this feature +* DEBUG_sops: Debug this feature +* Environment SOPS_VERSION (required): Valid sops version (e.g. 3.8.1) +* Environment specific for the key you use, see [sops documentation](https://github.com/getsops/sops?tab=readme-ov-file#22encrypting-using-age) + ### Stern Installs [stern](https://github.com/stern/stern), a multi pod and container log tailing for Kubernetes diff --git a/feature/sops/feature.yaml b/feature/sops/feature.yaml new file mode 100644 index 0000000..5fe5405 --- /dev/null +++ b/feature/sops/feature.yaml @@ -0,0 +1,6 @@ +icon: "🔑" +title: "sops" +description: "Installs [sops](https://github.com/getsops/sops)" +configuration: + - "Environment SOPS_VERSION (required): Valid sops version (e.g. 3.8.1)" + - "Environment specific for the key you use, see [sops documentation](https://github.com/getsops/sops?tab=readme-ov-file#22encrypting-using-age)" diff --git a/feature/sops/goss/.env b/feature/sops/goss/.env new file mode 100644 index 0000000..4a9e6df --- /dev/null +++ b/feature/sops/goss/.env @@ -0,0 +1 @@ +SOPS_VERSION=3.8.1 \ No newline at end of file diff --git a/feature/sops/goss/goss.yaml b/feature/sops/goss/goss.yaml new file mode 100644 index 0000000..6ecf167 --- /dev/null +++ b/feature/sops/goss/goss.yaml @@ -0,0 +1,6 @@ +command: + sops: + exec: "/home/cloudcontrol/bin/sops --version" + exit-status: 0 + stdout: + - "sops" diff --git a/feature/sops/install.sh b/feature/sops/install.sh new file mode 100644 index 0000000..471cc21 --- /dev/null +++ b/feature/sops/install.sh @@ -0,0 +1,23 @@ +. /feature-installer-utils.sh + +if [ -z "${SOPS_VERSION}" ] +then + echo "The sops feature requires a version set using SOPS_VERSION. See https://github.com/getsops/sops/releases/ for valid versions" + exit 1 +fi + +SOPS_VERSION=$(checkAndCleanVersion "${SOPS_VERSION}") + +TEMPDIR=$(mktemp -d) +cd "${TEMPDIR}" || exit + +execHandle "Downloading sops" curl -f -s -L "https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.$(getPlatform)" --output sops +execHandle "Installing sops" mv sops /home/cloudcontrol/bin +execHandle "Making sops executable" chmod +x /home/cloudcontrol/bin/sops + +cd - &>/dev/null || exit +rm -rf "${TEMPDIR}" + + + + From 9c849988efb2701588fdf403da6f8cac8f98f95b Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Wed, 17 Apr 2024 12:59:55 +0200 Subject: [PATCH 32/42] feat: Optimized documentation and feature utils Added template for new features --- README.md.gotmpl | 14 +++++++-- assets/feature-installer-utils.sh | 48 +++++++++++++++++++++++++++++-- feature/.template/feature.yaml | 18 ++++++++++++ feature/.template/goss/.envrc | 2 ++ feature/.template/goss/goss.yaml | 5 ++++ feature/.template/install.sh | 27 +++++++++++++++++ 6 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 feature/.template/feature.yaml create mode 100644 feature/.template/goss/.envrc create mode 100644 feature/.template/goss/goss.yaml create mode 100644 feature/.template/install.sh diff --git a/README.md.gotmpl b/README.md.gotmpl index 07fb2ee..f183c7d 100644 --- a/README.md.gotmpl +++ b/README.md.gotmpl @@ -283,14 +283,24 @@ environment variable in the docker-compose file. Then you can debug with the run ## Development -*CloudControl* supports a decoupled development of features and flavours. If you're missing something, just fork this -repository, create a subfolder for your new feature under "features" and add these files: +*CloudControl* supports a decoupled development of features and flavours. + +### Features + +If you're missing a feature, just fork this repository, copy the feature template from features/.template into a +new subfolder, check out the comments in the example files, and modify them to your needs. + +These files make up a feature: * `feature.yaml`: A descriptor for your feature with a title, a description and configuration notes * `install.sh`: A shell script that is run by CloudControlCenter and should install everything you need for your new feature * `motd.sh`: (optional) If you want to show some information to the users upon login, put them here. +And an optional, but recommended `.goss` folder for [integration testing](#integration-testing). + +### Flavours + If you need another flavour (aka cloud provider), add a new subdirectory under "flavour" and add a flavour.yaml describing your flavour the same way as a feature. For the rest of the files, please check out existing flavours for details. Please, include a sample configuration for your flavour to make it easier for other people to work with it. diff --git a/assets/feature-installer-utils.sh b/assets/feature-installer-utils.sh index 5eb02f6..c17ccc5 100644 --- a/assets/feature-installer-utils.sh +++ b/assets/feature-installer-utils.sh @@ -1,4 +1,31 @@ -# Execute a command and if it fails, return its output and exit +# Set some informative variables + +# The flavour we're running on +FLAVOUR="$(cat /home/cloudcontrol/flavour)" +export FLAVOUR + +# The path to install software binaries to +BINPATH="/home/cloudcontrol/bin" +export BINPATH + +TEMPDIR="" +export TEMPDIR + +# Prepare feature installation. Will create a temporary directory and change to it +function prepare { + TEMPDIR=$(mktemp -d) + cd "${TEMPDIR}" || exit +} + +# Cleanup the previously generated temporary directory +function cleanup { + cd - &>/dev/null || exit + rm -rf "${TEMPDIR}" +} + +# Usage: execHandle MESSAGE COMMAND... +# +# Output MESSAGE and then execute COMMAND. If it fails, return its output and exit function execHandle { TITLE=$1 shift @@ -38,6 +65,7 @@ function waitForMfaCode { echo "[VALID_CODE] Valid code entered. Thank you." } +# Get the hardware platform we're on and translate it to the usual platform names used in most software function getPlatform { if [ "$(uname -m)" == 'aarch64' ] then @@ -50,18 +78,32 @@ function getPlatform { fi } +# Usage: checkAndCleanVersion VERSION +# +# Includes checks for version numbers and removes the "v" prefix from it to have a homogeneous version scheme +# throughout CloudControl. function checkAndCleanVersion { VERSION=$1 if [ "${VERSION:0:1}" == "v" ] then - echo "[DEPRECATION WARNING] Versions with a \"v\" prefix are deprecated and will be removed in CloudControl 4.0. Please only use versions without the \"v\" prefix. (Got \"${VERSION}\")" >&2 + echo "[DEPRECATION WARNING] Versions with a \"v\" prefix are deprecated and will be removed in CloudControl 6.0.0 Please only use versions without the \"v\" prefix. (Got \"${VERSION}\")" >&2 echo "${VERSION/#v/}" else echo "${VERSION}" fi } +# Usage: download URL FILENAME +# +# Downloads the given URL into the provided FILENAME +function download { + URL=$1 + FILENAME=$2 + execHandle "Downloading ${FILENAME} from ${URL}" curl -f -s -L "${URL}" -o "${FILENAME}" +} + # Usage: downloadFromGithub USER REPO VERSION PACKAGE_PREFIX PACKAGE_SUFFIX TARGET +# # Downloads a release package from github using the common architecture names # The package will be downloaded from github.com/USER/REPO/releases/VERSION/download/PACKAGE to the given TARGET file # where PACKAGE consists of PACKAGE_PREFIXARCHITECTURE.PACKAGE_SUFFIX. @@ -77,4 +119,4 @@ function downloadFromGithub { ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" PACKAGE="${PACKAGE_PREFIX}${ARCH}.${PACKAGE_SUFFIX}" execHandle "Downloading ${USER}/${REPO}@${VERSION}" curl -f -s -L "https://github.com/${USER}/${REPO}/releases/${VERSION}/download/${PACKAGE}" --output "${TARGET}" -} \ No newline at end of file +} diff --git a/feature/.template/feature.yaml b/feature/.template/feature.yaml new file mode 100644 index 0000000..6c04779 --- /dev/null +++ b/feature/.template/feature.yaml @@ -0,0 +1,18 @@ +# This is the metadata manifest for a feature. Configure it for the feature to be included in CloudControl +# In your new feature, please remove all descriptive comments from the template. + +# Please use an emoji character as a meaningful logo for your feature +icon: "⚙️" + +# Set the title for this feature +title: "Direnv" + +# Set the description of the feature in Markdown. Be sure to include links to websites of the software the feature +# installs or configures +description: "Installs [Direnv](https://direnv.net/)" + +# Use the configuration key to list additional configuration options that you're providing in your feature +configuration: + #- | + # Environment EXAMPLE_ENVIRONMENT: This environment variable is used in the feature to do xyz (optional) + # Defaults to `abc` diff --git a/feature/.template/goss/.envrc b/feature/.template/goss/.envrc new file mode 100644 index 0000000..ed8b5fe --- /dev/null +++ b/feature/.template/goss/.envrc @@ -0,0 +1,2 @@ +# Setup required environment for test +export EXAMPLE_ENVIRONMENT=something diff --git a/feature/.template/goss/goss.yaml b/feature/.template/goss/goss.yaml new file mode 100644 index 0000000..b803253 --- /dev/null +++ b/feature/.template/goss/goss.yaml @@ -0,0 +1,5 @@ +command: + test: + # Run ls / after installing the feature and if that returns successfully, the test is successful + exec: "ls /" + exit-status: 0 diff --git a/feature/.template/install.sh b/feature/.template/install.sh new file mode 100644 index 0000000..17ed97d --- /dev/null +++ b/feature/.template/install.sh @@ -0,0 +1,27 @@ +# The installer script for your feature, which is called in the init phase of CloudControl + +# Include the feature installer utils which include helpers for the installation of your feature +# See /assets/feature-installer-utils.sh + +. /feature-installer-utils.sh + +# Create a temporary directory to work in +prepare + +if [ "X${FLAVOUR}X" == "XsimpleX" ] +then + # Do specific things for the simple flavour + download "https://example.com/my-tool-for-simple.tar.gz" tool.tar.gz +elif [[ "X${FLAVOR}X" =~ X(azure|gcloud)X ]] +then + # Do specific things for other flavours + download "https://example.com/my-tool-for-others.tar.gz" tool.tar.gz +fi + +# Do other things +execHandle "Extracting tool" tar xzf tool.tar.gz +execHandle "Making tool executable" chmod +x tool +execHandle "Copying tool to ${BINPATH}" cp tool "${BINPATH}" + +# Cleanup what we did +cleanup \ No newline at end of file From 782c4fa50b2c970dc18e2ec50e99e9ac4d879328 Mon Sep 17 00:00:00 2001 From: DO! DevOps bot Date: Wed, 17 Apr 2024 11:00:32 +0000 Subject: [PATCH 33/42] docs: Automatic docs update --- README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d9f4626..d23e6a8 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Currently supported cloud flavours are: * [Tanzu](https://github.com/dodevops/cloudcontrol/pkgs/container/cloudcontrol-tanzu) (based on [alpine](https://hub.docker.com/_/alpine)) [linux/amd64] Following features and tools are supported: +* ⚙️ Direnv * 🐟 Fish Shell * 📷 AzCopy * 🪪 Certificates @@ -51,6 +52,7 @@ Following features and tools are supported: * [simple](#simple) * [tanzu](#tanzu) * [Features](#features) + * [Direnv](#.template) * [Fish Shell](#_fish) * [AzCopy](#azcopy) * [Certificates](#certificates) @@ -359,6 +361,15 @@ The kubernetes login tokens usually expire after a few hours already. You can ru does. ## Features +### Direnv + +Installs [Direnv](https://direnv.net/) + +#### Configuration + +* USE_.template: Enable this feature +* DEBUG_.template: Debug this feature + ### Fish Shell Installs and configures the [Fish Shell](https://fishshell.com/) with configured [Spacefish theme](https://spacefish.matchai.me/) @@ -643,14 +654,24 @@ Installs the [YAML parser and processor yq](https://github.com/mikefarah/yq) ## Development -*CloudControl* supports a decoupled development of features and flavours. If you're missing something, just fork this -repository, create a subfolder for your new feature under "features" and add these files: +*CloudControl* supports a decoupled development of features and flavours. + +### Features + +If you're missing a feature, just fork this repository, copy the feature template from features/.template into a +new subfolder, check out the comments in the example files, and modify them to your needs. + +These files make up a feature: * `feature.yaml`: A descriptor for your feature with a title, a description and configuration notes * `install.sh`: A shell script that is run by CloudControlCenter and should install everything you need for your new feature * `motd.sh`: (optional) If you want to show some information to the users upon login, put them here. +And an optional, but recommended `.goss` folder for [integration testing](#integration-testing). + +### Flavours + If you need another flavour (aka cloud provider), add a new subdirectory under "flavour" and add a flavour.yaml describing your flavour the same way as a feature. For the rest of the files, please check out existing flavours for details. Please, include a sample configuration for your flavour to make it easier for other people to work with it. From 64238336ec51b994acd1201b7f98194711b7dac4 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Wed, 17 Apr 2024 13:38:48 +0200 Subject: [PATCH 34/42] fix: Fixed test runner not ignoring .-directories --- cmd/tests/test-features.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/tests/test-features.go b/cmd/tests/test-features.go index 7250e7a..d2c871a 100644 --- a/cmd/tests/test-features.go +++ b/cmd/tests/test-features.go @@ -77,7 +77,7 @@ func getFeatures(flavour string) []lib.Feature { funk.FilterString( featuresGlob, func(value string) bool { - if correctPathRegexp.Match([]byte(filepath.Dir(value))) { + if correctPathRegexp.Match([]byte(value)) { if yamlFile, err := os.ReadFile(filepath.Join(value, "feature.yaml")); err != nil { return false } else { From 2ea77f6ac6236f82eee428758830273653c53b93 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Wed, 17 Apr 2024 14:40:36 +0200 Subject: [PATCH 35/42] fix: Fixed test runner not ignoring .-directories --- cmd/tests/test-features.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/tests/test-features.go b/cmd/tests/test-features.go index d2c871a..1f9f93a 100644 --- a/cmd/tests/test-features.go +++ b/cmd/tests/test-features.go @@ -77,7 +77,7 @@ func getFeatures(flavour string) []lib.Feature { funk.FilterString( featuresGlob, func(value string) bool { - if correctPathRegexp.Match([]byte(value)) { + if correctPathRegexp.Match([]byte(filepath.Base(value))) { if yamlFile, err := os.ReadFile(filepath.Join(value, "feature.yaml")); err != nil { return false } else { @@ -225,8 +225,10 @@ func main() { os.Exit(1) } + features := getFeatures(*flavour) + for _, includeFeature := range *includeFeatures { - if !funk.Contains(getFeatures(*flavour), func(feature lib.Feature) bool { + if !funk.Contains(features, func(feature lib.Feature) bool { return feature.Name == includeFeature }) { logrus.Errorf("%s is not a known feature", includeFeature) @@ -236,7 +238,7 @@ func main() { } for _, excludeFeature := range *excludeFeatures { - if !funk.Contains(getFeatures(*flavour), func(feature lib.Feature) bool { + if !funk.Contains(features, func(feature lib.Feature) bool { return feature.Name == excludeFeature }) { logrus.Errorf("%s is not a known feature", excludeFeature) From ac7b3e4189fd8bb229ed4d2c0fe9e37c9a9b205f Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Thu, 18 Apr 2024 08:52:11 +0200 Subject: [PATCH 36/42] fix: Remove template from doc generation --- README.md | 15 ++++----------- cmd/doc/mkdoc.go | 3 +++ feature/.template/feature.yaml | 6 +++--- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d23e6a8..5e22022 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,6 @@ Currently supported cloud flavours are: * [Tanzu](https://github.com/dodevops/cloudcontrol/pkgs/container/cloudcontrol-tanzu) (based on [alpine](https://hub.docker.com/_/alpine)) [linux/amd64] Following features and tools are supported: -* ⚙️ Direnv * 🐟 Fish Shell * 📷 AzCopy * 🪪 Certificates @@ -52,7 +51,6 @@ Following features and tools are supported: * [simple](#simple) * [tanzu](#tanzu) * [Features](#features) - * [Direnv](#.template) * [Fish Shell](#_fish) * [AzCopy](#azcopy) * [Certificates](#certificates) @@ -361,15 +359,6 @@ The kubernetes login tokens usually expire after a few hours already. You can ru does. ## Features -### Direnv - -Installs [Direnv](https://direnv.net/) - -#### Configuration - -* USE_.template: Enable this feature -* DEBUG_.template: Debug this feature - ### Fish Shell Installs and configures the [Fish Shell](https://fishshell.com/) with configured [Spacefish theme](https://spacefish.matchai.me/) @@ -833,3 +822,7 @@ flowchart TD click F "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/test.yml" "Test workflow" click H "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow" ```mermaid +vops/cloudcontrol/blob/develop/.github/workflows/test.yml" "Test workflow" + click H "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow" +```mermaid +```mermaid diff --git a/cmd/doc/mkdoc.go b/cmd/doc/mkdoc.go index cdc8d98..86cf6c2 100644 --- a/cmd/doc/mkdoc.go +++ b/cmd/doc/mkdoc.go @@ -23,6 +23,9 @@ func fetchDocData(basePath string, filenamePattern string) (map[string]internal. return docDatas, err } else { for _, dir := range subDirs { + if filepath.Base(dir) == ".template" { + continue + } if _, err := os.Stat(filepath.Join(dir, filenamePattern)); err == nil { if yamlFile, err := os.ReadFile(filepath.Join(dir, filenamePattern)); err != nil { return docDatas, err diff --git a/feature/.template/feature.yaml b/feature/.template/feature.yaml index 6c04779..cfc1f24 100644 --- a/feature/.template/feature.yaml +++ b/feature/.template/feature.yaml @@ -2,14 +2,14 @@ # In your new feature, please remove all descriptive comments from the template. # Please use an emoji character as a meaningful logo for your feature -icon: "⚙️" +icon: "🫥" # Set the title for this feature -title: "Direnv" +title: "Template" # Set the description of the feature in Markdown. Be sure to include links to websites of the software the feature # installs or configures -description: "Installs [Direnv](https://direnv.net/)" +description: "Does some awesome stuff" # Use the configuration key to list additional configuration options that you're providing in your feature configuration: From 224fadbab221b69418f8548bdae7dc0d8a048e7c Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Thu, 18 Apr 2024 10:15:35 +0200 Subject: [PATCH 37/42] fix: Some PR fixes --- assets/feature-installer-utils.sh | 6 ++---- feature/.template/install.sh | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/assets/feature-installer-utils.sh b/assets/feature-installer-utils.sh index c17ccc5..d0f2763 100644 --- a/assets/feature-installer-utils.sh +++ b/assets/feature-installer-utils.sh @@ -5,11 +5,9 @@ FLAVOUR="$(cat /home/cloudcontrol/flavour)" export FLAVOUR # The path to install software binaries to -BINPATH="/home/cloudcontrol/bin" -export BINPATH +export BINPATH="/home/cloudcontrol/bin" -TEMPDIR="" -export TEMPDIR +export TEMPDIR="" # Prepare feature installation. Will create a temporary directory and change to it function prepare { diff --git a/feature/.template/install.sh b/feature/.template/install.sh index 17ed97d..eccc716 100644 --- a/feature/.template/install.sh +++ b/feature/.template/install.sh @@ -5,7 +5,7 @@ . /feature-installer-utils.sh -# Create a temporary directory to work in +# Prepare a workspace for installing the feature prepare if [ "X${FLAVOUR}X" == "XsimpleX" ] From e573a1dc33bb437f0f176761232e5c15183d5f67 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Thu, 18 Apr 2024 10:21:29 +0200 Subject: [PATCH 38/42] fix: Some PR fixes --- README.md.gotmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md.gotmpl b/README.md.gotmpl index f183c7d..3b66d11 100644 --- a/README.md.gotmpl +++ b/README.md.gotmpl @@ -297,7 +297,7 @@ These files make up a feature: for your new feature * `motd.sh`: (optional) If you want to show some information to the users upon login, put them here. -And an optional, but recommended `.goss` folder for [integration testing](#integration-testing). +And optional, but recommended [integration tests](integration-testing) in a `.goss` folder. ### Flavours From 4fb0418a1561ac7f4a582c98d7e8f4436d2c9f95 Mon Sep 17 00:00:00 2001 From: DO! DevOps bot Date: Thu, 18 Apr 2024 08:21:58 +0000 Subject: [PATCH 39/42] docs: Automatic docs update --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e22022..7562402 100644 --- a/README.md +++ b/README.md @@ -657,7 +657,7 @@ These files make up a feature: for your new feature * `motd.sh`: (optional) If you want to show some information to the users upon login, put them here. -And an optional, but recommended `.goss` folder for [integration testing](#integration-testing). +And optional, but recommended [integration tests](integration-testing) in a `.goss` folder. ### Flavours @@ -822,6 +822,7 @@ flowchart TD click F "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/test.yml" "Test workflow" click H "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow" ```mermaid +maid vops/cloudcontrol/blob/develop/.github/workflows/test.yml" "Test workflow" click H "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow" ```mermaid From 25c08410b643c5d1e1bb678c5d3a07b002517738 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Wed, 26 Jun 2024 14:32:39 +0200 Subject: [PATCH 40/42] docs: Fixed generated readme --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 7562402..5f3bbc0 100644 --- a/README.md +++ b/README.md @@ -822,8 +822,3 @@ flowchart TD click F "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/test.yml" "Test workflow" click H "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow" ```mermaid -maid -vops/cloudcontrol/blob/develop/.github/workflows/test.yml" "Test workflow" - click H "https://github.com/dodevops/cloudcontrol/blob/develop/.github/workflows/release.yml" "Release workflow" -```mermaid -```mermaid From c4aba15a45168af7afe6e5893d24dbf5fac94d8a Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Thu, 27 Jun 2024 08:08:19 +0200 Subject: [PATCH 41/42] feat: Include cmctl Also includes a patch to build.sh to make it more reliable. Fixes #140 --- build.sh | 6 ++++-- feature/cmctl/feature.yaml | 7 +++++++ feature/cmctl/goss/goss.yaml | 6 ++++++ feature/cmctl/install.sh | 9 +++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 feature/cmctl/feature.yaml create mode 100644 feature/cmctl/goss/goss.yaml create mode 100644 feature/cmctl/install.sh diff --git a/build.sh b/build.sh index d171681..53b513d 100644 --- a/build.sh +++ b/build.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -euo pipefail + # CloudControl build script # Usage: # @@ -27,8 +29,8 @@ for FLAVOUR in ${FLAVOURS} do cat build/Dockerfile.prefix > Dockerfile cat "flavour/${FLAVOUR}/Dockerfile.flavour" >> Dockerfile - cat build/Dockerfile.suffix.mo | docker run --rm -i -e FLAVOUR=${FLAVOUR} -e BUILD_DATE=$(date -Iseconds) metal3d/mo >> Dockerfile - docker build --pull . -t "ghcr.io/dodevops/cloudcontrol-${FLAVOUR}:${TAG}" + cat build/Dockerfile.suffix.mo | docker run --rm -i -e FLAVOUR=${FLAVOUR} -e BUILD_DATE=$(date -Iseconds) ghcr.io/tests-always-included/mo:3.0.5 >> Dockerfile + docker build --pull . --no-cache -t "ghcr.io/dodevops/cloudcontrol-${FLAVOUR}:${TAG}" done if [ -e Dockerfile.sav ] ; then diff --git a/feature/cmctl/feature.yaml b/feature/cmctl/feature.yaml new file mode 100644 index 0000000..765eca6 --- /dev/null +++ b/feature/cmctl/feature.yaml @@ -0,0 +1,7 @@ +icon: "📨" +title: "cmctl" +description: "Installs the cert-manager Command Line Tool" +configuration: + - | + Environment CMCTL_VERSION: Version of cmctl to install (optional) + Defaults to `latest` diff --git a/feature/cmctl/goss/goss.yaml b/feature/cmctl/goss/goss.yaml new file mode 100644 index 0000000..8a02ad4 --- /dev/null +++ b/feature/cmctl/goss/goss.yaml @@ -0,0 +1,6 @@ +command: + cmctl: + exec: "/home/cloudcontrol/bin/cmctl version --client" + stdout: + - "Client Version" + exit-status: 0 diff --git a/feature/cmctl/install.sh b/feature/cmctl/install.sh new file mode 100644 index 0000000..6d6e489 --- /dev/null +++ b/feature/cmctl/install.sh @@ -0,0 +1,9 @@ +. /feature-installer-utils.sh + +# Prepare a workspace for installing the feature +prepare + +download "https://github.com/cert-manager/cmctl/releases/${CMCTL_VERSION:-latest}/download/cmctl_linux_$(getPlatform)" cmctl +execHandle "Making cmctl executable" chmod +x cmctl +execHandle "Copying tool to ${BINPATH}" cp cmctl "${BINPATH}" +cleanup \ No newline at end of file From bc91cd5e635fac43c8a862f7afd8e69c91145085 Mon Sep 17 00:00:00 2001 From: DO! DevOps bot Date: Thu, 27 Jun 2024 06:08:46 +0000 Subject: [PATCH 42/42] docs: Automatic docs update --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 5f3bbc0..0f2f92d 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Following features and tools are supported: * 🐟 Fish Shell * 📷 AzCopy * 🪪 Certificates +* 📨 cmctl * ⚙️ Direnv * ⛵️ Helm * 🛠 JQ @@ -54,6 +55,7 @@ Following features and tools are supported: * [Fish Shell](#_fish) * [AzCopy](#azcopy) * [Certificates](#certificates) + * [cmctl](#cmctl) * [Direnv](#direnv) * [Helm](#helm) * [JQ](#jq) @@ -395,6 +397,17 @@ Adds specified trusted certificate authorities into the container (optional). Defaults to `/certificates`. If something different than the default is used, the volume-target needs to be adapted to the same directory +### cmctl + +Installs the cert-manager Command Line Tool + +#### Configuration + +* USE_cmctl: Enable this feature +* DEBUG_cmctl: Debug this feature +* Environment CMCTL_VERSION: Version of cmctl to install (optional) + Defaults to `latest` + ### Direnv Installs [Direnv](https://direnv.net/)