diff --git a/.github/workflows/docker-goss.yaml b/.github/workflows/docker-goss.yaml index 78e07bdc..8784fc56 100644 --- a/.github/workflows/docker-goss.yaml +++ b/.github/workflows/docker-goss.yaml @@ -45,20 +45,32 @@ jobs: ghcr.io/${{ github.repository_owner }}/goss - name: Get latest git tag - uses: actions-ecosystem/action-get-latest-tag@v1 + if: github.ref_name == 'master' id: get-latest-tag + run: | + # source: https://github.com/actions-ecosystem/action-get-latest-tag/blob/main/entrypoint.sh + set -e + git config --global --add safe.directory /github/workspace + git fetch --tags --force + # This suppress an error occurred when the repository is a complete one. + git fetch --prune --unshallow 2>/dev/null || true + latest_tag=$(git describe --abbrev=0 --tags || true) + echo "tag=${latest_tag}" >> "$GITHUB_OUTPUT" + echo "Latest tag: $latest_tag" - name: Set short git commit SHA + if: github.ref_name == 'master' run: | calculatedSha=$(git rev-parse --short ${{ github.sha }}) echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV + echo "COMMIT_SHORT_SHA: $calculatedSha" - name: Get the current version of Go from project. run: echo "GO_VERSION_FROM_PROJECT=$(go mod edit -json | jq -r .Go)" >> $GITHUB_ENV - name: Build master goss image if: github.ref_name == 'master' - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: build-args: | GO_VERSION=${{ env.GO_VERSION_FROM_PROJECT }} @@ -72,7 +84,7 @@ jobs: - name: Build release goss image if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: build-args: | GO_VERSION=${{ env.GO_VERSION_FROM_PROJECT }} diff --git a/.github/workflows/docker-integration-tests.yaml b/.github/workflows/docker-integration-tests.yaml new file mode 100644 index 00000000..74986a9e --- /dev/null +++ b/.github/workflows/docker-integration-tests.yaml @@ -0,0 +1,87 @@ +name: Docker images for integration tests + +on: +# push: +# branches: +# - master + workflow_dispatch: + +env: + PLATFORMS: "linux/amd64" + +jobs: + list-dockerfiles: + name: Create list of existing dockerfiles + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Get file list + id: set-matrix + run: | + # lists all Dockerfile_* and ignore (grep) files with extension (e.g. *.md5) + # tranforms the file list in JSON array (StackOverflow#10234327) + # converts the list into objects of dockerfile and image name + ls integration-tests/Dockerfile_* | + grep -Ev "\..{0,3}$" | + jq -R -s 'split("\n")[:-1]' | + jq '. | map({dockerfile: ., image: sub(".*_"; "")})' > filelist.json + echo "matrix=$(jq -c . filelist.json)" >> "$GITHUB_OUTPUT" + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + + docker: + needs: [list-dockerfiles] + name: Build and push Docker image + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(needs.list-dockerfiles.outputs.matrix) }} + permissions: + packages: write + contents: read + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: MD5 of Dockerfile + id: md5_result + run: | + echo "md5=$(md5sum "${{ matrix.dockerfile }}" | awk '{ print $1 }')" >> $GITHUB_OUTPUT + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository_owner }}/${{ matrix.image }} + labels: | + rocks.goss.dockerfile-md5=${{ steps.md5_result.outputs.md5 }} + + - name: Build and push tag + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ matrix.dockerfile }} + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:latest + labels: ${{ steps.meta.outputs.labels }} + platforms: ${{ env.PLATFORMS }} diff --git a/.github/workflows/golangci.yaml b/.github/workflows/golangci.yaml index c04a58a9..b6ddfd13 100644 --- a/.github/workflows/golangci.yaml +++ b/.github/workflows/golangci.yaml @@ -41,10 +41,14 @@ jobs: - name: Unit tests and coverage run: make cov - integartion-test: + integration-test: needs: [coverage] name: Integration tests - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 @@ -52,4 +56,12 @@ jobs: go-version-file: go.mod - name: Integration tests - run: make test-int-all + shell: bash + run: | + os_name="$(go env GOOS)" + if [[ "${os_name}" == "darwin" || "${os_name}" == "windows" ]]; then + make "test-int-${os_name}-all" + else + # linux runs all tests; + make test-int-all + fi diff --git a/.travis.yml b/.travis.yml index caaa00d1..424ec3bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: go go: - - 1.21.x + - 1.22.x os: - osx diff --git a/Dockerfile b/Dockerfile index 93a143a3..2849a2b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,19 @@ -ARG GO_VERSION=1.21 - -FROM docker.io/golang:${GO_VERSION}-alpine AS base - -ARG GOSS_VERSION=v0.0.0 -WORKDIR /build - -RUN --mount=target=. \ - CGO_ENABLED=0 go build \ - -ldflags "-X github.com/goss-org/goss/util.Version=${GOSS_VERSION} -s -w" \ - -o "/release/goss" \ - ./cmd/goss - -FROM alpine:3.19 - -COPY --from=base /release/* /usr/bin/ - -RUN mkdir /goss -VOLUME /goss +ARG GO_VERSION=1.22 + +FROM docker.io/golang:${GO_VERSION}-alpine AS base + +ARG GOSS_VERSION=v0.0.0 +WORKDIR /build + +RUN --mount=target=. \ + CGO_ENABLED=0 go build \ + -ldflags "-X github.com/goss-org/goss/util.Version=${GOSS_VERSION} -s -w" \ + -o "/release/goss" \ + ./cmd/goss + +FROM alpine:3.19 + +COPY --from=base /release/* /usr/bin/ + +RUN mkdir /goss +VOLUME /goss diff --git a/README.md b/README.md index cc5d4043..fe18d0fc 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,8 @@ This will install goss and [dgoss](https://github.com/goss-org/goss/tree/master/ # Install latest version to /usr/local/bin curl -fsSL https://goss.rocks/install | sh -# Install v0.3.16 version to ~/bin -curl -fsSL https://goss.rocks/install | GOSS_VER=v0.3.16 GOSS_DST=~/bin sh +# Install v0.4.8 version to ~/bin +curl -fsSL https://goss.rocks/install | GOSS_VER=v0.4.8 GOSS_DST=~/bin sh ``` @@ -73,12 +73,12 @@ chmod +rx /usr/local/bin/dgoss ```bash # See https://github.com/goss-org/goss/releases for release versions -VERSION=v0.3.10 +VERSION=v0.4.8 curl -L "https://github.com/goss-org/goss/releases/download/${VERSION}/goss-linux-amd64" -o /usr/local/bin/goss chmod +rx /usr/local/bin/goss # (optional) dgoss docker wrapper (use 'master' for latest version) -VERSION=v0.3.10 +VERSION=v0.4.8 curl -L "https://github.com/goss-org/goss/releases/download/${VERSION}/dgoss" -o /usr/local/bin/dgoss chmod +rx /usr/local/bin/dgoss ``` @@ -93,11 +93,11 @@ make build ## Full Documentation -[Full Documentation](https://github.com/goss-org/goss/blob/e73553f9c3065ac297499dafb4f8abef6acb24ad/docs/manual.md) +[Full Documentation](https://goss.readthedocs.io/en/stable/) ## Using the container image -[Using the Goss container image](docs/container_image.md) +[Using the Goss container image](https://goss.readthedocs.io/en/stable/container_image/) ## Quick start diff --git a/development/build_images.sh b/development/build_images.sh index 9238294b..fcfc1da9 100755 --- a/development/build_images.sh +++ b/development/build_images.sh @@ -4,6 +4,7 @@ set -xeu SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" INTEGRATION_TEST_DIR="$SCRIPT_DIR/../integration-tests/" +CONTAINER_REPOSITORY="aelsabbahy" LABEL_DATE=$(date -u +'%Y-%m-%dT%H:%M:%S.%3NZ') LABEL_URL="https://github.com/goss-org/goss" @@ -12,6 +13,7 @@ LABEL_REVISION=$(git rev-parse HEAD) for docker_file in $INTEGRATION_TEST_DIR/Dockerfile_*; do [[ $docker_file == *.md5 ]] && continue os=$(cut -d '_' -f2 <<<"$docker_file") + md5=$(md5sum "$docker_file" | awk '{ print $1 }') docker build \ --label "org.opencontainers.image.created=$LABEL_DATE" \ --label "org.opencontainers.image.description=Quick and Easy server testing/validation" \ @@ -21,5 +23,6 @@ for docker_file in $INTEGRATION_TEST_DIR/Dockerfile_*; do --label "org.opencontainers.image.title=goss" \ --label "org.opencontainers.image.url=$LABEL_URL" \ --label "org.opencontainers.image.version=manual" \ - -t "aelsabbahy/goss_${os}:latest" - < "$docker_file" + --label "rocks.goss.dockerfile-md5"=$md5 \ + -t "$CONTAINER_REPOSITORY/goss_${os}:latest" - < "$docker_file" done diff --git a/development/push_images.sh b/development/push_images.sh index fcbc4557..680f9605 100755 --- a/development/push_images.sh +++ b/development/push_images.sh @@ -3,7 +3,8 @@ set -xeu SCRIPT_DIR=$(readlink -f "$(dirname "$0")") -images=$(docker images | grep '^aelsabbahy/goss_.*latest' | awk '$0=$1') +CONTAINER_REPOSITORY="aelsabbahy" +images=$(docker images | grep "^$CONTAINER_REPOSITORY/goss_.*latest" | awk '$0=$1') # Use md5sum to determine if CI needs to do a docker build pushd "$SCRIPT_DIR/../integration-tests"; diff --git a/extras/dgoss/README.md b/extras/dgoss/README.md index ebe7fd3f..8dd1d827 100644 --- a/extras/dgoss/README.md +++ b/extras/dgoss/README.md @@ -25,8 +25,8 @@ Since goss runs on the target container, dgoss can be used on a Mac OSX system b curl -L https://raw.githubusercontent.com/goss-org/goss/master/extras/dgoss/dgoss -o /usr/local/bin/dgoss chmod +rx /usr/local/bin/dgoss -# Download desired goss version to your preferred location (e.g. v0.3.6) -curl -L https://github.com/goss-org/goss/releases/download/v0.3.6/goss-linux-amd64 -o ~/Downloads/goss-linux-amd64 +# Download desired goss version to your preferred location (e.g. v0.4.8) +curl -L https://github.com/goss-org/goss/releases/download/v0.4.8/goss-linux-amd64 -o ~/Downloads/goss-linux-amd64 # Set your GOSS_PATH to the above location export GOSS_PATH=~/Downloads/goss-linux-amd64 diff --git a/extras/kgoss/README.md b/extras/kgoss/README.md index eb9f14d4..09e8f776 100644 --- a/extras/kgoss/README.md +++ b/extras/kgoss/README.md @@ -59,7 +59,7 @@ chmod a+rx "${dest_dir}/kgoss" ## install goss if [[ ! $(which jq) ]]; then echo "jq is required, get from https://stedolan.github.io/jq"; fi -version=v0.3.8 +version=v0.4.8 arch=amd64 host=github.com # for private repos, leave `host` blank or same as above: diff --git a/go.mod b/go.mod index 959bbba8..7e88ac01 100644 --- a/go.mod +++ b/go.mod @@ -1,25 +1,25 @@ module github.com/goss-org/goss -go 1.21 +go 1.22 require ( github.com/Masterminds/sprig/v3 v3.2.3 github.com/achanda/go-sysctl v0.0.0-20160222034550-6be7678c45d2 github.com/blang/semver/v4 v4.0.0 github.com/cheekybits/genny v1.0.0 - github.com/fatih/color v1.16.0 + github.com/fatih/color v1.17.0 github.com/goss-org/GOnetstat v0.0.0-20230101144325-22be0bd9e64d github.com/goss-org/go-ps v0.0.0-20230609005227-7b318e6a56e5 github.com/hashicorp/logutils v1.0.0 - github.com/miekg/dns v1.1.58 + github.com/miekg/dns v1.1.61 github.com/moby/sys/mountinfo v0.7.1 github.com/oleiade/reflections v1.0.1 github.com/onsi/gomega v1.33.1 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pmezard/go-difflib v1.0.0 - github.com/prometheus/client_golang v1.19.0 - github.com/prometheus/common v0.50.0 - github.com/samber/lo v1.39.0 + github.com/prometheus/client_golang v1.19.1 + github.com/prometheus/common v0.55.0 + github.com/samber/lo v1.46.0 github.com/stretchr/testify v1.9.0 github.com/tidwall/gjson v1.17.1 github.com/urfave/cli v1.22.14 @@ -31,31 +31,32 @@ require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/huandu/xstrings v1.4.0 // indirect + github.com/huandu/xstrings v1.5.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/shopspring/decimal v1.3.1 // indirect + github.com/shopspring/decimal v1.4.0 // indirect github.com/spf13/cast v1.6.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect - golang.org/x/crypto v0.23.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.25.0 // indirect + golang.org/x/crypto v0.25.0 // indirect + golang.org/x/exp v0.0.0-20240716160929-1d5bc16f04a8 // indirect + golang.org/x/mod v0.19.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - golang.org/x/tools v0.20.0 // indirect - google.golang.org/protobuf v1.33.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect + golang.org/x/tools v0.23.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect ) diff --git a/go.sum b/go.sum index 6f024b4c..ace20f75 100644 --- a/go.sum +++ b/go.sum @@ -14,6 +14,8 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -24,6 +26,8 @@ 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/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= @@ -46,6 +50,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= +github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= @@ -60,6 +66,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY= +github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= +github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -68,6 +76,8 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g= github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/oleiade/reflections v1.0.1 h1:D1XO3LVEYroYskEsoSiGItp9RUxG6jWnCVvrqH0HHQM= github.com/oleiade/reflections v1.0.1/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g= @@ -80,21 +90,33 @@ 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/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA= github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= +github.com/samber/lo v1.46.0 h1:w8G+oaCPgz1PoCJztqymCFaKwXt+5cCXn51uPxExFfQ= +github.com/samber/lo v1.46.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= @@ -124,17 +146,25 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240716160929-1d5bc16f04a8 h1:Z+vTUQyBb738QmIhbJx3z4htsxDeI+rd0EHvNm8jHkg= +golang.org/x/exp v0.0.0-20240716160929-1d5bc16f04a8/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 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/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= 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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= @@ -149,6 +179,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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= @@ -158,14 +190,20 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= 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.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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= diff --git a/integration-tests/Dockerfile_arch b/integration-tests/Dockerfile_arch index 67833345..0f0627cd 100644 --- a/integration-tests/Dockerfile_arch +++ b/integration-tests/Dockerfile_arch @@ -1,7 +1,6 @@ -FROM base/archlinux +FROM archlinux:base MAINTAINER @siddharthist -RUN pacman -Sy --noconfirm systemd-sysvcompat RUN ln -s /does_not_exist /foo && \ chmod 700 ~root RUN mkfifo /pipe diff --git a/integration-tests/Dockerfile_arch.md5 b/integration-tests/Dockerfile_arch.md5 index 368bc9e8..aa80cc1d 100644 --- a/integration-tests/Dockerfile_arch.md5 +++ b/integration-tests/Dockerfile_arch.md5 @@ -1 +1 @@ -7743af2cd089e92858eca1715db25949 Dockerfile_arch +8fc3ce0c000f89ab09488cccb3ba8e66 Dockerfile_arch diff --git a/integration-tests/Dockerfile_wheezy b/integration-tests/Dockerfile_wheezy index 9c83d08c..f3c76e36 100644 --- a/integration-tests/Dockerfile_wheezy +++ b/integration-tests/Dockerfile_wheezy @@ -4,7 +4,9 @@ LABEL org.opencontainers.image.authors="Ahmed" RUN echo 'deb http://archive.debian.org/debian wheezy main' > /etc/apt/sources.list RUN echo 'deb http://archive.debian.org/debian-security wheezy/updates main' >> /etc/apt/sources.list -RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y apache2 apache2-doc apache2-utils chkconfig vim-tiny ca-certificates tinyproxy && apt-get remove -y vim-tiny && apt-get clean +RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install --yes --force-yes \ + apache2 apache2-doc apache2-utils chkconfig vim-tiny ca-certificates tinyproxy && \ + apt-get remove -y vim-tiny && apt-get clean RUN chkconfig apache2 on RUN chkconfig tinyproxy on diff --git a/integration-tests/Dockerfile_wheezy.md5 b/integration-tests/Dockerfile_wheezy.md5 index 84e9e5dd..fd678787 100644 --- a/integration-tests/Dockerfile_wheezy.md5 +++ b/integration-tests/Dockerfile_wheezy.md5 @@ -1 +1 @@ -557a19e04e66f0a9afb6035952b5ca18 Dockerfile_wheezy +3775dbcd23497095da8f5b7ddb62a540 Dockerfile_wheezy diff --git a/integration-tests/goss/goss-shared.yaml b/integration-tests/goss/goss-shared.yaml index 220ec4e8..42e8a5e7 100644 --- a/integration-tests/goss/goss-shared.yaml +++ b/integration-tests/goss/goss-shared.yaml @@ -206,7 +206,7 @@ http: headers: ["Content-Type: application/json"] body: - '"Foo": "bar"' - - '"User-Agent": "goss/0.0.0"' + - '/"User-Agent": "goss/v?[0-9]+.[0-9]+.[0-9]+"/' http://httpbin/headers?host: status: 200 timeout: 60000 diff --git a/integration-tests/goss/rockylinux9/goss-aa-expected.yaml b/integration-tests/goss/rockylinux9/goss-aa-expected.yaml index 7fd1552f..a5e1aa63 100644 --- a/integration-tests/goss/rockylinux9/goss-aa-expected.yaml +++ b/integration-tests/goss/rockylinux9/goss-aa-expected.yaml @@ -2,7 +2,7 @@ package: httpd: installed: true versions: - - 2.4.57-8.el9 + - 2.4.57-11.el9_4.1 port: tcp:80: listening: true diff --git a/integration-tests/goss/rockylinux9/goss-expected.yaml b/integration-tests/goss/rockylinux9/goss-expected.yaml index bbd4249e..0e950c20 100644 --- a/integration-tests/goss/rockylinux9/goss-expected.yaml +++ b/integration-tests/goss/rockylinux9/goss-expected.yaml @@ -15,7 +15,7 @@ package: httpd: installed: true versions: - - 2.4.57-8.el9 + - 2.4.57-11.el9_4.1 vim-tiny: installed: false addr: diff --git a/integration-tests/goss/vars.yaml b/integration-tests/goss/vars.yaml index 0cc72dba..0686fd1a 100644 --- a/integration-tests/goss/vars.yaml +++ b/integration-tests/goss/vars.yaml @@ -16,7 +16,7 @@ centos7: rockylinux9: proxy: http://127.0.0.1:8888 packages: - httpd: "2.4.57-8.el9" + httpd: "2.4.57-11.el9_4.1" services: httpd: [] trusty: diff --git a/integration-tests/test.sh b/integration-tests/test.sh index 2b9936d1..e92d08b0 100755 --- a/integration-tests/test.sh +++ b/integration-tests/test.sh @@ -8,6 +8,7 @@ os="${1:?"Need OS as 1st arg. e.g. alpine arch centos7 rockylinux9 trusty wheezy arch="${2:?"Need arch as 2nd arg. e.g. amd64 386"}" vars_inline="{inline: bar, overwrite: bar}" +container_repository="aelsabbahy" # setup places us inside repo-root; this preserves current behaviour with least change. cd integration-tests @@ -15,10 +16,10 @@ cd integration-tests cp "../release/goss-linux-$arch" "goss/$os/" # Run build if Dockerfile has changed but hasn't been pushed to dockerhub if ! md5sum -c "Dockerfile_${os}.md5"; then - docker build -t "aelsabbahy/goss_${os}:latest" - < "Dockerfile_$os" + docker build -t "$container_repository/goss_${os}:latest" - < "Dockerfile_$os" # Pull if image doesn't exist locally -elif ! docker images | grep "aelsabbahy/goss_$os";then - docker pull "aelsabbahy/goss_$os" +elif ! docker images | grep "$container_repository/goss_$os";then + docker pull "$container_repository/goss_$os" fi container_name="goss_int_test_${os}_${arch}" @@ -37,7 +38,7 @@ network=goss-test docker network create --driver bridge --subnet '172.19.0.0/16' $network docker run -d --name httpbin --network $network kennethreitz/httpbin opts=(--env OS=$os --cap-add SYS_ADMIN -v "$PWD/goss:/goss" -d --name "$container_name" --security-opt seccomp:unconfined --security-opt label:disable --privileged) -id=$(docker run "${opts[@]}" --network $network "aelsabbahy/goss_$os" /sbin/init) +id=$(docker run "${opts[@]}" --network $network "$container_repository/goss_$os" /sbin/init) ip=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$id") trap "rv=\$?; docker rm -vf $id;docker rm -vf httpbin;docker network rm $network; exit \$rv" INT TERM EXIT # Give httpd time to start up, adding 1 second to see if it helps with intermittent CI failures