Skip to content

Commit 9cdb2b7

Browse files
authored
Merge branch 'master' into update_service_account
2 parents 883c9ba + 82c0d8d commit 9cdb2b7

File tree

310 files changed

+2393
-1114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

310 files changed

+2393
-1114
lines changed

.bazelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
build --workspace_status_command hack/build/print-workspace-status.sh
2-
test --test_output=errors --test_timeout=-1,-1,-1,2400
2+
test --test_output=all --test_timeout=-1,-1,-1,2400

.github/workflows/e2e-kind-create.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Cockroach Authors
1+
# Copyright 2025 The Cockroach Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/e2e-kind-decommission.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Cockroach Authors
1+
# Copyright 2025 The Cockroach Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/e2e-kind-upgrades.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Cockroach Authors
1+
# Copyright 2025 The Cockroach Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ on:
2626

2727
jobs:
2828
e2e-kind-upgrades:
29-
runs-on: ubuntu-latest
29+
runs-on: ubuntu-latest-4-core
3030
strategy:
3131
fail-fast: false
3232
steps:

.github/workflows/e2e-kind-upgradessha256.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Cockroach Authors
1+
# Copyright 2025 The Cockroach Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/e2e-kind-versionchecker.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Cockroach Authors
1+
# Copyright 2025 The Cockroach Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/nightly-smoketest.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Cockroach Authors
1+
# Copyright 2025 The Cockroach Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/templates.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Cockroach Authors
1+
# Copyright 2025 The Cockroach Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Cockroach Authors
1+
# Copyright 2025 The Cockroach Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/update-crdb-versions.yaml

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Cockroach Authors
1+
# Copyright 2025 The Cockroach Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -31,13 +31,17 @@ jobs:
3131
with:
3232
path: "~/.cache/bazel"
3333
key: bazel
34-
- name: Update CRDB versions
35-
uses: technote-space/create-pr-action@v2
34+
- name: Update CRDB version
35+
run: make release/gen-templates
36+
- name: Create PR
37+
uses: peter-evans/create-pull-request@v5
3638
with:
37-
EXECUTE_COMMANDS: |
38-
make release/gen-templates
39-
COMMIT_MESSAGE: 'Update CRDB versions'
40-
COMMIT_NAME: 'GitHub Actions'
41-
COMMIT_EMAIL: '[email protected]'
42-
PR_BRANCH_NAME: 'crdb-update-${PR_ID}'
43-
PR_TITLE: 'Update CRDB versions'
39+
base: "master"
40+
branch: 'crdb-version-update'
41+
title: "Update CRDB versions"
42+
author: "CRL Release bot <[email protected]>"
43+
body: |
44+
Update supported CRDB versions.
45+
commit-message: |
46+
Update supported CRDB versions.
47+
delete-branch: true

.golangci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Cockroach Authors
1+
# Copyright 2025 The Cockroach Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

BUILD.bazel

+19-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
# gazelle:proto disable_global
33
# gazelle:exclude docs/generated/reference/generate/json_swagger
44

5-
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
5+
load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
6+
7+
# TODO
8+
load("@bazel_gazelle//:def.bzl", "gazelle")
9+
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
10+
load("@rules_oci//oci:defs.bzl", "oci_push")
611

