Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/k8s.io/client-go-0.32.0
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Jijie Chen <[email protected]>
  • Loading branch information
jijiechen authored Dec 25, 2024
2 parents 738345c + aa528e9 commit 39372bc
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 32 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
push:
branches:
- main
env:
CI_TOOLS_DIR: "/home/runner/work/kuma-smoke/.ci_tools"
jobs:
check:
name: Check
Expand All @@ -18,8 +20,8 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: make deps
run: make deps
- name: make dev/tools
run: make dev/tools
- name: make check
run: make check
- name: golangci-lint
Expand All @@ -38,8 +40,10 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: make deps
run: make deps
- name: make dev/tools
run: |
make dev/tools
echo "${CI_TOOLS_DIR}/bin" >> $GITHUB_PATH
- name: make build
run: make build
- name: make run
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TOP = $(shell pwd)

include mk/deps.mk
include mk/dev.mk
include mk/check.mk
include mk/build.mk
include mk/run.mk
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require (
github.com/blang/semver/v4 v4.0.0
github.com/kong/kubernetes-testing-framework v0.47.2
github.com/kumahq/kuma v0.0.0-20241204051139-86593067f050
github.com/onsi/ginkgo/v2 v2.22.0
github.com/onsi/gomega v1.36.0
github.com/onsi/ginkgo/v2 v2.22.1
github.com/onsi/gomega v1.36.1
github.com/spf13/cobra v1.8.1
k8s.io/api v0.32.0 // indirect
k8s.io/apimachinery v0.32.0 // indirect
Expand Down Expand Up @@ -78,7 +78,7 @@ require (
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
Expand Down Expand Up @@ -161,7 +161,7 @@ require (
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.7.0 // indirect
golang.org/x/tools v0.26.0 // indirect
golang.org/x/tools v0.28.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
gonum.org/v1/gonum v0.15.1 // indirect
google.golang.org/api v0.192.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1624,8 +1624,8 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo=
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo=
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg=
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM=
github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A=
Expand Down Expand Up @@ -1829,10 +1829,10 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg=
github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
github.com/onsi/gomega v1.36.0 h1:Pb12RlruUtj4XUuPUqeEWc6j5DkVVVA49Uf6YLfC95Y=
github.com/onsi/gomega v1.36.0/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
github.com/onsi/ginkgo/v2 v2.22.1 h1:QW7tbJAUDyVDVOM5dFa7qaybo+CRfR7bemlQUN6Z8aM=
github.com/onsi/ginkgo/v2 v2.22.1/go.mod h1:S6aTpoRsSq2cZOd+pssHAlKW/Q/jZt6cPrPlnj4a1xM=
github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw=
github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
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.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
Expand Down Expand Up @@ -2473,8 +2473,8 @@ golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ=
golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0=
golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8=
golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
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=
Expand Down
1 change: 1 addition & 0 deletions mk/dependencies/deps.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
96998f5a97c44fe0581a13e72806ebad04bde997
18 changes: 18 additions & 0 deletions mk/dependencies/kind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -e

OUTPUT_DIR=$1/bin
VERSION="0.24.0"
KIND=${OUTPUT_DIR}/kind
if [ -e "$KIND" ] && [ "v$($KIND --version | cut -d ' ' -f3)" == v${VERSION} ]; then
echo "$($KIND --version ) is already installed at ${OUTPUT_DIR}" ;
exit
fi
echo "Installing kind ${VERSION} ..."
set -x
# see https://kind.sigs.k8s.io/docs/user/quick-start/#installation
curl --location --fail -s -o "${KIND}" https://github.com/kubernetes-sigs/kind/releases/download/v${VERSION}/kind-"${OS}"-"${ARCH}"
chmod +x "${KIND}"
set +x
echo "Kind $VERSION has been installed at $OUTPUT_DIR"
15 changes: 0 additions & 15 deletions mk/deps.mk

This file was deleted.

30 changes: 30 additions & 0 deletions mk/dev.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
SMOKE_PRODUCT_NAME ?= kuma
SMOKE_PRODUCT_VERSION ?= 2.9.2
CI_TOOLS_DIR ?= ${HOME}/.kuma-smoke-dev
CI_TOOLS_BIN_DIR=$(CI_TOOLS_DIR)/bin

export PATH := $(CI_TOOLS_BIN_DIR):$(PATH)

TOOLS_DIR = $(TOP)/tools
TOOLS_DEPS_DIRS=$(TOP)/mk/dependencies
TOOLS_DEPS_LOCK_FILE=mk/dependencies/deps.lock
TOOLS_MAKEFILE=$(TOP)/mk/dev.mk
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)

GINKGO=$(CI_TOOLS_BIN_DIR)/ginkgo

.PHONY: dev/go
dev/go:
GOBIN=${CI_TOOLS_BIN_DIR} go install github.com/onsi/ginkgo/v2/ginkgo@$$(go list -f '{{.Version}}' -m github.com/onsi/ginkgo/v2)
GOBIN=${CI_TOOLS_BIN_DIR} go install github.com/mikefarah/yq/[email protected]

.PHONY: dev/tools
dev/tools: dev/go
$(TOOLS_DIR)/dev/install-dev-tools.sh $(CI_TOOLS_BIN_DIR) $(CI_TOOLS_DIR) "$(TOOLS_DEPS_DIRS)" $(TOOLS_DEPS_LOCK_FILE) $(GOOS) $(GOARCH) $(TOOLS_MAKEFILE)


.PHONY: kind
kind:
echo $(PATH)
kind get clusters
28 changes: 28 additions & 0 deletions tools/dev/install-dev-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -e

CI_TOOLS_BIN_DIR="$1"
CI_TOOLS_DIR="$2"
TOOLS_DEPS_DIRS="$3"
TOOLS_DEPS_LOCK_FILE="$4"
GOOS="$5"
GOARCH="$6"
TOOLS_MAKEFILE="$7"

mkdir -p "$CI_TOOLS_BIN_DIR" "$CI_TOOLS_DIR"/protos
# TOOLS_DEPS_DIRS has space separated directories
IFS=" " read -ra TOOLS_DEPS_DIRS <<< "${TOOLS_DEPS_DIRS[@]}"

# Also compute a hash to use for caching
FILES=$(find "${TOOLS_DEPS_DIRS[@]}" -name '*.sh' | sort)
for i in ${FILES}; do
OS="$GOOS" ARCH="$GOARCH" "$i" "${CI_TOOLS_DIR}" &
done

wait
# use dev.mk to calculate the hash
FILES+=" "${TOOLS_MAKEFILE}
for i in ${FILES}; do cat "${i}"; done | git hash-object --stdin > "$TOOLS_DEPS_LOCK_FILE"

echo "All non code dependencies installed, if you use these tools outside of make add $CI_TOOLS_BIN_DIR to your PATH"

0 comments on commit 39372bc

Please sign in to comment.