Skip to content

Commit 46f59a2

Browse files
committed
update the ips for Q4 2025 and fix up some scripts
1 parent eac53e3 commit 46f59a2

File tree

8 files changed

+8210
-3309
lines changed

8 files changed

+8210
-3309
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,9 @@ lint:
124124
# shell linter
125125
shellcheck:
126126
hack/make-rules/shellcheck.sh
127+
128+
# Run all the code generators
129+
codegen:
130+
hack/make-rules/codegen.sh
127131
#################################################################################
128132
.PHONY: all archeio geranos build unit integration test e2e-test clean update gofmt verify verify-generated lint shellcheck
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# Copyright 2022 The Kubernetes Authors.
3+
# Copyright 2025 The Kubernetes Authors.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -14,13 +14,17 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# wrapper script so we can go:generate with this tool
18-
17+
# script to run all codegen
1918
set -o errexit -o nounset -o pipefail
2019

21-
SELF_DIR="$(dirname "${BASH_SOURCE[0]}")"
22-
REPO_ROOT="$(cd "${SELF_DIR}/../../../../../.." && pwd -P)"
23-
BIN_PATH="${REPO_ROOT}/bin/ranges2go"
20+
# cd to the repo root
21+
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd -P)"
22+
cd "${REPO_ROOT}"
23+
24+
source hack/tools/setup-go.sh
25+
26+
echo "Downloading AWS & GCP IP ranges data..."
27+
curl -fLo 'pkg/net/cloudcidrs/internal/ranges2go/data/aws-ip-ranges.json' 'https://ip-ranges.amazonaws.com/ip-ranges.json'
28+
curl -fLo 'pkg/net/cloudcidrs/internal/ranges2go/data/gcp-cloud.json' 'https://www.gstatic.com/ipranges/cloud.json'
2429

25-
go build -o "${BIN_PATH}" "${SELF_DIR}"
26-
"${BIN_PATH}" "$@"
30+
go generate ./...

hack/make-rules/verify-generated.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ OUT_FILE="${tmpdir}"/zz_generated_range_data.go
3030
export OUT_FILE
3131
DATA_DIR="${REPO_ROOT}"/pkg/net/cloudcidrs/internal/ranges2go/data
3232
export DATA_DIR
33-
./pkg/net/cloudcidrs/internal/ranges2go/run.sh
33+
go run ./pkg/net/cloudcidrs/internal/ranges2go
3434

3535
if ! diff "${OUT_FILE}" ./pkg/net/cloudcidrs/zz_generated_range_data.go; then
3636
>&2 echo ""
37-
>&2 echo "generated file is out of date, please run 'go generate ./...' to regenerate"
37+
>&2 echo "generated file is out of date, please run 'make codegen' to regenerate"
3838
exit 1
3939
fi

pkg/net/cloudcidrs/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ limitations under the License.
1717
// cloudcidrs contains Cloud CIDR matching
1818
package cloudcidrs
1919

20-
//go:generate ./internal/ranges2go/run.sh
20+
//go:generate go run ./internal/ranges2go

0 commit comments

Comments
 (0)