Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e20c9bc
🌱 Upgrade golangci-lint from v2.1.6 to v2.6.2 (#2336)
camilamacedo86 Nov 17, 2025
bf7e39f
Add enum validation annotation to CollisionProtection (#2334)
perdasilva Nov 17, 2025
15b4904
(chore): Add JSONSchema validation for bundle configuration (#2316)
camilamacedo86 Nov 17, 2025
cbdb84c
:seedling: Bump github.com/google/renameio/v2 from 2.0.0 to 2.0.1 (#2…
dependabot[bot] Nov 17, 2025
1eb9b70
Reduce log verbosity by moving BoxCutter reports to debug mode (#2335)
camilamacedo86 Nov 17, 2025
39cbdbe
Restore last-applied-config annotation in cache (#2338)
tmshort Nov 17, 2025
697f392
:seedling: Bump github.com/prometheus/common from 0.67.2 to 0.67.3 (#…
dependabot[bot] Nov 18, 2025
fc65e52
:seedling: Bump click from 8.3.0 to 8.3.1 (#2342)
dependabot[bot] Nov 18, 2025
472e8a2
(chore): Use label-based cache for revision lookups instead of explic…
camilamacedo86 Nov 18, 2025
be247a9
Add /test-profile slash command for Claude Code integration (#2309)
tmshort Nov 18, 2025
6ef62de
Downgrade bingo output files to v0.9.0 (#2343)
tmshort Nov 18, 2025
f3569d5
Fix Boxcutter manifest ordering inconsistency (#2329)
tmshort Nov 18, 2025
03eb884
Use local cache to check kind version (#2346)
tmshort Nov 19, 2025
12ac242
fix: rename owner label and clarify variable naming (#2349)
camilamacedo86 Nov 19, 2025
1355ff7
override local pull policy with permissive policy (#2339)
grokspawn Nov 19, 2025
65f2ab9
Merge branch 'main' into synchronize
Nov 20, 2025
3998a52
UPSTREAM: <carry>: Add OpenShift specific files
dtfranz Oct 26, 2023
78a07ed
UPSTREAM: <carry>: Add new tests for single/own namespaces install modes
camilamacedo86 Oct 6, 2025
9a712bb
UPSTREAM: <carry>: Upgrade OCP image from 4.20 to 4.21
camilamacedo86 Oct 13, 2025
d49c433
UPSTREAM: <carry>: [Default Catalog Tests] - Change logic to get ocp …
camilamacedo86 Oct 13, 2025
2f09c11
UPSTREAM: <carry>: Update OCP catalogs to v4.21
tmshort Oct 13, 2025
faf688b
UPSTREAM: <carry>: support singleown cases in disconnected
kuiwang02 Oct 16, 2025
4bf88d7
UPSTREAM: <carry>: fix cases 81696 and 74618 for product code changes
kuiwang02 Oct 17, 2025
ac40dc0
UPSTREAM: <carry>: Define Default timeouts and apply their usage accr…
camilamacedo86 Oct 22, 2025
4fa8875
UPSTREAM: <carry>: Update to new feature-gate options in helm
tmshort Oct 22, 2025
1c19920
UPSTREAM: <carry>: Fix flake for single/own ns tests by ensuring uniq…
camilamacedo86 Oct 22, 2025
5cb8f20
UPSTREAM: <carry>: [OTE]: Enhance single/own ns based on review comme…
camilamacedo86 Oct 24, 2025
4341b6c
UPSTREAM: <carry>: Update OwnSingle template to use spec.config.inlin…
kuiwang02 Nov 3, 2025
d00b2fb
UPSTREAM: <carry>: [OTE]: Add webhook cleanup validation on extension…
camilamacedo86 Nov 4, 2025
db9f4df
UPSTREAM: <carry>: Add [OTP] to migrated cases
kuiwang02 Nov 7, 2025
c8af41d
UPSTREAM: <carry>: [OTE]: Upgrade dependencies used
camilamacedo86 Nov 5, 2025
8d5b1ad
UPSTREAM: <carry>: fix(OTE): fix OpenShift Kubernetes replace version…
camilamacedo86 Nov 10, 2025
0218320
UPSTREAM: <carry>: [Default Catalog Tests] Upgrade go 1.24.6 and depe…
camilamacedo86 Nov 11, 2025
0953fe1
UPSTREAM: <carry>: add disconnected environment support with custom p…
kuiwang02 Nov 12, 2025
9bbba1f
UPSTREAM: <carry>: migrate jiazha test cases to OTE
jianzhangbjz Nov 14, 2025
83ac226
UPSTREAM: <carry>: migrate clustercatalog case to ote
Xia-Zhao-rh Oct 17, 2025
f88dbb1
UPSTREAM: <drop>: go mod vendor
Nov 20, 2025
d4b2e7a
UPSTREAM: <drop>: remove upstream GitHub configuration
Nov 20, 2025
59f15d2
UPSTREAM: <drop>: configure the commit-checker
Nov 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ $(GOJQ): $(BINGO_DIR)/gojq.mod
@echo "(re)installing $(GOBIN)/gojq-v0.12.17"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=gojq.mod -o=$(GOBIN)/gojq-v0.12.17 "github.com/itchyny/gojq/cmd/gojq"

GOLANGCI_LINT := $(GOBIN)/golangci-lint-v2.1.6
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v2.6.2
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/golangci-lint-v2.1.6"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v2.1.6 "github.com/golangci/golangci-lint/v2/cmd/golangci-lint"
@echo "(re)installing $(GOBIN)/golangci-lint-v2.6.2"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v2.6.2 "github.com/golangci/golangci-lint/v2/cmd/golangci-lint"

GORELEASER := $(GOBIN)/goreleaser-v1.26.2
$(GORELEASER): $(BINGO_DIR)/goreleaser.mod
Expand Down
6 changes: 2 additions & 4 deletions .bingo/golangci-lint.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.24.2
go 1.24.6

toolchain go1.24.3

require github.com/golangci/golangci-lint/v2 v2.1.6 // cmd/golangci-lint
require github.com/golangci/golangci-lint/v2 v2.6.2 // cmd/golangci-lint
319 changes: 156 additions & 163 deletions .bingo/golangci-lint.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .bingo/variables.env
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CRD_REF_DOCS="${GOBIN}/crd-ref-docs-v0.2.0"

GOJQ="${GOBIN}/gojq-v0.12.17"

GOLANGCI_LINT="${GOBIN}/golangci-lint-v2.1.6"
GOLANGCI_LINT="${GOBIN}/golangci-lint-v2.6.2"

GORELEASER="${GOBIN}/goreleaser-v1.26.2"

Expand Down
98 changes: 98 additions & 0 deletions .claude/commands/test-profile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
description: Profile memory and CPU usage during e2e tests and analyze results
---

# Test Profiling

Profile memory and CPU usage during e2e tests using the Go-based `bin/test-profile` tool.

## Available Commands

### /test-profile start [name]
Start background profiling daemon. Collects heap/CPU profiles from operator-controller and catalogd every 10s.
- Auto-stops after 3 consecutive collection failures (e.g., cluster teardown)
- Use with any test command: `make test-e2e`, `make test-experimental-e2e`, etc.
- Follow with `/test-profile stop` to generate analysis

**Example:**
```bash
/test-profile start baseline
make test-e2e
/test-profile stop
```

### /test-profile stop
Stop profiling daemon and generate analysis report. Cleans up port-forwards and empty profiles.

### /test-profile run [name] [test-target]
Automated workflow: start test, profile until completion, analyze.
- Default test-target: `test-e2e`
- Other targets: `test-experimental-e2e`, `test-upgrade-e2e`, etc.

**Example:**
```bash
/test-profile run baseline test-e2e
```

### /test-profile analyze [name]
Analyze existing profiles in `test-profiles/[name]/`. Generates markdown report with:
- Memory/CPU growth patterns
- Top allocators
- OpenAPI, JSON, and cache hotspots

### /test-profile compare [baseline] [optimized]
Compare two test runs. Outputs to `test-profiles/comparisons/[baseline]-vs-[optimized].md`

### /test-profile collect
One-time snapshot of heap/CPU profiles from running pods. Saves to `test-profiles/manual/`

## Implementation Steps

When executing commands, I will:

1. **Build tool**: `make build-test-profiler` (builds to `bin/test-profile`)
2. **Execute command**: `./bin/test-profile [command] [args]`
3. **For start/stop workflow**: Monitor daemon logs, handle errors gracefully
4. **For run command**: Start test in background, monitor progress, analyze on completion
5. **For analysis**: Present key findings from generated markdown reports

## Configuration

Environment variables (defaults shown):
```bash
TEST_PROFILE_COMPONENTS="operator-controller:olmv1-system:operator-controller-controller-manager:6060;catalogd:olmv1-system:catalogd-controller-manager:6060"
TEST_PROFILE_INTERVAL=10 # seconds between collections
TEST_PROFILE_CPU_DURATION=10 # CPU profiling duration
TEST_PROFILE_MODE=both # both|heap|cpu
TEST_PROFILE_DIR=./test-profiles
TEST_PROFILE_TEST_TARGET=test-e2e
```

## Output Structure

```
test-profiles/
├── [name]/
│ ├── operator-controller/
│ │ ├── heap*.pprof
│ │ └── cpu*.pprof
│ ├── catalogd/
│ │ ├── heap*.pprof
│ │ └── cpu*.pprof
│ ├── profiler.log
│ └── analysis.md
└── comparisons/
└── [name1]-vs-[name2].md
```

## Tool Location

- Source: `hack/tools/test-profiling/` (Go-based CLI)
- Binary: `bin/test-profile`
- Make targets: `make build-test-profiler`, `make start-profiling/[name]`, `make stop-profiling`

## Requirements

- kubectl access to cluster
- go tool pprof (for analysis)
- Go version minimum from `hack/tools/test-profiling/go.mod` (for building)
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ vendor/
\#*\#
.\#*

# AI temp files files
.claude/
# AI temp/local files
.claude/settings.local.json
.claude/history/
.claude/cache/
.claude/logs/
.claude/.session*
.claude/*.log

# documentation website asset folder
site
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,13 @@ generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyI
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) object:headerFile="hack/boilerplate.go.txt" paths="./..."

.PHONY: verify
verify: k8s-pin kind-verify-versions fmt generate manifests update-tls-profiles crd-ref-docs #HELP Verify all generated code is up-to-date. Runs k8s-pin instead of just tidy.
verify: k8s-pin kind-verify-versions fmt generate manifests update-tls-profiles crd-ref-docs verify-bingo #HELP Verify all generated code is up-to-date. Runs k8s-pin instead of just tidy.
git diff --exit-code

.PHONY: verify-bingo
verify-bingo: $(BINGO)
$(BINGO) get -v -t 15

.PHONY: fix-lint
fix-lint: $(GOLANGCI_LINT) #EXHELP Fix lint issues
$(GOLANGCI_LINT) run --fix --build-tags $(GO_BUILD_TAGS) $(GOLANGCI_LINT_ARGS)
Expand Down Expand Up @@ -385,7 +389,7 @@ kind-clean: $(KIND) #EXHELP Delete the kind cluster.
$(KIND) delete cluster --name $(KIND_CLUSTER_NAME)

.PHONY: kind-verify-versions
kind-verify-versions:
kind-verify-versions: $(KIND)
env K8S_VERSION=v$(K8S_VERSION) KIND=$(KIND) GOBIN=$(GOBIN) hack/tools/validate_kindest_node.sh


Expand Down
14 changes: 2 additions & 12 deletions api/v1/clusterextensionrevision_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/types"
)

const (
Expand All @@ -40,6 +39,7 @@ const (
ClusterExtensionRevisionReasonIncomplete = "Incomplete"
ClusterExtensionRevisionReasonProgressing = "Progressing"
ClusterExtensionRevisionReasonArchived = "Archived"
ClusterExtensionRevisionReasonMigrated = "Migrated"
)

// ClusterExtensionRevisionSpec defines the desired state of ClusterExtensionRevision.
Expand All @@ -66,10 +66,6 @@ type ClusterExtensionRevisionSpec struct {
// +listMapKey=name
// +optional
Phases []ClusterExtensionRevisionPhase `json:"phases,omitempty"`
// Previous references previous revisions that objects can be adopted from.
//
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="previous is immutable"
Previous []ClusterExtensionRevisionPrevious `json:"previous,omitempty"`
}

// ClusterExtensionRevisionLifecycleState specifies the lifecycle state of the ClusterExtensionRevision.
Expand Down Expand Up @@ -108,6 +104,7 @@ type ClusterExtensionRevisionObject struct {
// already existing on the cluster or even owned by another controller.
//
// +kubebuilder:default="Prevent"
// +kubebuilder:validation:Enum=Prevent;IfNoController;None
// +optional
CollisionProtection CollisionProtection `json:"collisionProtection,omitempty"`
}
Expand All @@ -129,13 +126,6 @@ const (
CollisionProtectionNone CollisionProtection = "None"
)

type ClusterExtensionRevisionPrevious struct {
// +kubebuilder:validation:Required
Name string `json:"name"`
// +kubebuilder:validation:Required
UID types.UID `json:"uid"`
}

// ClusterExtensionRevisionStatus defines the observed state of a ClusterExtensionRevision.
type ClusterExtensionRevisionStatus struct {
// +listType=map
Expand Down
20 changes: 0 additions & 20 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions cmd/catalogd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ import (
"github.com/operator-framework/operator-controller/internal/catalogd/storage"
"github.com/operator-framework/operator-controller/internal/catalogd/webhook"
sharedcontrollers "github.com/operator-framework/operator-controller/internal/shared/controllers"
cacheutil "github.com/operator-framework/operator-controller/internal/shared/util/cache"
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
httputil "github.com/operator-framework/operator-controller/internal/shared/util/http"
imageutil "github.com/operator-framework/operator-controller/internal/shared/util/image"
Expand Down Expand Up @@ -255,8 +254,6 @@ func run(ctx context.Context) error {

cacheOptions := crcache.Options{
ByObject: map[client.Object]crcache.ByObject{},
// Memory optimization: strip managed fields and large annotations from cached objects
DefaultTransform: cacheutil.StripManagedFieldsAndAnnotations(),
}

saKey, err := sautil.GetServiceAccount()
Expand Down
4 changes: 1 addition & 3 deletions cmd/operator-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ import (
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/render/registryv1"
"github.com/operator-framework/operator-controller/internal/operator-controller/scheme"
sharedcontrollers "github.com/operator-framework/operator-controller/internal/shared/controllers"
cacheutil "github.com/operator-framework/operator-controller/internal/shared/util/cache"
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
httputil "github.com/operator-framework/operator-controller/internal/shared/util/http"
imageutil "github.com/operator-framework/operator-controller/internal/shared/util/image"
Expand Down Expand Up @@ -233,8 +232,6 @@ func run() error {
cfg.systemNamespace: {LabelSelector: k8slabels.Everything()},
},
DefaultLabelSelector: k8slabels.Nothing(),
// Memory optimization: strip managed fields and large annotations from cached objects
DefaultTransform: cacheutil.StripAnnotations(),
}

if features.OperatorControllerFeatureGate.Enabled(features.BoxcutterRuntime) {
Expand Down Expand Up @@ -586,6 +583,7 @@ func setupBoxcutter(
ceReconciler.RevisionStatesGetter = &controllers.BoxcutterRevisionStatesGetter{Reader: mgr.GetClient()}
ceReconciler.StorageMigrator = &applier.BoxcutterStorageMigrator{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
ActionClientGetter: acg,
RevisionGenerator: rg,
}
Expand Down
2 changes: 1 addition & 1 deletion commitchecker.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
expectedMergeBase: c06f27fa84371eab49b56da50ef68088251c873b
expectedMergeBase: 1355ff732209e279fe15bb52fc3b772479e1081b
upstreamBranch: main
upstreamOrg: operator-framework
upstreamRepo: operator-controller
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/golang-jwt/jwt/v5 v5.3.0
github.com/google/go-cmp v0.7.0
github.com/google/go-containerregistry v0.20.6
github.com/google/renameio/v2 v2.0.0
github.com/google/renameio/v2 v2.0.1
github.com/gorilla/handlers v1.5.2
github.com/klauspost/compress v1.18.1
github.com/opencontainers/go-digest v1.0.0
Expand All @@ -22,7 +22,8 @@ require (
github.com/operator-framework/helm-operator-plugins v0.8.0
github.com/operator-framework/operator-registry v1.61.0
github.com/prometheus/client_golang v1.23.2
github.com/prometheus/common v0.67.2
github.com/prometheus/common v0.67.3
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2
github.com/spf13/cobra v1.10.1
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.11.1
Expand Down Expand Up @@ -192,7 +193,6 @@ require (
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rubenv/sql-migrate v1.8.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.9.1 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/sigstore/fulcio v1.7.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20251007162407-5df77e3f7d1d h1:KJIErDwbSHjnp/SGzE5ed8Aol7JsKiI5X7yWKAtzhM0=
github.com/google/pprof v0.0.0-20251007162407-5df77e3f7d1d/go.mod h1:I6V7YzU0XDpsHqbsyrghnFZLO1gwK6NPTNvmetQIk9U=
github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg=
github.com/google/renameio/v2 v2.0.0/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4=
github.com/google/renameio/v2 v2.0.1 h1:HyOM6qd9gF9sf15AvhbptGHUnaLTpEI9akAFFU3VyW0=
github.com/google/renameio/v2 v2.0.1/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down Expand Up @@ -418,8 +418,8 @@ github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UH
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.67.2 h1:PcBAckGFTIHt2+L3I33uNRTlKTplNzFctXcWhPyAEN8=
github.com/prometheus/common v0.67.2/go.mod h1:63W3KZb1JOKgcjlIr64WW/LvFGAqKPj0atm+knVGEko=
github.com/prometheus/common v0.67.3 h1:shd26MlnwTw5jksTDhC7rTQIteBxy+ZZDr3t7F2xN2Q=
github.com/prometheus/common v0.67.3/go.mod h1:gP0fq6YjjNCLssJCQp0yk4M8W6ikLURwkdd/YKtTbyI=
github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=
github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=
github.com/redis/go-redis/extra/rediscmd/v9 v9.10.0 h1:uTiEyEyfLhkw678n6EulHVto8AkcXVr8zUcBJNZ0ark=
Expand Down
20 changes: 18 additions & 2 deletions hack/tools/validate_kindest_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,24 @@
# Extract the version of kind, by removing the "${GOBIN}/kind-" prefix
KIND=${KIND#${GOBIN}/kind-}

# Get the version of the image
KIND_VER=$(curl -L -s https://github.com/kubernetes-sigs/kind/raw/refs/tags/${KIND}/pkg/apis/config/defaults/image.go | grep -Eo 'v[0-9]+\.[0-9]+')
GOMODCACHE=$(go env GOMODCACHE)

REGEX='v[0-9]+\.[0-9]+'

# Get the version of the image from the local kind build
if [ -d "${GOMODCACHE}" ]; then
KIND_VER=$(grep -Eo "${REGEX}" ${GOMODCACHE}/sigs.k8s.io/kind@${KIND}/pkg/apis/config/defaults/image.go)
fi

# Get the version of the image from github
if [ -z "${KIND_VER}" ]; then
KIND_VER=$(curl -L -s https://github.com/kubernetes-sigs/kind/raw/refs/tags/${KIND}/pkg/apis/config/defaults/image.go | grep -Eo "${REGEX}")
fi

if [ -z "${KIND_VER}" ]; then
echo "Unable to determine kindest/node version"
exit 1
fi

# Compare the versions
if [ "${KIND_VER}" != "${K8S_VERSION}" ]; then
Expand Down
Loading