Skip to content

Commit 3df72ef

Browse files
committed
fix merge conflicts
2 parents a085351 + e5af1e0 commit 3df72ef

File tree

296 files changed

+1901
-829
lines changed

Some content is hidden

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

296 files changed

+1901
-829
lines changed

.bazeliskrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
USE_BAZEL_VERSION=5.4.0

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 The Cockroach Authors
1+
# Copyright 2023 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 The Cockroach Authors
1+
# Copyright 2023 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 The Cockroach Authors
1+
# Copyright 2023 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-upgradessha256.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 The Cockroach Authors
1+
# Copyright 2023 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 The Cockroach Authors
1+
# Copyright 2023 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 The Cockroach Authors
1+
# Copyright 2023 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 The Cockroach Authors
1+
# Copyright 2023 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 The Cockroach Authors
1+
# Copyright 2023 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 The Cockroach Authors
1+
# Copyright 2023 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.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ bundle/
6363
faq
6464

6565
_artifacts
66-
bundle.Dockerfile
66+
artifacts
6767
tmp

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 The Cockroach Authors
1+
# Copyright 2023 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.

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,25 @@ 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.8.0...master)
8+
# [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.11.0...master)
9+
10+
# [v2.11.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.10.0...v2.11.0)
11+
12+
* Bug fix to return correct error message if value passed for `whenUnsatisfiable` under `topologySpreadConstraints` field is invalid.
13+
* Add openshift release process for cockroach operator
14+
15+
# [v2.10.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.9.0...v2.10.0)
16+
17+
## Added
18+
19+
* Upgrade the underlying k8s dependencies from 1.20 to 1.21 to support operator installation on k8s 1.25+.
20+
21+
# [v2.9.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.8.0...v2.9.0)
922

1023
## Fixed
1124

1225
* Install init container certs with 600 permissions
26+
* Ensure operator can connect to DBs in all namespaces
1327

1428
# [v2.8.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.7.0...v2.8.0)
1529

Makefile

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 The Cockroach Authors
1+
# Copyright 2023 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.
@@ -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=8 --test_arg=parallel=true
97+
bazel test --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
@@ -210,6 +210,12 @@ test/e2e/testrunner-openshift-packaging: test/openshift-package
210210
--action_env=APP_VERSION=$(APP_VERSION) \
211211
--action_env=DOCKER_REGISTRY=$(DOCKER_REGISTRY)
212212

213+
# Run preflight checks for OpenShift. This expects a running OpenShift cluster.
214+
# Eg. make test/preflight-<operator|bundle|marketplace>
215+
test/preflight-%: CONTAINER=$*
216+
test/preflight-%: release/generate-bundle
217+
@bazel run //hack:redhat-preflight -- $(CONTAINER)
218+
213219
#
214220
# Different dev targets
215221
#
@@ -267,6 +273,7 @@ dev/up: dev/down
267273

268274
.PHONY: dev/down
269275
dev/down:
276+
@bazel build //hack/bin:k3d
270277
@hack/dev.sh down
271278
#
272279
# Targets that allow to install the operator on an existing cluster
@@ -332,7 +339,7 @@ release/image:
332339
# RedHat OpenShift targets
333340
#
334341

335-
#RED HAT IMAGE BUNDLE
342+
#REDHAT IMAGE BUNDLE
336343
RH_BUNDLE_REGISTRY?=registry.connect.redhat.com/cockroachdb
337344
RH_BUNDLE_IMAGE_REPOSITORY?=cockroachdb-operator-bundle
338345
RH_BUNDLE_VERSION?=$(VERSION)
@@ -356,3 +363,16 @@ PKG_MAN_OPTS ?= "$(PKG_CHANNELS) $(PKG_DEFAULT_CHANNEL)"
356363
.PHONY: release/generate-bundle
357364
release/generate-bundle:
358365
bazel run //hack:bundle -- $(RH_BUNDLE_VERSION) $(RH_OPERATOR_IMAGE) $(PKG_MAN_OPTS) $(RH_COCKROACH_DATABASE_IMAGE)
366+
367+
.PHONY: release/publish-operator
368+
publish-operator:
369+
./build/release/teamcity-publish-release.sh
370+
371+
.PHONY: release/publish-operator-openshift
372+
publish-operator-openshift:
373+
./build/release/teamcity-publish-openshift.sh
374+
375+
.PHONY: release/publish-openshift-bundle
376+
release/publish-openshift-bundle:
377+
./build/release/teamcity-publish-openshift-bundle.sh
378+