712
# export WORKSPACE so workspace_binary rules can be used outside the root
813
exports_files([
@@ -12,18 +17,22 @@ exports_files([
1217
"go.sum",
1318
])
1419

15-
# TODO
16-
load("@bazel_gazelle//:def.bzl", "gazelle")
17-
1820
gazelle(name = "gazelle")
1921

20-
container_push(
22+
expand_template(
23+
name = "tags",
24+
stamp_substitutions = {
25+
"APP_VERSION": "{{STABLE_DOCKER_TAG}}",
26+
},
27+
template = ["APP_VERSION"],
28+
)
29+
30+
oci_push(
2131
name = "push_operator_image",
22-
format = "Docker",
23-
image = "//cmd/cockroach-operator:operator_image",
24-
registry = "{STABLE_DOCKER_REGISTRY}",
25-
repository = "{STABLE_IMAGE_REPOSITORY}",
26-
tag = "{STABLE_DOCKER_TAG}",
32+
image = "//cmd/cockroach-operator:index",
33+
remote_tags = ":tags",
34+
repository = "${DOCKER_REGISTRY}/${DOCKER_IMAGE_REPOSITORY}",
35+
visibility = ["//visibility:public"],
2736
)
2837

2938
filegroup(

CHANGELOG.md

+29-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,35 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
66
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
# [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.11.0...master)
8+
# [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.18.1...master)
9+
10+
# [v2.18.1](https://github.com/cockroachdb/cockroach-operator/compare/v2.18.0...v2.18.1)
11+
* Added support for openshift 4.19
12+
13+
# [v2.18.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.17.0...v2.18.0)
14+
* Added support for skipping innovative releases post 24.x
15+
* Added support for QoS on init containers.
16+
17+
# [v2.17.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.16.1...v2.17.0)
18+
* Added support for linux/arm64 images.
19+
* Added support for TerminationGracePeriodSeconds in statefulset.
20+
* Upgraded underlying dependencies for cockroach-operator.
21+
22+
# [v2.16.1](https://github.com/cockroachdb/cockroach-operator/compare/v2.16.0...v2.16.1)
23+
* Increased memory limits for the version checker job
24+
25+
# [v2.16.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.15.1...v2.16.0)
26+
27+
# [v2.15.1](https://github.com/cockroachdb/cockroach-operator/compare/v2.15.0...v2.15.1)
28+
* Bug fix, removing deprecated cluster setting `kv.snapshot_recovery.max_rate` from being checked during decommission.
29+
30+
# [v2.15.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.14.0...v2.15.0)
31+
32+
# [v2.14.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.13.0...v2.14.0)
33+
34+
# [v2.13.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.12.0...v2.13.0)
35+
36+
# [v2.12.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.11.0...v2.12.0)
937

1038
# [v2.11.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.10.0...v2.11.0)
1139

DEVELOPER.md

+29-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ since there's no need to set up a remote GKE/OpenShift cluster.
4444

4545
**make dev/up**
4646

47+
Pre-requisite: The command sets up a k3d registry, and to push an image to it, the registry name must resolve to
48+
localhost or 127.0.0.1. Please add the following line to your /etc/hosts file:
49+
50+
```shell
51+
127.0.0.1 registry.localhost
52+
```
53+
4754
This command will get everything set up for you to begin testing out the operator. Specifically it will:
4855

4956
* Start a k3d cluster named test (context=k3d-test) with a managed docker registry
@@ -56,6 +63,18 @@ This command will get everything set up for you to begin testing out the operato
5663

5764
Tears down the k3d cluster.
5865

66+
[Existing Cluster & Repo]:
67+
68+
export DEV_REGISTRY="Your_Registry"
69+
**make k8s/apply**
70+
71+
This command will deploy the operator to an existing cluster. It will build the operator image and push it to the DEV_REGISTRY.
72+
This newly built image will be used to deploy the operator.
73+
74+
**make k8s/delete**
75+
76+
Tears down the cockroach operator deployment applied on the cluster.
77+
5978
## Testing CR Database
6079

6180
Notes on how to test an existing CR Database.
@@ -71,6 +90,9 @@ SELECT * FROM bank.accounts;
7190

7291
## Developer Install Instructions
7392

93+
Pre-requisite:
94+
1. Install kustomize
95+
7496
These instructions are for developers only. If you want to try the alpha please use the instructions in the next
7597
section.
7698

@@ -79,13 +101,18 @@ Install the operator
79101
```console
80102
$ git clone https://github.com/cockroachdb/cockroach-operator.git
81103
$ export CLUSTER=test
104+
$ export APP_VERSION=v$(cat version.txt)
105+
$ export DEV_REGISTRY=us.gcr.io/$(gcloud config get-value project)
82106
# create a gke cluster
83107
$ ./hack/create-gke-cluster.sh -c $CLUSTER
84108

85-
$ DEV_REGISTRY=us.gcr.io/$(gcloud config get-value project) \
109+
$ bazel run //hack/crdbversions:crdbversions -- -operator-image ${DEV_REGISTRY}/cockroach-operator \
110+
-operator-version ${APP_VERSION} -crdb-versions $(PWD)/crdb-versions.yaml -repo-root $(PWD)
111+
112+
$ DEV_REGISTRY=${DEV_REGISTRY} \
86113
K8S_CLUSTER=$(kubectl config view --minify -o=jsonpath='{.contexts[0].context.cluster}') \
87114
bazel run --stamp --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 \
88-
//manifests:install_operator.apply
115+
--define APP_VERSION=${APP_VERSION} //config/default:install.apply
89116
```
90117

91118
There are various examples that can be installed. The files are located in the examples directory.

Makefile

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Cockroach Authors
1+
# Copyright 2025 The Cockroach Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -59,7 +59,7 @@ test/pkg:
5959
# takes a bit of time.
6060
.PHONY: test/verify
6161
test/verify:
62-
bazel test //hack/...
62+
bazel test --test_output=all //hack/...
6363

6464
.PHONY: test/lint
6565
test/lint:
@@ -94,7 +94,7 @@ test/e2e-short:
9494
test/e2e/testrunner-k3d-%: PACKAGE=$*
9595
test/e2e/testrunner-k3d-%:
9696
bazel run //hack/k8s:k8s -- -type k3d
97-
bazel test --stamp //e2e/$(PACKAGE)/... --test_arg=-test.v --test_arg=-test.parallel=4 --test_arg=parallel=true
97+
bazel test --test_output=all --stamp //e2e/$(PACKAGE)/... --test_arg=-test.v --test_arg=-test.parallel=4 --test_arg=parallel=true
9898

9999
# Use this target to run e2e tests using a k3d k8s cluster.
100100
# This target uses k3d to start a k8s cluster and runs the e2e tests
@@ -221,7 +221,7 @@ test/preflight-%: release/generate-bundle
221221
#
222222
.PHONY: dev/build
223223
dev/build: dev/syncdeps
224-
bazel build //...
224+
bazel build //... --define APP_VERSION=$(APP_VERSION)
225225

226226
.PHONY: dev/fmt
227227
dev/fmt:
@@ -280,17 +280,15 @@ dev/down:
280280
#
281281
.PHONY: k8s/apply
282282
k8s/apply:
283-
K8S_CLUSTER=gke_$(GCP_PROJECT)_$(GCP_ZONE)_$(CLUSTER_NAME) \
284283
DEV_REGISTRY=$(DEV_REGISTRY) \
285284
bazel run --stamp --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 \
286285
//config/default:install.apply \
287286
--define APP_VERSION=$(APP_VERSION)
288287

289288
.PHONY: k8s/delete
290289
k8s/delete:
291-
K8S_CLUSTER=gke_$(GCP_PROJECT)_$(GCP_ZONE)_$(CLUSTER_NAME) \
292290
DEV_REGISTRY=$(DEV_REGISTRY) \
293-
bazel run --stamp --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 \
291+
bazel run --stamp --incompatible_use_cc_configure_from_rules_cc \
294292
//config/default:install.delete \
295293
--define APP_VERSION=$(APP_VERSION)
296294

@@ -332,7 +330,7 @@ release/image:
332330
DOCKER_REGISTRY=$(DOCKER_REGISTRY) \
333331
DOCKER_IMAGE_REPOSITORY=$(DOCKER_IMAGE_REPOSITORY) \
334332
APP_VERSION=$(APP_VERSION) \
335-
bazel run --stamp --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 \
333+
bazel run --stamp \
336334
//:push_operator_image
337335

338336
#

0 commit comments

Comments
 (0)