WORKSPACE

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,15 @@ container_pull(
108108
################################
109109
http_archive(
110110
name = "io_bazel_rules_k8s",
111-
sha256 = "51f0977294699cd547e139ceff2396c32588575588678d2054da167691a227ef",
112-
strip_prefix = "rules_k8s-0.6",
113-
urls = ["https://github.com/bazelbuild/rules_k8s/archive/v0.6.tar.gz"],
111+
sha256 = "ce5b9bc0926681e2e7f2147b49096f143e6cbc783e71bc1d4f36ca76b00e6f4a",
112+
strip_prefix = "rules_k8s-0.7",
113+
urls = ["https://github.com/bazelbuild/rules_k8s/archive/refs/tags/v0.7.tar.gz"],
114114
)
115115

116116
load("@io_bazel_rules_k8s//k8s:k8s.bzl", "k8s_repositories")
117117

118118
k8s_repositories()
119119

120-
load("@io_bazel_rules_k8s//k8s:k8s_go_deps.bzl", k8s_go_deps = "deps")
121-
122-
k8s_go_deps()
123-
124120
load("@io_bazel_rules_k8s//k8s:k8s.bzl", "k8s_defaults")
125121

126122
#############################################################

apis/v1alpha1/action_status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Cockroach Authors
2+
Copyright 2023 The Cockroach Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

apis/v1alpha1/action_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Cockroach Authors
2+
Copyright 2023 The Cockroach Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

apis/v1alpha1/cluster_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Cockroach Authors
2+
Copyright 2023 The Cockroach Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

apis/v1alpha1/cluster_types_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Cockroach Authors
2+
Copyright 2023 The Cockroach Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

apis/v1alpha1/condition_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Cockroach Authors
2+
Copyright 2023 The Cockroach Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

apis/v1alpha1/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Cockroach Authors
2+
Copyright 2023 The Cockroach Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

apis/v1alpha1/groupversion_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Cockroach Authors
2+
Copyright 2023 The Cockroach Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

apis/v1alpha1/restart_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Cockroach Authors
2+
Copyright 2023 The Cockroach Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

apis/v1alpha1/volume.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Cockroach Authors
2+
Copyright 2023 The Cockroach Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

apis/v1alpha1/volume_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Cockroach Authors
2+
Copyright 2023 The Cockroach Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

apis/v1alpha1/webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Cockroach Authors
2+
Copyright 2023 The Cockroach Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

apis/v1alpha1/webhook_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2022 The Cockroach Authors
2+
Copyright 2023 The Cockroach Authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

apis/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Copyright 2022 The Cockroach Authors
2+
# Copyright 2023 The Cockroach Authors
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -17,38 +17,54 @@ set -euxo pipefail
1717

1818
source "$(dirname "${0}")/teamcity-support.sh"
1919

20+
# Default values are defined for the certified bundle.
21+
RH_PROJECT="5f5a433f9d6546ed7aa8634d"
22+
RH_REGISTRY="scan.connect.redhat.com"
23+
RH_REPO="ospid-857fe786-3eb7-4508-aafd-cc74c1b1dc24/cockroachdb-operator-bundle"
24+
BUNDLE_DIR="bundle/cockroachdb-certified"
2025

21-
tc_start_block "Variable Setup"
22-
VERSION="v"$(cat version.txt)
23-
# Matching the version name regex from within the cockroach code except
24-
# for the `metadata` part at the end because Docker tags don't support
25-
# `+` in the tag name.
26-
# https://github.com/cockroachdb/cockroach/blob/4c6864b44b9044874488cfedee3a31e6b23a6790/pkg/util/version/version.go#L75
27-
image_tag="$(echo "${VERSION}" | grep -E -o '^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[-.0-9A-Za-z]+)?$')"
28-
# ^major ^minor ^patch ^preRelease
29-
30-
if [[ -z "$image_tag" ]] ; then
31-
echo "Invalid VERSION \"${VERSION}\". Must be of the format \"vMAJOR.MINOR.PATCH(-PRERELEASE)?\"."
32-
exit 1
26+
# If this is the marketplace bundle, update accordingly.
27+
if ! [[ -z "${MARKETPLACE}" ]]; then
28+
RH_PROJECT="61765afbdd607bfc82e643b8"
29+
RH_REPO="ospid-61765afbdd607bfc82e643b8/cockroachdb-operator-bundle-marketplace"
30+
BUNDLE_DIR="bundle/cockroachdb-certified-rhmp"
3331
fi
3432

35-
rhel_registry="scan.connect.redhat.com"
36-
rh_bundle_image_repository="ospid-857fe786-3eb7-4508-aafd-cc74c1b1dc24/cockroachdb-operator-bundle"
37-
image="$rhel_registry/$rh_bundle_image_repository:$image_tag"
33+
# If it's a dry run, add -dryrun to the image
34+
if ! [[ -z "${DRY_RUN}" ]]; then RH_REPO="${RH_REPO}-dryrun"; fi
3835

39-
if ! [[ -z "${DRY_RUN}" ]] ; then
40-
image="${image}-dryrun"
41-
fi
42-
tc_end_block "Variable Setup"
36+
IMAGE="${RH_REGISTRY}/${RH_REPO}:${TAG}"
37+
38+
main() {
39+
docker_login "${RH_REGISTRY}" "${OPERATOR_REDHAT_REGISTRY_USER}" "${OPERATOR_REDHAT_REGISTRY_KEY}"
40+
41+
generate_bundle
42+
publish_bundle_image
43+
run_preflight
44+
}
45+
46+
generate_bundle() {
47+
# create the certified and marketplace bundles
48+
tc_start_block "Generate bundle"
49+
make release/generate-bundle
50+
tc_end_block "Generate bundle"
51+
}
52+
53+
publish_bundle_image() {
54+
tc_start_block "Make and push bundle image"
4355

56+
pushd "${BUNDLE_DIR}"
57+
docker build -t "${IMAGE}" .
58+
docker push "${IMAGE}"
59+
popd
4460

45-
tc_start_block "Make and push docker images"
46-
configure_docker_creds
47-
docker_login "$rhel_registry" "$OPERATOR_BUNDLE_REDHAT_REGISTRY_USER" "$OPERATOR_BUNDLE_REDHAT_REGISTRY_KEY"
61+
tc_end_block "Make and push bundle image"
62+
}
4863

49-
# TODO(rail): switch to bazel generated images when it supports "FROM: scratch"
50-
cd deploy/certified-metadata-bundle/cockroach-operator
51-
docker build -t $image -f bundle.Dockerfile .
52-
docker push $image
64+
run_preflight() {
65+
bazel build //hack/bin:preflight
66+
PFLT_PYXIS_API_TOKEN="${REDHAT_API_TOKEN}" bazel-bin/hack/bin/preflight \
67+
check operator "${IMAGE}" --docker-config ~/.docker/config.json
68+
}
5369

54-
tc_end_block "Make and push docker images"
70+
main "$@"

0 commit comments

Comments
 (0)