From 04d215e3a28a04e3591f430c95de277ee8cdc972 Mon Sep 17 00:00:00 2001 From: Vaibhav Bhembre Date: Thu, 26 May 2022 14:24:20 -0400 Subject: [PATCH 01/51] Prefer user added --join flags over default when explicitly passed (#886) --- pkg/resource/statefulset.go | 16 ++- .../default_insecure_statefulset.golden | 5 +- .../default_secure.golden | 5 +- .../insecure_statefulset_cli_args.golden | 5 +- ...cure_statefulset_cli_args_with_join.golden | 132 ++++++++++++++++++ ...ure_statefulset_cli_args_with_join_in.yaml | 61 ++++++++ ...insecure_statefulset_with_resources.golden | 3 +- 7 files changed, 218 insertions(+), 9 deletions(-) create mode 100755 pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join.golden create mode 100644 pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join_in.yaml diff --git a/pkg/resource/statefulset.go b/pkg/resource/statefulset.go index 570f67a52..f75260c69 100644 --- a/pkg/resource/statefulset.go +++ b/pkg/resource/statefulset.go @@ -359,7 +359,6 @@ func (b StatefulSetBuilder) dbArgs() []string { aa := []string{ "/cockroach/cockroach.sh", "start", - "--join=" + b.joinStr(), fmt.Sprintf("--advertise-host=$(POD_NAME).%s.%s", b.Cluster.DiscoveryServiceName(), b.Cluster.Namespace()), b.Cluster.SecureMode(), @@ -387,7 +386,20 @@ func (b StatefulSetBuilder) dbArgs() []string { aa = append(aa, "--max-sql-memory $(expr $MEMORY_LIMIT_MIB / 4)MiB") } - return append(aa, b.Spec().AdditionalArgs...) + aa = append(aa, b.Spec().AdditionalArgs...) + + needsDefaultJoin := true + for _, f := range b.Spec().AdditionalArgs { + if strings.Contains(f, "--join") { + needsDefaultJoin = false + break + } + } + + if needsDefaultJoin { + aa = append(aa, "--join="+b.joinStr()) + } + return aa } func (b StatefulSetBuilder) joinStr() string { diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/default_insecure_statefulset.golden b/pkg/resource/testdata/TestStatefulSetBuilder/default_insecure_statefulset.golden index 1ed022b12..468a43662 100755 --- a/pkg/resource/testdata/TestStatefulSetBuilder/default_insecure_statefulset.golden +++ b/pkg/resource/testdata/TestStatefulSetBuilder/default_insecure_statefulset.golden @@ -28,11 +28,12 @@ spec: - command: - /bin/bash - -ecx - - 'exec /cockroach/cockroach.sh start --join=test-cluster-0.test-cluster.test-ns:26258 + - 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns --insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks: {stderr: {channels: [OPS, HEALTH], redact: true}}}" --cache $(expr $MEMORY_LIMIT_MIB / 4)MiB - --max-sql-memory $(expr $MEMORY_LIMIT_MIB / 4)MiB' + --max-sql-memory $(expr $MEMORY_LIMIT_MIB / 4)MiB + --join=test-cluster-0.test-cluster.test-ns:26258' env: - name: COCKROACH_CHANNEL value: kubernetes-operator-gke diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden b/pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden index 32ba7a47a..e45558814 100755 --- a/pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden +++ b/pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden @@ -30,11 +30,12 @@ spec: - command: - /bin/bash - -ecx - - 'exec /cockroach/cockroach.sh start --join=test-cluster-0.test-cluster.test-ns:26258 + - 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns --certs-dir=/cockroach/cockroach-certs/ --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks: {stderr: {channels: [OPS, HEALTH], redact: true}}}" --cache $(expr $MEMORY_LIMIT_MIB - / 4)MiB --max-sql-memory $(expr $MEMORY_LIMIT_MIB / 4)MiB' + / 4)MiB --max-sql-memory $(expr $MEMORY_LIMIT_MIB / 4)MiB + --join=test-cluster-0.test-cluster.test-ns:26258' env: - name: COCKROACH_CHANNEL value: kubernetes-operator-gke diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args.golden b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args.golden index b60566992..fdbdffbdc 100755 --- a/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args.golden +++ b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args.golden @@ -43,10 +43,11 @@ spec: - command: - /bin/bash - -ecx - - 'exec /cockroach/cockroach.sh start --join=test-cluster-0.test-cluster.test-ns:26258 + - 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns --insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks: {stderr: {channels: - [OPS, HEALTH], redact: true}}}" --cache=30% --max-sql-memory=2GB --temp-dir=/tmp' + [OPS, HEALTH], redact: true}}}" --cache=30% --max-sql-memory=2GB --temp-dir=/tmp + --join=test-cluster-0.test-cluster.test-ns:26258' env: - name: COCKROACH_CHANNEL value: kubernetes-operator-gke diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join.golden b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join.golden new file mode 100755 index 000000000..6fb429e3d --- /dev/null +++ b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join.golden @@ -0,0 +1,132 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + annotations: + crdb.io/containerimage: "" + crdb.io/version: "" + key: "test-value" + creationTimestamp: null + name: test-cluster +spec: + podManagementPolicy: Parallel + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/component: database + app.kubernetes.io/instance: test-cluster + app.kubernetes.io/name: cockroachdb + serviceName: test-cluster + template: + metadata: + creationTimestamp: null + labels: + app.kubernetes.io/component: database + app.kubernetes.io/instance: test-cluster + app.kubernetes.io/name: cockroachdb + annotations: + key: "test-value" + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/instance + operator: In + values: + - test-cluster + topologyKey: kubernetes.io/hostname + weight: 100 + tolerations: + - key: "key" + operator: "Exists" + effect: "NoSchedule" + automountServiceAccountToken: false + containers: + - command: + - /bin/bash + - -ecx + - 'exec /cockroach/cockroach.sh start + --advertise-host=$(POD_NAME).test-cluster.test-ns --insecure --http-port=8080 + --sql-addr=:26257 --listen-addr=:26258 --log="{sinks: {stderr: {channels: + [OPS, HEALTH], redact: true}}}" --cache=30% --max-sql-memory=2GB + --join=test-cluster-1.new-test-cluster.new-test-ns:26258' + env: + - name: COCKROACH_CHANNEL + value: kubernetes-operator-gke + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: GOMAXPROCS + valueFrom: + resourceFieldRef: + divisor: "1" + resource: limits.cpu + - name: MEMORY_LIMIT_MIB + valueFrom: + resourceFieldRef: + divisor: 1Mi + resource: limits.memory + image: cockroachdb/cockroach:v21.1.0 + imagePullPolicy: IfNotPresent + lifecycle: + preStop: + exec: + command: + - sh + - -c + - /cockroach/cockroach node drain --insecure || exit 0 + name: db + ports: + - containerPort: 26258 + name: grpc + protocol: TCP + - containerPort: 8080 + name: http + protocol: TCP + - containerPort: 26257 + name: sql + protocol: TCP + readinessProbe: + failureThreshold: 2 + httpGet: + path: /health?ready=1 + port: http + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 5 + resources: {} + volumeMounts: + - mountPath: /cockroach/cockroach-data/ + name: datadir + securityContext: + fsGroup: 1000581000 + runAsUser: 1000581000 + serviceAccountName: test-cluster-sa + terminationGracePeriodSeconds: 300 + volumes: + - name: datadir + persistentVolumeClaim: + claimName: "" + updateStrategy: + rollingUpdate: {} + volumeClaimTemplates: + - metadata: + creationTimestamp: null + name: datadir + labels: + app.kubernetes.io/component: database + app.kubernetes.io/instance: test-cluster + app.kubernetes.io/name: cockroachdb + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + volumeMode: Filesystem + status: {} +status: + replicas: 0 diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join_in.yaml b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join_in.yaml new file mode 100644 index 000000000..b17dce8fd --- /dev/null +++ b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join_in.yaml @@ -0,0 +1,61 @@ +# Copyright 2022 The Cockroach Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: crdb.cockroachlabs.com/v1alpha1 +kind: CrdbCluster +metadata: + creationTimestamp: null + name: test-cluster + namespace: test-ns +spec: + dataStore: + pvc: + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: "1Gi" + volumeMode: Filesystem + grpcPort: 26258 + httpPort: 8080 + image: + name: cockroachdb/cockroach:v21.1.0 + cache: 30% + maxSQLMemory: 2GB + additionalArgs: + - --join=test-cluster-1.new-test-cluster.new-test-ns:26258 + nodes: 1 + topology: + zones: + - locality: "" + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/instance + operator: In + values: + - test-cluster + topologyKey: kubernetes.io/hostname + tolerations: + - key: "key" + operator: "Exists" + effect: "NoSchedule" + additionalAnnotations: + key: "test-value" +status: {} diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_with_resources.golden b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_with_resources.golden index 3577ee9d1..fe0d76eb9 100755 --- a/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_with_resources.golden +++ b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_with_resources.golden @@ -28,10 +28,11 @@ spec: - command: - /bin/bash - -ecx - - exec /cockroach/cockroach.sh start --join=test-cluster-0.test-cluster.test-ns:26258 + - exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns --insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --logtostderr=INFO --cache $(expr $MEMORY_LIMIT_MIB / 4)MiB --max-sql-memory $(expr $MEMORY_LIMIT_MIB / 4)MiB + --join=test-cluster-0.test-cluster.test-ns:26258 env: - name: COCKROACH_CHANNEL value: kubernetes-operator-gke From d84779cf14612576703e2cea4c9bff153570e8b3 Mon Sep 17 00:00:00 2001 From: noguchitoshi Date: Thu, 26 May 2022 17:33:24 -0400 Subject: [PATCH 02/51] Bump version to 2.7.0 (#908) --- CHANGELOG.md | 5 ++++- config/manager/patches/image.yaml | 2 +- install/operator.yaml | 2 +- version.txt | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba235a6b5..6048e7c86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -# [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.6.0...master) +# [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.7.0...master) + +# [v2.7.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.6.0...v2.7.0) ## Fixed * Grant operator deletecollection permissions to fix fullcluster restart flow * Grant operator list and update permissions on pvcs to fix pvc resize flow * Bump TerminationGracePeriodSeconds from 1m to 5m +* Prefer user added --join flags over default when explicitly passed # [v2.6.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.5.3...v2.6.0) diff --git a/config/manager/patches/image.yaml b/config/manager/patches/image.yaml index b0b876cfb..8792c96b4 100644 --- a/config/manager/patches/image.yaml +++ b/config/manager/patches/image.yaml @@ -24,7 +24,7 @@ spec: spec: containers: - name: cockroach-operator - image: cockroachdb/cockroach-operator:v2.6.0 + image: cockroachdb/cockroach-operator:v2.7.0 env: - name: RELATED_IMAGE_COCKROACH_v20_1_4 value: cockroachdb/cockroach:v20.1.4 diff --git a/install/operator.yaml b/install/operator.yaml index 3439ae44b..2f49533bc 100644 --- a/install/operator.yaml +++ b/install/operator.yaml @@ -512,7 +512,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: cockroachdb/cockroach-operator:v2.6.0 + image: cockroachdb/cockroach-operator:v2.7.0 imagePullPolicy: IfNotPresent name: cockroach-operator resources: diff --git a/version.txt b/version.txt index 914ec9671..9aa34646d 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.6.0 \ No newline at end of file +2.7.0 \ No newline at end of file From cfac700935eff1840be587dcf878a6da9dcd9bcc Mon Sep 17 00:00:00 2001 From: Vaibhav Bhembre Date: Tue, 31 May 2022 17:12:46 -0400 Subject: [PATCH 03/51] resource/cluster: prefer custom node-tls or client-tls secrets (#909) --- pkg/resource/BUILD.bazel | 1 + pkg/resource/cluster.go | 8 ++++ pkg/resource/cluster_test.go | 87 ++++++++++++++++++++++++++++++++++++ pkg/testutil/builder.go | 5 +++ 4 files changed, 101 insertions(+) create mode 100644 pkg/resource/cluster_test.go diff --git a/pkg/resource/BUILD.bazel b/pkg/resource/BUILD.bazel index 0c10a1fc4..f9d459125 100644 --- a/pkg/resource/BUILD.bazel +++ b/pkg/resource/BUILD.bazel @@ -57,6 +57,7 @@ go_library( go_test( name = "go_default_test", srcs = [ + "cluster_test.go", "certificate_test.go", "discovery_service_test.go", "pod_distruption_budget_test.go", diff --git a/pkg/resource/cluster.go b/pkg/resource/cluster.go index e5de06a08..bdf900925 100644 --- a/pkg/resource/cluster.go +++ b/pkg/resource/cluster.go @@ -289,10 +289,18 @@ func (cluster Cluster) GetImagePullSecret() *string { } func (cluster Cluster) NodeTLSSecretName() string { + if cluster.Spec().NodeTLSSecret != "" { + return cluster.Spec().NodeTLSSecret + } + return fmt.Sprintf("%s-node", cluster.Name()) } func (cluster Cluster) ClientTLSSecretName() string { + if cluster.Spec().ClientTLSSecret != "" { + return cluster.Spec().ClientTLSSecret + } + return fmt.Sprintf("%s-root", cluster.Name()) } func (cluster Cluster) CASecretName() string { diff --git a/pkg/resource/cluster_test.go b/pkg/resource/cluster_test.go new file mode 100644 index 000000000..8c7f9b4bb --- /dev/null +++ b/pkg/resource/cluster_test.go @@ -0,0 +1,87 @@ +/* +Copyright 2022 The Cockroach Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package resource_test + +import ( + "testing" + + "fmt" + + "github.com/cockroachdb/cockroach-operator/pkg/resource" + "github.com/cockroachdb/cockroach-operator/pkg/testutil" + "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/assert" +) + +func TestClusterTLSSecrets(t *testing.T) { + var ( + testCluster = "test-cluster" + testNS = "test-ns" + + customNodeTLS = "custom-node-tls" + customClientTLS = "custom-client-tls" + ) + + clusterBuilder := testutil.NewBuilder(testCluster).Namespaced(testNS) + + for _, tt := range []struct { + name string + cluster *resource.Cluster + nodeTLSSecretName string + clientTLSSecretName string + }{ + { + name: "verify default node tls cert", + cluster: clusterBuilder.Cluster(), + nodeTLSSecretName: "test-cluster-node", + }, + { + name: "verify default client tls cert", + cluster: clusterBuilder.Cluster(), + clientTLSSecretName: "test-cluster-root", + }, + { + name: "verify custom node tls cert", + cluster: clusterBuilder.WithNodeTLS(customNodeTLS).Cluster(), + nodeTLSSecretName: customNodeTLS, + }, + { + name: "verify custom client tls cert", + cluster: clusterBuilder.WithClientTLS(customClientTLS).Cluster(), + clientTLSSecretName: customClientTLS, + }, + } { + t.Run(tt.name, func(t *testing.T) { + var expected, actual string + + if tt.nodeTLSSecretName != "" { + expected = tt.nodeTLSSecretName + actual = tt.cluster.NodeTLSSecretName() + + } + + if tt.clientTLSSecretName != "" { + expected = tt.clientTLSSecretName + actual = tt.cluster.ClientTLSSecretName() + } + + diff := cmp.Diff(expected, actual, testutil.RuntimeObjCmpOpts...) + if diff != "" { + assert.Fail(t, fmt.Sprintf("unexpected result (-want +got):\n%v", diff)) + } + }) + } +} diff --git a/pkg/testutil/builder.go b/pkg/testutil/builder.go index f64b42e22..12bb9db04 100644 --- a/pkg/testutil/builder.go +++ b/pkg/testutil/builder.go @@ -92,6 +92,11 @@ func (b ClusterBuilder) WithTLS() ClusterBuilder { return b } +func (b ClusterBuilder) WithClientTLS(secret string) ClusterBuilder { + b.cluster.Spec.ClientTLSSecret = secret + return b +} + func (b ClusterBuilder) WithNodeTLS(secret string) ClusterBuilder { b.cluster.Spec.NodeTLSSecret = secret return b From 10b3b21047e119e7ec00dafc982d5c8915da0b72 Mon Sep 17 00:00:00 2001 From: maomao <77312370+sukki37@users.noreply.github.com> Date: Thu, 2 Jun 2022 23:27:35 +0800 Subject: [PATCH 04/51] Update healthchecker.go (#910) typo Co-authored-by: David Ding --- pkg/healthchecker/healthchecker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/healthchecker/healthchecker.go b/pkg/healthchecker/healthchecker.go index ae1588c69..fedf59092 100644 --- a/pkg/healthchecker/healthchecker.go +++ b/pkg/healthchecker/healthchecker.go @@ -64,7 +64,7 @@ func NewHealthChecker(cluster *resource.Cluster, clientset kubernetes.Interface, } } -// Probe will check the ranges_underreplicated metric for value 0 on all pods after the resart of a +// Probe will check the ranges_underreplicated metric for value 0 on all pods after the restart of a // pod, before continue the rolling update of the next pod func (hc *HealthCheckerImpl) Probe(ctx context.Context, l logr.Logger, logSuffix string, nodeID int) error { l.V(int(zapcore.DebugLevel)).Info("Health check probe", "label", logSuffix, "nodeID", nodeID) From 561cf47d783c368fd8795acb82a5a39099a35984 Mon Sep 17 00:00:00 2001 From: David Ding Date: Thu, 2 Jun 2022 12:39:03 -0400 Subject: [PATCH 05/51] Fix cluster status update logic (#911) Previously, several actors would cancel their context when successful. This was a relic of the way the reconciliation loop was previously structured, but now leads to a bug where cluster status is not updated upon successful action. To address this, this patch deletes the CancelLoop function entirely. --- CHANGELOG.md | 4 ++ pkg/actor/BUILD.bazel | 1 - pkg/actor/cluster_restart.go | 1 - pkg/actor/context.go | 47 ----------------------- pkg/actor/decommission.go | 3 +- pkg/actor/deploy.go | 1 - pkg/actor/deploy_test.go | 2 +- pkg/actor/partitioned_update.go | 3 +- pkg/actor/resize_pvc.go | 4 +- pkg/actor/validate_version.go | 2 - pkg/controller/BUILD.bazel | 1 - pkg/controller/cluster_controller.go | 19 +-------- pkg/controller/cluster_controller_test.go | 15 +------- 13 files changed, 10 insertions(+), 93 deletions(-) delete mode 100644 pkg/actor/context.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 6048e7c86..dbce127a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). # [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.7.0...master) +## Fixed + +* Delete the CancelLoop function, fixing a cluster status update bug + # [v2.7.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.6.0...v2.7.0) ## Fixed diff --git a/pkg/actor/BUILD.bazel b/pkg/actor/BUILD.bazel index 5d4cd69c1..fe6c31f47 100644 --- a/pkg/actor/BUILD.bazel +++ b/pkg/actor/BUILD.bazel @@ -5,7 +5,6 @@ go_library( srcs = [ "actor.go", "cluster_restart.go", - "context.go", "decommission.go", "deploy.go", "director.go", diff --git a/pkg/actor/cluster_restart.go b/pkg/actor/cluster_restart.go index 63309ebbd..5227438a5 100644 --- a/pkg/actor/cluster_restart.go +++ b/pkg/actor/cluster_restart.go @@ -125,7 +125,6 @@ func (r *clusterRestart) Act(ctx context.Context, cluster *resource.Cluster, log log.Error(err, "failed reseting the restart cluster field") } log.V(DEBUGLEVEL).Info("completed cluster restart") - CancelLoop(ctx, log) return nil } diff --git a/pkg/actor/context.go b/pkg/actor/context.go deleted file mode 100644 index b4d9a67ef..000000000 --- a/pkg/actor/context.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright 2022 The Cockroach Authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package actor - -import ( - "context" - "errors" - "github.com/go-logr/logr" -) - -type cancelFuncKey struct{} - -//ContextWithCancelFn func -func ContextWithCancelFn(ctx context.Context, fn context.CancelFunc) context.Context { - return context.WithValue(ctx, cancelFuncKey{}, fn) -} - -func getCancelFn(ctx context.Context, logger logr.Logger) context.CancelFunc { - f, ok := ctx.Value(cancelFuncKey{}).(context.CancelFunc) - - if f == nil || !ok { - return func() { - logger.Error(errors.New("missing parent cancel function in context"), "") - } - } - - return f -} - -//CancelLoop func -func CancelLoop(ctx context.Context, logger logr.Logger) { - getCancelFn(ctx, logger)() -} diff --git a/pkg/actor/decommission.go b/pkg/actor/decommission.go index b68cffcd5..6b5cfe825 100644 --- a/pkg/actor/decommission.go +++ b/pkg/actor/decommission.go @@ -19,6 +19,7 @@ package actor import ( "context" "fmt" + api "github.com/cockroachdb/cockroach-operator/apis/v1alpha1" "github.com/cockroachdb/cockroach-operator/pkg/clustersql" "github.com/cockroachdb/cockroach-operator/pkg/database" @@ -143,12 +144,10 @@ func (d decommission) Act(ctx context.Context, cluster *resource.Cluster, log lo /// now check if the decommissionStaleErr and update status log.Error(err, "decommission failed") cluster.SetFalse(api.DecommissionCondition) - CancelLoop(ctx, log) return err } // TO DO @alina we will need to save the status foreach action cluster.SetTrue(api.DecommissionCondition) log.V(DEBUGLEVEL).Info("decommission completed", "cond", ss.Status.Conditions) - CancelLoop(ctx, log) return nil } diff --git a/pkg/actor/deploy.go b/pkg/actor/deploy.go index dde7fcf36..69cc42983 100644 --- a/pkg/actor/deploy.go +++ b/pkg/actor/deploy.go @@ -81,7 +81,6 @@ func (d deploy) Act(ctx context.Context, cluster *resource.Cluster, log logr.Log if changed { log.Info("created/updated a resource, stopping request processing", "resource", b.ResourceName()) - CancelLoop(ctx, log) return nil } } diff --git a/pkg/actor/deploy_test.go b/pkg/actor/deploy_test.go index f190b6262..8ed8df167 100644 --- a/pkg/actor/deploy_test.go +++ b/pkg/actor/deploy_test.go @@ -81,7 +81,7 @@ func TestDeploysNotInitalizedClusterAfterVersionChecker(t *testing.T) { // 3 is the number of resources we expect to be created. The action should be repeated as it is // restarted on successful creation or update for i := 0; i < 3; i++ { - assert.NoError(t, deploy.Act(actor.ContextWithCancelFn(context.TODO(), func() {}), cluster, testLog)) + assert.NoError(t, deploy.Act(context.Background(), cluster, testLog)) } assert.Equal(t, expected, actual) diff --git a/pkg/actor/partitioned_update.go b/pkg/actor/partitioned_update.go index ebd818c15..b01ab75fb 100644 --- a/pkg/actor/partitioned_update.go +++ b/pkg/actor/partitioned_update.go @@ -19,7 +19,6 @@ package actor import ( "context" "fmt" - "github.com/go-logr/logr" "os" "strings" "time" @@ -31,6 +30,7 @@ import ( "github.com/cockroachdb/cockroach-operator/pkg/resource" "github.com/cockroachdb/cockroach-operator/pkg/update" "github.com/cockroachdb/errors" + "github.com/go-logr/logr" "go.uber.org/zap/zapcore" appsv1 "k8s.io/api/apps/v1" kubetypes "k8s.io/apimachinery/pkg/types" @@ -213,7 +213,6 @@ func (up *partitionedUpdate) Act(ctx context.Context, cluster *resource.Cluster, // TODO set status that we are completed. log.V(DEBUGLEVEL).Info("update completed with partitioned update", "new version", versionWantedCalFmtStr) - CancelLoop(ctx, log) return nil } diff --git a/pkg/actor/resize_pvc.go b/pkg/actor/resize_pvc.go index 308889a10..91c3bda39 100644 --- a/pkg/actor/resize_pvc.go +++ b/pkg/actor/resize_pvc.go @@ -19,7 +19,6 @@ package actor import ( "context" "fmt" - "github.com/go-logr/logr" "time" "github.com/cenkalti/backoff" @@ -27,6 +26,7 @@ import ( "github.com/cockroachdb/cockroach-operator/pkg/kube" "github.com/cockroachdb/cockroach-operator/pkg/resource" "github.com/cockroachdb/errors" + "github.com/go-logr/logr" appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -140,8 +140,6 @@ func (rp *resizePVC) Act(ctx context.Context, cluster *resource.Cluster, log log }*/ log.Info("PVC resize completed") - CancelLoop(ctx, log) - return nil } diff --git a/pkg/actor/validate_version.go b/pkg/actor/validate_version.go index ced485a40..4656958d5 100644 --- a/pkg/actor/validate_version.go +++ b/pkg/actor/validate_version.go @@ -136,7 +136,6 @@ func (v *versionChecker) Act(ctx context.Context, cluster *resource.Cluster, log if changed { log.V(int(zapcore.DebugLevel)).Info("created/updated job, stopping request processing") - CancelLoop(ctx, log) return nil } @@ -349,7 +348,6 @@ func (v *versionChecker) completeVersionChecker( } log.V(int(zapcore.DebugLevel)).Info("completed version checker", "calVersion", version, "containerImage", imageName) - CancelLoop(ctx, log) return nil } diff --git a/pkg/controller/BUILD.bazel b/pkg/controller/BUILD.bazel index 44776718e..bd267c968 100644 --- a/pkg/controller/BUILD.bazel +++ b/pkg/controller/BUILD.bazel @@ -49,7 +49,6 @@ go_test( "@io_k8s_apimachinery//pkg/types:go_default_library", "@io_k8s_sigs_controller_runtime//:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/client/fake:go_default_library", - "@io_k8s_sigs_controller_runtime//pkg/log:go_default_library", "@org_uber_go_zap//zaptest:go_default_library", ], ) diff --git a/pkg/controller/cluster_controller.go b/pkg/controller/cluster_controller.go index 08a60f9fa..029642847 100644 --- a/pkg/controller/cluster_controller.go +++ b/pkg/controller/cluster_controller.go @@ -147,8 +147,7 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req reconcile.Request return noRequeue() } - // Save context cancellation function for actors to call if needed - ctx = actor.ContextWithCancelFn(ctx, cancel) + ctx = context.Background() log.Info(fmt.Sprintf("Running action with name: %s", actorToExecute.GetActionType())) if err := actorToExecute.Act(ctx, &cluster, log); err != nil { @@ -187,13 +186,6 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req reconcile.Request cluster.SetActionFinished(actorToExecute.GetActionType()) } - // Stop processing and wait for Kubernetes scheduler to call us again as the actor - // modified actorToExecute resource owned by the controller - if cancelled(ctx) { - log.V(int(zapcore.InfoLevel)).Info("request was interrupted") - return noRequeue() - } - // Check if the resource has been updated while the controller worked on it fresh, err := cluster.IsFresh(fetcher) if err != nil { @@ -254,12 +246,3 @@ func InitClusterReconcilerWithLogger(l logr.Logger) func(ctrl.Manager) error { }).SetupWithManager(mgr) } } - -func cancelled(ctx context.Context) bool { - select { - case <-ctx.Done(): - return true - default: - return false - } -} diff --git a/pkg/controller/cluster_controller_test.go b/pkg/controller/cluster_controller_test.go index c5113eb24..f31164685 100644 --- a/pkg/controller/cluster_controller_test.go +++ b/pkg/controller/cluster_controller_test.go @@ -23,7 +23,6 @@ import ( "time" "github.com/go-logr/logr" - "sigs.k8s.io/controller-runtime/pkg/log" api "github.com/cockroachdb/cockroach-operator/apis/v1alpha1" "github.com/cockroachdb/cockroach-operator/pkg/actor" @@ -43,14 +42,10 @@ import ( ) type fakeActor struct { - cancelCtx bool - err error + err error } func (a *fakeActor) Act(ctx context.Context, _ *resource.Cluster, logger logr.Logger) error { - if a.cancelCtx { - actor.CancelLoop(ctx, log.NullLogger{}) - } return a.err } func (a *fakeActor) GetActionType() api.ActionType { @@ -115,14 +110,6 @@ func TestReconcile(t *testing.T) { want: ctrl.Result{Requeue: true}, wantErr: "", }, - { - name: "reconcile action cancels the context", - action: fakeActor{ - cancelCtx: true, - }, - want: ctrl.Result{Requeue: false}, - wantErr: "", - }, { name: "reconcile action fails to probe expected condition", action: fakeActor{ From c6172d4787813467236181393b9d5a21ecd98e33 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 7 Jun 2022 10:29:55 -0400 Subject: [PATCH 06/51] Update CRDB versions (#912) Co-authored-by: GitHub Actions --- config/manager/patches/image.yaml | 4 ++++ .../bases/cockroach-operator.clusterserviceversion.yaml | 4 ++++ config/manifests/patches/deployment_patch.yaml | 4 ++++ config/samples/crdb-tls-example.yaml | 2 +- crdb-versions.yaml | 6 ++++++ examples/client-secure-operator.yaml | 2 +- examples/example.yaml | 4 ++-- examples/smoketest.yaml | 2 +- install/operator.yaml | 4 ++++ 9 files changed, 27 insertions(+), 5 deletions(-) diff --git a/config/manager/patches/image.yaml b/config/manager/patches/image.yaml index 8792c96b4..99a746b01 100644 --- a/config/manager/patches/image.yaml +++ b/config/manager/patches/image.yaml @@ -142,5 +142,9 @@ spec: value: cockroachdb/cockroach:v21.2.10 - name: RELATED_IMAGE_COCKROACH_v21_2_11 value: cockroachdb/cockroach:v21.2.11 + - name: RELATED_IMAGE_COCKROACH_v21_2_12 + value: cockroachdb/cockroach:v21.2.12 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: cockroachdb/cockroach:v22.1.0 + - name: RELATED_IMAGE_COCKROACH_v22_1_1 + value: cockroachdb/cockroach:v22.1.1 diff --git a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml index bc924f829..5f932d754 100644 --- a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml @@ -298,5 +298,9 @@ spec: image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:7daaf1368ab2c25694cdea0a598e1de59247b04a4b4b4b8348ed6edbaa194f9d - name: RELATED_IMAGE_COCKROACH_v21_2_11 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:2b5c028f293c6f394e58a5495cb3dbfbedc215d0d03778d0217e045586d55a46 + - name: RELATED_IMAGE_COCKROACH_v21_2_12 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:ce3d94a3fbdcde5858beb3c265987759971d991c397c6486e19904bd4706f44d - name: RELATED_IMAGE_COCKROACH_v22_1_0 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 + - name: RELATED_IMAGE_COCKROACH_v22_1_1 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e23af8f9d32c3f80a52d79ceb4b359dda1d75ba0dd4cb8ed4b66ac2f4e40c69b diff --git a/config/manifests/patches/deployment_patch.yaml b/config/manifests/patches/deployment_patch.yaml index 2a41f3dd0..86403626f 100644 --- a/config/manifests/patches/deployment_patch.yaml +++ b/config/manifests/patches/deployment_patch.yaml @@ -151,6 +151,10 @@ spec: value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:7daaf1368ab2c25694cdea0a598e1de59247b04a4b4b4b8348ed6edbaa194f9d - name: RELATED_IMAGE_COCKROACH_v21_2_11 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:2b5c028f293c6f394e58a5495cb3dbfbedc215d0d03778d0217e045586d55a46 + - name: RELATED_IMAGE_COCKROACH_v21_2_12 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:ce3d94a3fbdcde5858beb3c265987759971d991c397c6486e19904bd4706f44d - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 + - name: RELATED_IMAGE_COCKROACH_v22_1_1 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e23af8f9d32c3f80a52d79ceb4b359dda1d75ba0dd4cb8ed4b66ac2f4e40c69b image: RH_COCKROACH_OP_IMAGE_PLACEHOLDER diff --git a/config/samples/crdb-tls-example.yaml b/config/samples/crdb-tls-example.yaml index c82394190..4de87e05b 100644 --- a/config/samples/crdb-tls-example.yaml +++ b/config/samples/crdb-tls-example.yaml @@ -19,7 +19,7 @@ kind: CrdbCluster metadata: name: crdb-tls-example spec: - cockroachDBVersion: v22.1.0 + cockroachDBVersion: v22.1.1 dataStore: pvc: spec: diff --git a/crdb-versions.yaml b/crdb-versions.yaml index d2d2ad84d..5d66b5c9a 100644 --- a/crdb-versions.yaml +++ b/crdb-versions.yaml @@ -196,6 +196,12 @@ CrdbVersions: - image: cockroachdb/cockroach:v21.2.11 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:2b5c028f293c6f394e58a5495cb3dbfbedc215d0d03778d0217e045586d55a46 tag: v21.2.11 +- image: cockroachdb/cockroach:v21.2.12 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:ce3d94a3fbdcde5858beb3c265987759971d991c397c6486e19904bd4706f44d + tag: v21.2.12 - image: cockroachdb/cockroach:v22.1.0 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 tag: v22.1.0 +- image: cockroachdb/cockroach:v22.1.1 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e23af8f9d32c3f80a52d79ceb4b359dda1d75ba0dd4cb8ed4b66ac2f4e40c69b + tag: v22.1.1 diff --git a/examples/client-secure-operator.yaml b/examples/client-secure-operator.yaml index cbddc4eba..2d856a9b8 100644 --- a/examples/client-secure-operator.yaml +++ b/examples/client-secure-operator.yaml @@ -23,7 +23,7 @@ spec: serviceAccountName: cockroachdb-sa containers: - name: cockroachdb-client-secure - image: cockroachdb/cockroach:v22.1.0 + image: cockroachdb/cockroach:v22.1.1 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/examples/example.yaml b/examples/example.yaml index c6785f302..a5295d40b 100644 --- a/examples/example.yaml +++ b/examples/example.yaml @@ -40,9 +40,9 @@ spec: memory: 8Gi tlsEnabled: true # You can set either a version of the db or a specific image name -# cockroachDBVersion: v22.1.0 +# cockroachDBVersion: v22.1.1 image: - name: cockroachdb/cockroach:v22.1.0 + name: cockroachdb/cockroach:v22.1.1 # nodes refers to the number of crdb pods that are created # via the statefulset nodes: 3 diff --git a/examples/smoketest.yaml b/examples/smoketest.yaml index 9d8c1f5cb..588ad1a5f 100644 --- a/examples/smoketest.yaml +++ b/examples/smoketest.yaml @@ -39,5 +39,5 @@ spec: memory: 300Mi tlsEnabled: true image: - name: cockroachdb/cockroach:v22.1.0 + name: cockroachdb/cockroach:v22.1.1 nodes: 3 diff --git a/install/operator.yaml b/install/operator.yaml index 2f49533bc..55db08651 100644 --- a/install/operator.yaml +++ b/install/operator.yaml @@ -500,8 +500,12 @@ spec: value: cockroachdb/cockroach:v21.2.10 - name: RELATED_IMAGE_COCKROACH_v21_2_11 value: cockroachdb/cockroach:v21.2.11 + - name: RELATED_IMAGE_COCKROACH_v21_2_12 + value: cockroachdb/cockroach:v21.2.12 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: cockroachdb/cockroach:v22.1.0 + - name: RELATED_IMAGE_COCKROACH_v22_1_1 + value: cockroachdb/cockroach:v22.1.1 - name: OPERATOR_NAME value: cockroachdb - name: POD_NAME From dbefb9b08629a9dfc5f80d6e64d77c1f36b623e0 Mon Sep 17 00:00:00 2001 From: Chris Seto Date: Mon, 13 Jun 2022 09:44:48 -0400 Subject: [PATCH 07/51] actor: correctly detect failed version checker Pods (#913) Previously, the version checker action could silently fail by if given a non-cockroach container. It would incorrectly set the cluster version to the error output of the container resulting in error such as: > failed to reconcile crdb: Service \"crdb\" is invalid: > [metadata.labels: Invalid value: \"/bin/bash: line 1: > /cockroach/cockroach.sh: No such file or directory\" This commit ensures that we the Pod that logs get pulled from has exited with a zero code before attempting to parse the version. --- CHANGELOG.md | 1 + pkg/actor/actor.go | 9 ---- pkg/actor/validate_version.go | 55 +++++++---------------- pkg/controller/BUILD.bazel | 2 + pkg/controller/cluster_controller.go | 15 +++++-- pkg/controller/cluster_controller_test.go | 43 +++++++++++------- pkg/resource/BUILD.bazel | 2 +- pkg/resource/job.go | 4 +- pkg/testutil/require.go | 6 ++- 9 files changed, 64 insertions(+), 73 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbce127a1..f92f9e0c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Fixed * Delete the CancelLoop function, fixing a cluster status update bug +* Correctly detect failed version checker Pods # [v2.7.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.6.0...v2.7.0) diff --git a/pkg/actor/actor.go b/pkg/actor/actor.go index e64b12580..0f4c54209 100644 --- a/pkg/actor/actor.go +++ b/pkg/actor/actor.go @@ -52,15 +52,6 @@ func (e PermanentErr) Error() string { return e.Err.Error() } -//InvalidContainerVersionError error used to stop requeue the request on failure -type InvalidContainerVersionError struct { - Err error -} - -func (e InvalidContainerVersionError) Error() string { - return e.Err.Error() -} - //ValidationError error used to stop requeue the request on failure type ValidationError struct { Err error diff --git a/pkg/actor/validate_version.go b/pkg/actor/validate_version.go index 4656958d5..b42e16626 100644 --- a/pkg/actor/validate_version.go +++ b/pkg/actor/validate_version.go @@ -136,7 +136,9 @@ func (v *versionChecker) Act(ctx context.Context, cluster *resource.Cluster, log if changed { log.V(int(zapcore.DebugLevel)).Info("created/updated job, stopping request processing") - return nil + // Return a non error error here to prevent the controller from + // clearing any previously set Status fields. + return NotReadyErr{errors.New("job changed")} } log.V(int(zapcore.DebugLevel)).Info("version checker", "job", jobName) @@ -144,47 +146,21 @@ func (v *versionChecker) Act(ctx context.Context, cluster *resource.Cluster, log Namespace: cluster.Namespace(), Name: jobName, } - job := &kbatch.Job{} + job := &kbatch.Job{} if err := v.client.Get(ctx, key, job); err != nil { - err := WaitUntilJobPodIsRunning(ctx, v.clientset, job, log) - if err != nil { - log.Error(err, "job pod is not running; deleting job") - if dErr := deleteJob(ctx, cluster, v.clientset, job); dErr != nil { - // Log the job deletion error, but return the underlying error that prompted deletion. - log.Error(dErr, "failed to delete the job") - } - return err - } - } - - // We have hit an edge case were sometimes the job selector is nil, the following block is extra code - // that tries to list the jobs and then get the job again, which probably will reconcile - // the API. We also removed setting the job selector as well. - if job.Spec.Selector == nil { - log.V(int(zapcore.DebugLevel)).Info("Job or Job Selector returned as nil, attempting to get it again.") - - // The job is nil or the selector is nil, we are doing a list, which - // should reconcile the API and we we do another get the job should have - // the selector. - jobs, err := v.clientset.BatchV1().Jobs(job.Namespace).List(ctx, metav1.ListOptions{}) - if err != nil { - log.Error(err, "unable to list jobs") - return err - } - - if jobs == nil || len(jobs.Items) == 0 { - err := errors.New("unable to find any jobs") - log.Error(err, err.Error()) - return err - } - - if err := v.client.Get(ctx, key, job); err != nil { - log.Error(err, "unable to get job") - return err - } + log.Error(err, "failed getting Job '%s'", jobName) + return err } + // Left over insanity check just in case there's a missed edge case. + // WaitUntilJobPodIsRunning will panic with a nil dereference if passed an + // empty Job. There was previously an incorrect error check which would + // always panic if the above .Get failed leading to some strange flakiness + // in test. An extremely defensive block (See #607) was added as an attempt + // to mitigate this panic (assumedly). It's been removed but this final + // check is leftover just in case this after the fact correction was + // misinformed. if job.Spec.Selector == nil { err := errors.New("job selector is nil") log.Error(err, err.Error()) @@ -198,7 +174,7 @@ func (v *versionChecker) Act(ctx context.Context, cluster *resource.Cluster, log // We need to stop requeueing until further changes on the CR image := cluster.GetCockroachDBImageName() if errBackoff := IsContainerStatusImagePullBackoff(ctx, v.clientset, job, log, image); errBackoff != nil { - err := InvalidContainerVersionError{Err: errBackoff} + err := PermanentErr{Err: errBackoff} return LogError("job image incorrect", err, log) } else if dErr := deleteJob(ctx, cluster, v.clientset, job); dErr != nil { // Log the job deletion error, but return the underlying error that prompted deletion. @@ -232,6 +208,7 @@ func (v *versionChecker) Act(ctx context.Context, cluster *resource.Cluster, log } } } + podName := tmpPod.Name req := v.clientset.CoreV1().Pods(job.Namespace).GetLogs(podName, &podLogOpts) diff --git a/pkg/controller/BUILD.bazel b/pkg/controller/BUILD.bazel index bd267c968..feb933dcc 100644 --- a/pkg/controller/BUILD.bazel +++ b/pkg/controller/BUILD.bazel @@ -13,6 +13,7 @@ go_library( "//pkg/actor:go_default_library", "//pkg/resource:go_default_library", "//pkg/util:go_default_library", + "@com_github_cockroachdb_errors//:go_default_library", "@com_github_go_logr_logr//:go_default_library", "@com_github_lithammer_shortuuid_v3//:go_default_library", "@io_k8s_api//apps/v1:go_default_library", @@ -39,6 +40,7 @@ go_test( "//pkg/actor:go_default_library", "//pkg/resource:go_default_library", "//pkg/testutil:go_default_library", + "@com_github_cockroachdb_errors//:go_default_library", "@com_github_go_logr_logr//:go_default_library", "@com_github_go_logr_zapr//:go_default_library", "@com_github_stretchr_testify//assert:go_default_library", diff --git a/pkg/controller/cluster_controller.go b/pkg/controller/cluster_controller.go index 029642847..7a99463db 100644 --- a/pkg/controller/cluster_controller.go +++ b/pkg/controller/cluster_controller.go @@ -25,6 +25,7 @@ import ( "github.com/cockroachdb/cockroach-operator/pkg/actor" "github.com/cockroachdb/cockroach-operator/pkg/resource" "github.com/cockroachdb/cockroach-operator/pkg/util" + "github.com/cockroachdb/errors" "github.com/go-logr/logr" "github.com/lithammer/shortuuid/v3" "go.uber.org/zap/zapcore" @@ -154,32 +155,38 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req reconcile.Request // Save the error on the Status for each action log.Info("Error on action", "Action", actorToExecute.GetActionType(), "err", err.Error()) cluster.SetActionFailed(actorToExecute.GetActionType(), err.Error()) + defer func(ctx context.Context, cluster *resource.Cluster) { if err := r.Client.Status().Update(ctx, cluster.Unwrap()); err != nil { log.Error(err, "failed to update cluster status") } }(ctx, &cluster) + // Short pause - if notReadyErr, ok := err.(actor.NotReadyErr); ok { + var notReadyErr actor.NotReadyErr + if errors.As(err, ¬ReadyErr) { log.V(int(zapcore.DebugLevel)).Info("requeueing", "reason", notReadyErr.Error(), "Action", actorToExecute.GetActionType()) return requeueAfter(5*time.Second, nil) } // Long pause - if cantRecoverErr, ok := err.(actor.PermanentErr); ok { + var cantRecoverErr actor.PermanentErr + if errors.As(err, &cantRecoverErr) { log.Error(cantRecoverErr, "can't proceed with reconcile", "Action", actorToExecute.GetActionType()) return noRequeue() } // No requeue until the user makes changes - if validationError, ok := err.(actor.ValidationError); ok { - log.Error(validationError, "can't proceed with reconcile") + var validationErr actor.ValidationError + if errors.As(err, &validationErr) { + log.Error(validationErr, "can't proceed with reconcile") return noRequeue() } log.Error(err, "action failed") return requeueIfError(err) } + // reset errors on each run if there was an error, // this is to cover the not ready case if cluster.Failed(actorToExecute.GetActionType()) { diff --git a/pkg/controller/cluster_controller_test.go b/pkg/controller/cluster_controller_test.go index f31164685..4679fda79 100644 --- a/pkg/controller/cluster_controller_test.go +++ b/pkg/controller/cluster_controller_test.go @@ -18,17 +18,16 @@ package controller_test import ( "context" - "errors" "testing" "time" - "github.com/go-logr/logr" - api "github.com/cockroachdb/cockroach-operator/apis/v1alpha1" "github.com/cockroachdb/cockroach-operator/pkg/actor" "github.com/cockroachdb/cockroach-operator/pkg/controller" "github.com/cockroachdb/cockroach-operator/pkg/resource" "github.com/cockroachdb/cockroach-operator/pkg/testutil" + "github.com/cockroachdb/errors" + "github.com/go-logr/logr" "github.com/go-logr/zapr" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -90,26 +89,36 @@ func TestReconcile(t *testing.T) { want ctrl.Result wantErr string }{ - // { - // name: "reconcile action fails", - // action: fakeActor{ - // err: errors.New("failed to reconcile resource"), - // }, - // want: ctrl.Result{Requeue: false}, - // wantErr: "failed to reconcile resource", - // }, - // { - // name: "reconcile action updates owned resource successfully", - // action: fakeActor{}, - // want: ctrl.Result{Requeue: false}, - // wantErr: "", - // }, { name: "on first reconcile we update and requeue", action: fakeActor{}, want: ctrl.Result{Requeue: true}, wantErr: "", }, + { + name: "reconcile action fails genericly", + action: fakeActor{ + err: errors.New("failed to reconcile resource"), + }, + want: ctrl.Result{}, + wantErr: "failed to reconcile resource", + }, + { + name: "reconcile action permanently fails", + action: fakeActor{ + err: errors.Wrap(actor.PermanentErr{Err: errors.New("foo")}, "bar"), + }, + want: ctrl.Result{Requeue: false}, + wantErr: "", + }, + { + name: "reconcile action validation fails", + action: fakeActor{ + err: actor.ValidationError{Err: errors.New("bar")}, + }, + want: ctrl.Result{Requeue: false}, + wantErr: "", + }, { name: "reconcile action fails to probe expected condition", action: fakeActor{ diff --git a/pkg/resource/BUILD.bazel b/pkg/resource/BUILD.bazel index f9d459125..34d3b85e1 100644 --- a/pkg/resource/BUILD.bazel +++ b/pkg/resource/BUILD.bazel @@ -57,8 +57,8 @@ go_library( go_test( name = "go_default_test", srcs = [ - "cluster_test.go", "certificate_test.go", + "cluster_test.go", "discovery_service_test.go", "pod_distruption_budget_test.go", "public_service_test.go", diff --git a/pkg/resource/job.go b/pkg/resource/job.go index b8664762b..1833b6320 100644 --- a/pkg/resource/job.go +++ b/pkg/resource/job.go @@ -63,11 +63,13 @@ func (b JobBuilder) Build(obj client.Object) error { // we recreate spec from ground only if we do not find the container job if dbContainer, err := kube.FindContainer(JobContainerName, &job.Spec.Template.Spec); err != nil { + backoffLimit := int32(2) job.Spec = kbatch.JobSpec{ // This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature. // see https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#job-v1-batch TTLSecondsAfterFinished: ptr.Int32(300), Template: b.buildPodTemplate(), + BackoffLimit: &backoffLimit, } } else { //if job with the container already exists we update the image only @@ -150,7 +152,7 @@ func (b JobBuilder) MakeContainers() []corev1.Container { }, }, Command: []string{"/bin/bash"}, - Args: []string{"-c", fmt.Sprintf("%s; sleep 150", GetTagVersionCommand)}, + Args: []string{"-c", fmt.Sprintf("set -eo pipefail; %s; sleep 150", GetTagVersionCommand)}, }, } } diff --git a/pkg/testutil/require.go b/pkg/testutil/require.go index 924dd3384..6c778c022 100644 --- a/pkg/testutil/require.go +++ b/pkg/testutil/require.go @@ -621,7 +621,9 @@ func RequireClusterInImagePullBackoff(t *testing.T, sb testenv.DiffingSandbox, b "app.kubernetes.io/instance": clusterName, } - wErr := wait.Poll(10*time.Second, 500*time.Second, func() (bool, error) { + // Timeout must be greater than 2 minutes, the max backoff time for the + // version checker job. + wErr := wait.Poll(10*time.Second, 3 * time.Minute, func() (bool, error) { if err := sb.List(jobList, jobLabel); err != nil { return false, err } @@ -658,7 +660,7 @@ func RequireClusterInFailedState(t *testing.T, sb testenv.DiffingSandbox, b Clus }, } - wErr := wait.Poll(10*time.Second, 500*time.Second, func() (bool, error) { + wErr := wait.Poll(10*time.Second, 2 * time.Minute, func() (bool, error) { if err := sb.Get(&crdbCluster); err != nil { return false, err } From dda0a6308b0f1c64d41e0851a5ef8cb60cd98a37 Mon Sep 17 00:00:00 2001 From: Chris Seto Date: Tue, 14 Jun 2022 15:30:11 -0400 Subject: [PATCH 08/51] controller: consolidate status update logic (#915) Previously, Status updates could fail due to version conflicts. This commit pulls all status update logic into a helper function that utilizes retry.RetryOnConflict to ensure that .Status updates get persisted in spite of resource version changes. Additionally, this commit removes an early bailout if the controller detects a divergence in the currently loaded resource and the API version. This change should have no notable affects as it took place after any actors ran. It also fixes a buglet that overwrote the reconcilers context, negating the maximum runtime for a single reconcilation loop. --- CHANGELOG.md | 1 + pkg/controller/BUILD.bazel | 1 + pkg/controller/cluster_controller.go | 37 ++++++++++++---------------- pkg/resource/cluster.go | 9 ------- 4 files changed, 18 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f92f9e0c6..c81c95450 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). * Delete the CancelLoop function, fixing a cluster status update bug * Correctly detect failed version checker Pods +* retry cluster status updates, reducing test flakes # [v2.7.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.6.0...v2.7.0) diff --git a/pkg/controller/BUILD.bazel b/pkg/controller/BUILD.bazel index feb933dcc..e45d26462 100644 --- a/pkg/controller/BUILD.bazel +++ b/pkg/controller/BUILD.bazel @@ -24,6 +24,7 @@ go_library( "@io_k8s_api//policy/v1beta1:go_default_library", "@io_k8s_apimachinery//pkg/runtime:go_default_library", "@io_k8s_client_go//kubernetes:go_default_library", + "@io_k8s_client_go//util/retry:go_default_library", "@io_k8s_sigs_controller_runtime//:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/client:go_default_library", "@io_k8s_sigs_controller_runtime//pkg/reconcile:go_default_library", diff --git a/pkg/controller/cluster_controller.go b/pkg/controller/cluster_controller.go index 7a99463db..0c89df858 100644 --- a/pkg/controller/cluster_controller.go +++ b/pkg/controller/cluster_controller.go @@ -37,6 +37,7 @@ import ( policy "k8s.io/api/policy/v1beta1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes" + "k8s.io/client-go/util/retry" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -121,8 +122,8 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req reconcile.Request // we added a state called Starting for field ClusterStatus to accomplish this if cluster.Status().ClusterStatus == "" { cluster.SetClusterStatusOnFirstReconcile() - if err := r.Client.Status().Update(ctx, cluster.Unwrap()); err != nil { - log.Error(err, "failed to update cluster status on action") + if err := r.updateClusterStatus(ctx, log, &cluster); err != nil { + log.Error(err, "failed to update cluster status") return requeueIfError(err) } return requeueImmediately() @@ -132,8 +133,8 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req reconcile.Request if cluster.True(api.CrdbVersionChecked) { if cluster.GetCockroachDBImageName() != cluster.Status().CrdbContainerImage { cluster.SetFalse(api.CrdbVersionChecked) - if err := r.Client.Status().Update(ctx, cluster.Unwrap()); err != nil { - log.Error(err, "failed to update cluster status on action") + if err := r.updateClusterStatus(ctx, log, &cluster); err != nil { + log.Error(err, "failed to update cluster status") return requeueIfError(err) } return requeueImmediately() @@ -148,8 +149,6 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req reconcile.Request return noRequeue() } - ctx = context.Background() - log.Info(fmt.Sprintf("Running action with name: %s", actorToExecute.GetActionType())) if err := actorToExecute.Act(ctx, &cluster, log); err != nil { // Save the error on the Status for each action @@ -157,7 +156,7 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req reconcile.Request cluster.SetActionFailed(actorToExecute.GetActionType(), err.Error()) defer func(ctx context.Context, cluster *resource.Cluster) { - if err := r.Client.Status().Update(ctx, cluster.Unwrap()); err != nil { + if err := r.updateClusterStatus(ctx, log, cluster); err != nil { log.Error(err, "failed to update cluster status") } }(ctx, &cluster) @@ -193,20 +192,7 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req reconcile.Request cluster.SetActionFinished(actorToExecute.GetActionType()) } - // Check if the resource has been updated while the controller worked on it - fresh, err := cluster.IsFresh(fetcher) - if err != nil { - return requeueIfError(err) - } - - // If the resource was updated, it is needed to start all over again - // to ensure that the latest state was reconciled - if !fresh { - log.V(int(zapcore.DebugLevel)).Info("cluster resources is not up to date") - return requeueImmediately() - } - cluster.SetClusterStatus() - if err := r.Client.Status().Update(ctx, cluster.Unwrap()); err != nil { + if err := r.updateClusterStatus(ctx, log, &cluster); err != nil { log.Error(err, "failed to update cluster status") return requeueIfError(err) } @@ -215,6 +201,15 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req reconcile.Request return noRequeue() } +// updateClusterStatus preprocesses a cluster's Status and then persists it to +// the Kubernetes API. updateClusterStatus will retry on conflict errors. +func (r *ClusterReconciler) updateClusterStatus(ctx context.Context, log logr.Logger, cluster *resource.Cluster) error { + cluster.SetClusterStatus() + return retry.RetryOnConflict(retry.DefaultBackoff, func() error { + return r.Client.Status().Update(ctx, cluster.Unwrap()) + }) +} + // SetupWithManager registers the controller with the controller.Manager from controller-runtime func (r *ClusterReconciler) SetupWithManager(mgr ctrl.Manager) error { var ingress client.Object diff --git a/pkg/resource/cluster.go b/pkg/resource/cluster.go index bdf900925..8a5f6c263 100644 --- a/pkg/resource/cluster.go +++ b/pkg/resource/cluster.go @@ -319,15 +319,6 @@ func (cluster Cluster) SecureMode() string { return "--insecure" } -func (cluster Cluster) IsFresh(fetcher Fetcher) (bool, error) { - actual := ClusterPlaceholder(cluster.Name()) - if err := fetcher.Fetch(actual); err != nil { - return false, errors.Wrapf(err, "failed to fetch cluster resource") - } - - return cluster.cr.ResourceVersion == actual.ResourceVersion, nil -} - func (cluster Cluster) LoggingConfiguration(fetcher Fetcher) (string, error) { if cluster.Spec().LogConfigMap != "" { cm := &corev1.ConfigMap{ From 26cf8effb3e5dce64aae4c443c88799e50f903b5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 08:40:43 -0400 Subject: [PATCH 09/51] Update CRDB versions (#923) * Update CRDB versions Co-authored-by: GitHub Actions --- config/manager/patches/image.yaml | 4 ++++ .../bases/cockroach-operator.clusterserviceversion.yaml | 4 ++++ config/manifests/patches/deployment_patch.yaml | 4 ++++ config/samples/crdb-tls-example.yaml | 2 +- crdb-versions.yaml | 6 ++++++ examples/client-secure-operator.yaml | 2 +- examples/example.yaml | 4 ++-- examples/smoketest.yaml | 2 +- install/operator.yaml | 4 ++++ 9 files changed, 27 insertions(+), 5 deletions(-) diff --git a/config/manager/patches/image.yaml b/config/manager/patches/image.yaml index 99a746b01..5471accfe 100644 --- a/config/manager/patches/image.yaml +++ b/config/manager/patches/image.yaml @@ -144,7 +144,11 @@ spec: value: cockroachdb/cockroach:v21.2.11 - name: RELATED_IMAGE_COCKROACH_v21_2_12 value: cockroachdb/cockroach:v21.2.12 + - name: RELATED_IMAGE_COCKROACH_v21_2_13 + value: cockroachdb/cockroach:v21.2.13 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: cockroachdb/cockroach:v22.1.0 - name: RELATED_IMAGE_COCKROACH_v22_1_1 value: cockroachdb/cockroach:v22.1.1 + - name: RELATED_IMAGE_COCKROACH_v22_1_2 + value: cockroachdb/cockroach:v22.1.2 diff --git a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml index 5f932d754..f12843d17 100644 --- a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml @@ -300,7 +300,11 @@ spec: image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:2b5c028f293c6f394e58a5495cb3dbfbedc215d0d03778d0217e045586d55a46 - name: RELATED_IMAGE_COCKROACH_v21_2_12 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:ce3d94a3fbdcde5858beb3c265987759971d991c397c6486e19904bd4706f44d + - name: RELATED_IMAGE_COCKROACH_v21_2_13 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:9097e135159f46396ef4649f724d61bb5b9113c488f989d404586fbb7486fd85 - name: RELATED_IMAGE_COCKROACH_v22_1_0 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 - name: RELATED_IMAGE_COCKROACH_v22_1_1 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e23af8f9d32c3f80a52d79ceb4b359dda1d75ba0dd4cb8ed4b66ac2f4e40c69b + - name: RELATED_IMAGE_COCKROACH_v22_1_2 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:266165ab87b19a05d6796e8b15ff0eba632d6ac96e6393400464c6136dd500ec diff --git a/config/manifests/patches/deployment_patch.yaml b/config/manifests/patches/deployment_patch.yaml index 86403626f..75a698f61 100644 --- a/config/manifests/patches/deployment_patch.yaml +++ b/config/manifests/patches/deployment_patch.yaml @@ -153,8 +153,12 @@ spec: value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:2b5c028f293c6f394e58a5495cb3dbfbedc215d0d03778d0217e045586d55a46 - name: RELATED_IMAGE_COCKROACH_v21_2_12 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:ce3d94a3fbdcde5858beb3c265987759971d991c397c6486e19904bd4706f44d + - name: RELATED_IMAGE_COCKROACH_v21_2_13 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:9097e135159f46396ef4649f724d61bb5b9113c488f989d404586fbb7486fd85 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 - name: RELATED_IMAGE_COCKROACH_v22_1_1 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e23af8f9d32c3f80a52d79ceb4b359dda1d75ba0dd4cb8ed4b66ac2f4e40c69b + - name: RELATED_IMAGE_COCKROACH_v22_1_2 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:266165ab87b19a05d6796e8b15ff0eba632d6ac96e6393400464c6136dd500ec image: RH_COCKROACH_OP_IMAGE_PLACEHOLDER diff --git a/config/samples/crdb-tls-example.yaml b/config/samples/crdb-tls-example.yaml index 4de87e05b..7c38ee930 100644 --- a/config/samples/crdb-tls-example.yaml +++ b/config/samples/crdb-tls-example.yaml @@ -19,7 +19,7 @@ kind: CrdbCluster metadata: name: crdb-tls-example spec: - cockroachDBVersion: v22.1.1 + cockroachDBVersion: v22.1.2 dataStore: pvc: spec: diff --git a/crdb-versions.yaml b/crdb-versions.yaml index 5d66b5c9a..8fc392e5c 100644 --- a/crdb-versions.yaml +++ b/crdb-versions.yaml @@ -199,9 +199,15 @@ CrdbVersions: - image: cockroachdb/cockroach:v21.2.12 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:ce3d94a3fbdcde5858beb3c265987759971d991c397c6486e19904bd4706f44d tag: v21.2.12 +- image: cockroachdb/cockroach:v21.2.13 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:9097e135159f46396ef4649f724d61bb5b9113c488f989d404586fbb7486fd85 + tag: v21.2.13 - image: cockroachdb/cockroach:v22.1.0 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 tag: v22.1.0 - image: cockroachdb/cockroach:v22.1.1 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e23af8f9d32c3f80a52d79ceb4b359dda1d75ba0dd4cb8ed4b66ac2f4e40c69b tag: v22.1.1 +- image: cockroachdb/cockroach:v22.1.2 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:266165ab87b19a05d6796e8b15ff0eba632d6ac96e6393400464c6136dd500ec + tag: v22.1.2 diff --git a/examples/client-secure-operator.yaml b/examples/client-secure-operator.yaml index 2d856a9b8..c57329f01 100644 --- a/examples/client-secure-operator.yaml +++ b/examples/client-secure-operator.yaml @@ -23,7 +23,7 @@ spec: serviceAccountName: cockroachdb-sa containers: - name: cockroachdb-client-secure - image: cockroachdb/cockroach:v22.1.1 + image: cockroachdb/cockroach:v22.1.2 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/examples/example.yaml b/examples/example.yaml index a5295d40b..7b688bd45 100644 --- a/examples/example.yaml +++ b/examples/example.yaml @@ -40,9 +40,9 @@ spec: memory: 8Gi tlsEnabled: true # You can set either a version of the db or a specific image name -# cockroachDBVersion: v22.1.1 +# cockroachDBVersion: v22.1.2 image: - name: cockroachdb/cockroach:v22.1.1 + name: cockroachdb/cockroach:v22.1.2 # nodes refers to the number of crdb pods that are created # via the statefulset nodes: 3 diff --git a/examples/smoketest.yaml b/examples/smoketest.yaml index 588ad1a5f..56add1c59 100644 --- a/examples/smoketest.yaml +++ b/examples/smoketest.yaml @@ -39,5 +39,5 @@ spec: memory: 300Mi tlsEnabled: true image: - name: cockroachdb/cockroach:v22.1.1 + name: cockroachdb/cockroach:v22.1.2 nodes: 3 diff --git a/install/operator.yaml b/install/operator.yaml index 55db08651..98ff1fc4d 100644 --- a/install/operator.yaml +++ b/install/operator.yaml @@ -502,10 +502,14 @@ spec: value: cockroachdb/cockroach:v21.2.11 - name: RELATED_IMAGE_COCKROACH_v21_2_12 value: cockroachdb/cockroach:v21.2.12 + - name: RELATED_IMAGE_COCKROACH_v21_2_13 + value: cockroachdb/cockroach:v21.2.13 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: cockroachdb/cockroach:v22.1.0 - name: RELATED_IMAGE_COCKROACH_v22_1_1 value: cockroachdb/cockroach:v22.1.1 + - name: RELATED_IMAGE_COCKROACH_v22_1_2 + value: cockroachdb/cockroach:v22.1.2 - name: OPERATOR_NAME value: cockroachdb - name: POD_NAME From fed3f35b5ef156ca14dd1250639b5648b253de9d Mon Sep 17 00:00:00 2001 From: David Muto Date: Mon, 11 Jul 2022 09:58:22 -0400 Subject: [PATCH 10/51] Allow option to automount service account token (#898) In #107 auto-mounting of the default service account token was disabled. Presumably this was because it wasn't necessary in order to run Cockroach. We've had a number of users request the ability to re-enable this as it's the default behaviour in Kubernetes and is often used to grant access to other systems through IAM grants (e.g. backups in S3). This PR adds an `AutomountServiceAccountToken` field to the cluster spec. When set, the service account token will be mounted. By default this value is `false` for backward compatibility reasons. --- CHANGELOG.md | 4 + apis/v1alpha1/cluster_types.go | 6 + .../crdb.cockroachlabs.com_crdbclusters.yaml | 7 + e2e/upgrades/upgrades_test.go | 5 +- install/crds.yaml | 7 + pkg/resource/statefulset.go | 2 +- .../automount_sa.golden | 165 ++++++++++++++++++ .../automount_sa_in.yaml | 43 +++++ .../default_insecure_statefulset.golden | 10 +- .../default_secure.golden | 11 +- .../insecure_statefulset_cli_args.golden | 9 +- ...cure_statefulset_cli_args_with_join.golden | 23 ++- ...insecure_statefulset_with_resources.golden | 9 +- pkg/testutil/builder.go | 5 + 14 files changed, 270 insertions(+), 36 deletions(-) create mode 100644 pkg/resource/testdata/TestStatefulSetBuilder/automount_sa.golden create mode 100644 pkg/resource/testdata/TestStatefulSetBuilder/automount_sa_in.yaml mode change 100755 => 100644 pkg/resource/testdata/TestStatefulSetBuilder/default_insecure_statefulset.golden mode change 100755 => 100644 pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden mode change 100755 => 100644 pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args.golden mode change 100755 => 100644 pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join.golden mode change 100755 => 100644 pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_with_resources.golden diff --git a/CHANGELOG.md b/CHANGELOG.md index c81c95450..5ff3aa2ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). # [v2.7.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.6.0...v2.7.0) +## Added + +* `AutomountServiceAccountToken` field for cluster spec to allow mounting the default service account token. + ## Fixed * Grant operator deletecollection permissions to fix fullcluster restart flow diff --git a/apis/v1alpha1/cluster_types.go b/apis/v1alpha1/cluster_types.go index 7bf292aea..b7d27ae0c 100644 --- a/apis/v1alpha1/cluster_types.go +++ b/apis/v1alpha1/cluster_types.go @@ -139,6 +139,12 @@ type CrdbClusterSpec struct { // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Cockroach Database Logging configuration config map" // +optional LogConfigMap string `json:"logConfigMap,omitempty"` + // (Optional) AutomountServiceAccountToken determines whether or not the stateful set pods should + // automount the service account token. This is the default behavior in Kubernetes. For backward + // compatibility reasons, this value defaults to `false` here. + // Default: false + // +optional + AutomountServiceAccountToken bool `json:"automountServiceAccountToken,omitempty"` } // +k8s:openapi-gen=true diff --git a/config/crd/bases/crdb.cockroachlabs.com_crdbclusters.yaml b/config/crd/bases/crdb.cockroachlabs.com_crdbclusters.yaml index 49c8d2875..457c9e965 100644 --- a/config/crd/bases/crdb.cockroachlabs.com_crdbclusters.yaml +++ b/config/crd/bases/crdb.cockroachlabs.com_crdbclusters.yaml @@ -665,6 +665,13 @@ spec: type: array type: object type: object + automountServiceAccountToken: + description: '(Optional) AutomountServiceAccountToken determines whether + or not the stateful set pods should automount the service account + token. This is the default behavior in Kubernetes. For backward + compatibility reasons, this value defaults to `false` here. Default: + false' + type: boolean cache: description: '(Optional) The total size for caches (`--cache` command line parameter) Default: "25%"' diff --git a/e2e/upgrades/upgrades_test.go b/e2e/upgrades/upgrades_test.go index 147dc521c..b23e54b17 100644 --- a/e2e/upgrades/upgrades_test.go +++ b/e2e/upgrades/upgrades_test.go @@ -204,7 +204,10 @@ func TestUpgradesMinorVersionThenRollback(t *testing.T) { sb := testenv.NewDiffingSandbox(t, env) sb.StartManager(t, controller.InitClusterReconcilerWithLogger(testLog)) - builder := testutil.NewBuilder("crdb").WithNodeCount(3).WithTLS(). + builder := testutil.NewBuilder("crdb"). + WithAutomountServiceAccountToken(true). + WithNodeCount(3). + WithTLS(). WithImage(e2e.MinorVersion1). WithPVDataStore("1Gi") diff --git a/install/crds.yaml b/install/crds.yaml index c2cb70c8f..1b5cd89ae 100644 --- a/install/crds.yaml +++ b/install/crds.yaml @@ -663,6 +663,13 @@ spec: type: array type: object type: object + automountServiceAccountToken: + description: '(Optional) AutomountServiceAccountToken determines whether + or not the stateful set pods should automount the service account + token. This is the default behavior in Kubernetes. For backward + compatibility reasons, this value defaults to `false` here. Default: + false' + type: boolean cache: description: '(Optional) The total size for caches (`--cache` command line parameter) Default: "25%"' diff --git a/pkg/resource/statefulset.go b/pkg/resource/statefulset.go index f75260c69..6f8d780e1 100644 --- a/pkg/resource/statefulset.go +++ b/pkg/resource/statefulset.go @@ -211,7 +211,7 @@ func (b StatefulSetBuilder) makePodTemplate() corev1.PodTemplateSpec { }, TerminationGracePeriodSeconds: ptr.Int64(terminationGracePeriodSecs), Containers: b.MakeContainers(), - AutomountServiceAccountToken: ptr.Bool(false), + AutomountServiceAccountToken: ptr.Bool(b.Spec().AutomountServiceAccountToken), ServiceAccountName: b.ServiceAccountName(), }, } diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/automount_sa.golden b/pkg/resource/testdata/TestStatefulSetBuilder/automount_sa.golden new file mode 100644 index 000000000..8e820c2a6 --- /dev/null +++ b/pkg/resource/testdata/TestStatefulSetBuilder/automount_sa.golden @@ -0,0 +1,165 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + annotations: + crdb.io/containerimage: "" + crdb.io/version: "" + creationTimestamp: null + name: test-cluster +spec: + podManagementPolicy: Parallel + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/component: database + app.kubernetes.io/instance: test-cluster + app.kubernetes.io/name: cockroachdb + car: koenigsegg + serviceName: test-cluster + template: + metadata: + creationTimestamp: null + labels: + app.kubernetes.io/component: database + app.kubernetes.io/instance: test-cluster + app.kubernetes.io/name: cockroachdb + car: koenigsegg + spec: + automountServiceAccountToken: true + containers: + - command: + - /bin/bash + - -ecx + - 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns + --certs-dir=/cockroach/cockroach-certs/ --http-port=8080 --sql-addr=:26257 + --listen-addr=:26258 --log="{sinks: {stderr: {channels: [OPS, HEALTH], redact: + true}}}" --cache $(expr $MEMORY_LIMIT_MIB / 4)MiB --max-sql-memory $(expr + $MEMORY_LIMIT_MIB / 4)MiB --join=test-cluster-0.test-cluster.test-ns:26258' + env: + - name: COCKROACH_CHANNEL + value: kubernetes-operator-gke + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: GOMAXPROCS + valueFrom: + resourceFieldRef: + divisor: "1" + resource: limits.cpu + - name: MEMORY_LIMIT_MIB + valueFrom: + resourceFieldRef: + divisor: 1Mi + resource: limits.memory + image: cockroachdb/cockroach:v21.1.0 + imagePullPolicy: IfNotPresent + lifecycle: + preStop: + exec: + command: + - sh + - -c + - /cockroach/cockroach node drain --certs-dir=/cockroach/cockroach-certs/ + || exit 0 + name: db + ports: + - containerPort: 26258 + name: grpc + protocol: TCP + - containerPort: 8080 + name: http + protocol: TCP + - containerPort: 26257 + name: sql + protocol: TCP + readinessProbe: + failureThreshold: 2 + httpGet: + path: /health?ready=1 + port: http + scheme: HTTPS + initialDelaySeconds: 10 + periodSeconds: 5 + resources: {} + volumeMounts: + - mountPath: /cockroach/cockroach-data/ + name: datadir + - mountPath: /cockroach/cockroach-certs/ + name: emptydir + initContainers: + - command: + - /bin/sh + - -c + - '>- cp -p /cockroach/cockroach-certs-prestage/..data/* /cockroach/cockroach-certs/ + && chmod 700 /cockroach/cockroach-certs/*.key && chown 1000581000:1000581000 + /cockroach/cockroach-certs/*.key' + image: cockroachdb/cockroach:v21.1.0 + imagePullPolicy: IfNotPresent + name: db-init + resources: {} + securityContext: + allowPrivilegeEscalation: false + runAsUser: 0 + volumeMounts: + - mountPath: /cockroach/cockroach-certs-prestage/ + name: certs + - mountPath: /cockroach/cockroach-certs/ + name: emptydir + securityContext: + fsGroup: 1000581000 + runAsUser: 1000581000 + serviceAccountName: test-cluster-sa + terminationGracePeriodSeconds: 300 + volumes: + - name: datadir + persistentVolumeClaim: + claimName: "" + - emptyDir: {} + name: emptydir + - name: certs + projected: + defaultMode: 400 + sources: + - secret: + items: + - key: ca.crt + mode: 504 + path: ca.crt + - key: tls.crt + mode: 504 + path: node.crt + - key: tls.key + mode: 400 + path: node.key + name: test-cluster-node + - secret: + items: + - key: tls.crt + mode: 504 + path: client.root.crt + - key: tls.key + mode: 400 + path: client.root.key + name: test-cluster-root + updateStrategy: + rollingUpdate: {} + volumeClaimTemplates: + - metadata: + creationTimestamp: null + labels: + app.kubernetes.io/component: database + app.kubernetes.io/instance: test-cluster + app.kubernetes.io/name: cockroachdb + car: koenigsegg + name: datadir + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + volumeMode: Filesystem + status: {} +status: + replicas: 0 diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/automount_sa_in.yaml b/pkg/resource/testdata/TestStatefulSetBuilder/automount_sa_in.yaml new file mode 100644 index 000000000..0fcbb26d5 --- /dev/null +++ b/pkg/resource/testdata/TestStatefulSetBuilder/automount_sa_in.yaml @@ -0,0 +1,43 @@ +# Copyright 2022 The Cockroach Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: crdb.cockroachlabs.com/v1alpha1 +kind: CrdbCluster +metadata: + creationTimestamp: null + name: test-cluster + namespace: test-ns +spec: + automountServiceAccountToken: true + dataStore: + pvc: + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: "1Gi" + volumeMode: Filesystem + grpcPort: 26258 + httpPort: 8080 + image: + name: cockroachdb/cockroach:v21.1.0 + nodes: 1 + tlsEnabled: true + topology: + zones: + - locality: "" + additionalLabels: + car: koenigsegg +status: {} diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/default_insecure_statefulset.golden b/pkg/resource/testdata/TestStatefulSetBuilder/default_insecure_statefulset.golden old mode 100755 new mode 100644 index 468a43662..1600f00af --- a/pkg/resource/testdata/TestStatefulSetBuilder/default_insecure_statefulset.golden +++ b/pkg/resource/testdata/TestStatefulSetBuilder/default_insecure_statefulset.golden @@ -28,12 +28,10 @@ spec: - command: - /bin/bash - -ecx - - 'exec /cockroach/cockroach.sh start - --advertise-host=$(POD_NAME).test-cluster.test-ns --insecure --http-port=8080 - --sql-addr=:26257 --listen-addr=:26258 --log="{sinks: {stderr: {channels: - [OPS, HEALTH], redact: true}}}" --cache $(expr $MEMORY_LIMIT_MIB / 4)MiB - --max-sql-memory $(expr $MEMORY_LIMIT_MIB / 4)MiB - --join=test-cluster-0.test-cluster.test-ns:26258' + - 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns + --insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks: + {stderr: {channels: [OPS, HEALTH], redact: true}}}" --cache $(expr $MEMORY_LIMIT_MIB + / 4)MiB --max-sql-memory $(expr $MEMORY_LIMIT_MIB / 4)MiB --join=test-cluster-0.test-cluster.test-ns:26258' env: - name: COCKROACH_CHANNEL value: kubernetes-operator-gke diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden b/pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden old mode 100755 new mode 100644 index e45558814..9cc9489b9 --- a/pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden +++ b/pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden @@ -30,12 +30,11 @@ spec: - command: - /bin/bash - -ecx - - 'exec /cockroach/cockroach.sh start - --advertise-host=$(POD_NAME).test-cluster.test-ns --certs-dir=/cockroach/cockroach-certs/ - --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks: {stderr: - {channels: [OPS, HEALTH], redact: true}}}" --cache $(expr $MEMORY_LIMIT_MIB - / 4)MiB --max-sql-memory $(expr $MEMORY_LIMIT_MIB / 4)MiB - --join=test-cluster-0.test-cluster.test-ns:26258' + - 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns + --certs-dir=/cockroach/cockroach-certs/ --http-port=8080 --sql-addr=:26257 + --listen-addr=:26258 --log="{sinks: {stderr: {channels: [OPS, HEALTH], redact: + true}}}" --cache $(expr $MEMORY_LIMIT_MIB / 4)MiB --max-sql-memory $(expr + $MEMORY_LIMIT_MIB / 4)MiB --join=test-cluster-0.test-cluster.test-ns:26258' env: - name: COCKROACH_CHANNEL value: kubernetes-operator-gke diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args.golden b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args.golden old mode 100755 new mode 100644 index fdbdffbdc..49e8aeb5f --- a/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args.golden +++ b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args.golden @@ -43,11 +43,10 @@ spec: - command: - /bin/bash - -ecx - - 'exec /cockroach/cockroach.sh start - --advertise-host=$(POD_NAME).test-cluster.test-ns --insecure --http-port=8080 - --sql-addr=:26257 --listen-addr=:26258 --log="{sinks: {stderr: {channels: - [OPS, HEALTH], redact: true}}}" --cache=30% --max-sql-memory=2GB --temp-dir=/tmp - --join=test-cluster-0.test-cluster.test-ns:26258' + - 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns + --insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks: + {stderr: {channels: [OPS, HEALTH], redact: true}}}" --cache=30% --max-sql-memory=2GB + --temp-dir=/tmp --join=test-cluster-0.test-cluster.test-ns:26258' env: - name: COCKROACH_CHANNEL value: kubernetes-operator-gke diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join.golden b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join.golden old mode 100755 new mode 100644 index 6fb429e3d..182ef0710 --- a/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join.golden +++ b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join.golden @@ -4,7 +4,7 @@ metadata: annotations: crdb.io/containerimage: "" crdb.io/version: "" - key: "test-value" + key: test-value creationTimestamp: null name: test-cluster spec: @@ -18,13 +18,13 @@ spec: serviceName: test-cluster template: metadata: + annotations: + key: test-value creationTimestamp: null labels: app.kubernetes.io/component: database app.kubernetes.io/instance: test-cluster app.kubernetes.io/name: cockroachdb - annotations: - key: "test-value" spec: affinity: podAntiAffinity: @@ -38,19 +38,14 @@ spec: - test-cluster topologyKey: kubernetes.io/hostname weight: 100 - tolerations: - - key: "key" - operator: "Exists" - effect: "NoSchedule" automountServiceAccountToken: false containers: - command: - /bin/bash - -ecx - - 'exec /cockroach/cockroach.sh start - --advertise-host=$(POD_NAME).test-cluster.test-ns --insecure --http-port=8080 - --sql-addr=:26257 --listen-addr=:26258 --log="{sinks: {stderr: {channels: - [OPS, HEALTH], redact: true}}}" --cache=30% --max-sql-memory=2GB + - 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns + --insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks: + {stderr: {channels: [OPS, HEALTH], redact: true}}}" --cache=30% --max-sql-memory=2GB --join=test-cluster-1.new-test-cluster.new-test-ns:26258' env: - name: COCKROACH_CHANNEL @@ -106,6 +101,10 @@ spec: runAsUser: 1000581000 serviceAccountName: test-cluster-sa terminationGracePeriodSeconds: 300 + tolerations: + - effect: NoSchedule + key: key + operator: Exists volumes: - name: datadir persistentVolumeClaim: @@ -115,11 +114,11 @@ spec: volumeClaimTemplates: - metadata: creationTimestamp: null - name: datadir labels: app.kubernetes.io/component: database app.kubernetes.io/instance: test-cluster app.kubernetes.io/name: cockroachdb + name: datadir spec: accessModes: - ReadWriteOnce diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_with_resources.golden b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_with_resources.golden old mode 100755 new mode 100644 index fe0d76eb9..7b3062da7 --- a/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_with_resources.golden +++ b/pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_with_resources.golden @@ -28,11 +28,10 @@ spec: - command: - /bin/bash - -ecx - - exec /cockroach/cockroach.sh start - --advertise-host=$(POD_NAME).test-cluster.test-ns --insecure --http-port=8080 - --sql-addr=:26257 --listen-addr=:26258 --logtostderr=INFO --cache $(expr - $MEMORY_LIMIT_MIB / 4)MiB --max-sql-memory $(expr $MEMORY_LIMIT_MIB / 4)MiB - --join=test-cluster-0.test-cluster.test-ns:26258 + - exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns + --insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --logtostderr=INFO + --cache $(expr $MEMORY_LIMIT_MIB / 4)MiB --max-sql-memory $(expr $MEMORY_LIMIT_MIB + / 4)MiB --join=test-cluster-0.test-cluster.test-ns:26258 env: - name: COCKROACH_CHANNEL value: kubernetes-operator-gke diff --git a/pkg/testutil/builder.go b/pkg/testutil/builder.go index 12bb9db04..ae79130dc 100644 --- a/pkg/testutil/builder.go +++ b/pkg/testutil/builder.go @@ -51,6 +51,11 @@ func (b ClusterBuilder) Namespaced(namespace string) ClusterBuilder { return b } +func (b ClusterBuilder) WithAutomountServiceAccountToken(mount bool) ClusterBuilder { + b.cluster.Spec.AutomountServiceAccountToken = mount + return b +} + func (b ClusterBuilder) WithUID(uid string) ClusterBuilder { b.cluster.ObjectMeta.UID = amtypes.UID(uid) return b From 9951bcd2c33a36bf195b06b2524cb9ad476d0341 Mon Sep 17 00:00:00 2001 From: "David Muto (pseudomuto)" Date: Mon, 11 Jul 2022 16:33:07 +0000 Subject: [PATCH 11/51] Fix CHANGELOG entry --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ff3aa2ab..fd0eb7673 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). # [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.7.0...master) +## Added + +* `AutomountServiceAccountToken` field for cluster spec to allow mounting the default service account token. + ## Fixed * Delete the CancelLoop function, fixing a cluster status update bug @@ -15,10 +19,6 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). # [v2.7.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.6.0...v2.7.0) -## Added - -* `AutomountServiceAccountToken` field for cluster spec to allow mounting the default service account token. - ## Fixed * Grant operator deletecollection permissions to fix fullcluster restart flow From 9ceebb1af5158d34f6500f3d7e0822285ebfddd4 Mon Sep 17 00:00:00 2001 From: David Muto Date: Wed, 13 Jul 2022 10:22:18 -0400 Subject: [PATCH 12/51] Bump version to 2.8.0 (#924) --- CHANGELOG.md | 4 +++- config/manager/patches/image.yaml | 2 +- install/operator.yaml | 2 +- version.txt | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd0eb7673..61b7575e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -# [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.7.0...master) +# [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.8.0...master) + +# [v2.8.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.7.0...v2.8.0) ## Added diff --git a/config/manager/patches/image.yaml b/config/manager/patches/image.yaml index 5471accfe..47b056500 100644 --- a/config/manager/patches/image.yaml +++ b/config/manager/patches/image.yaml @@ -24,7 +24,7 @@ spec: spec: containers: - name: cockroach-operator - image: cockroachdb/cockroach-operator:v2.7.0 + image: cockroachdb/cockroach-operator:v2.8.0 env: - name: RELATED_IMAGE_COCKROACH_v20_1_4 value: cockroachdb/cockroach:v20.1.4 diff --git a/install/operator.yaml b/install/operator.yaml index 98ff1fc4d..fb486901b 100644 --- a/install/operator.yaml +++ b/install/operator.yaml @@ -520,7 +520,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: cockroachdb/cockroach-operator:v2.7.0 + image: cockroachdb/cockroach-operator:v2.8.0 imagePullPolicy: IfNotPresent name: cockroach-operator resources: diff --git a/version.txt b/version.txt index 9aa34646d..6533b6687 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.7.0 \ No newline at end of file +2.8.0 \ No newline at end of file From 52fba0d2d256908dd2b161963eede8116f50e0ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 18 Jul 2022 10:14:05 -0400 Subject: [PATCH 13/51] Update CRDB versions (#925) Co-authored-by: GitHub Actions --- config/manager/patches/image.yaml | 2 ++ .../bases/cockroach-operator.clusterserviceversion.yaml | 2 ++ config/manifests/patches/deployment_patch.yaml | 2 ++ config/samples/crdb-tls-example.yaml | 2 +- crdb-versions.yaml | 3 +++ examples/client-secure-operator.yaml | 2 +- examples/example.yaml | 4 ++-- examples/smoketest.yaml | 2 +- install/operator.yaml | 2 ++ 9 files changed, 16 insertions(+), 5 deletions(-) diff --git a/config/manager/patches/image.yaml b/config/manager/patches/image.yaml index 47b056500..e8519c2dc 100644 --- a/config/manager/patches/image.yaml +++ b/config/manager/patches/image.yaml @@ -152,3 +152,5 @@ spec: value: cockroachdb/cockroach:v22.1.1 - name: RELATED_IMAGE_COCKROACH_v22_1_2 value: cockroachdb/cockroach:v22.1.2 + - name: RELATED_IMAGE_COCKROACH_v22_1_3 + value: cockroachdb/cockroach:v22.1.3 diff --git a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml index f12843d17..b129fccdf 100644 --- a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml @@ -308,3 +308,5 @@ spec: image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e23af8f9d32c3f80a52d79ceb4b359dda1d75ba0dd4cb8ed4b66ac2f4e40c69b - name: RELATED_IMAGE_COCKROACH_v22_1_2 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:266165ab87b19a05d6796e8b15ff0eba632d6ac96e6393400464c6136dd500ec + - name: RELATED_IMAGE_COCKROACH_v22_1_3 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:65923c37fecda2d3174212fa9d9a6f34241d065389336ea69a7be99ba16cedc2 diff --git a/config/manifests/patches/deployment_patch.yaml b/config/manifests/patches/deployment_patch.yaml index 75a698f61..cb7db5f2e 100644 --- a/config/manifests/patches/deployment_patch.yaml +++ b/config/manifests/patches/deployment_patch.yaml @@ -161,4 +161,6 @@ spec: value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e23af8f9d32c3f80a52d79ceb4b359dda1d75ba0dd4cb8ed4b66ac2f4e40c69b - name: RELATED_IMAGE_COCKROACH_v22_1_2 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:266165ab87b19a05d6796e8b15ff0eba632d6ac96e6393400464c6136dd500ec + - name: RELATED_IMAGE_COCKROACH_v22_1_3 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:65923c37fecda2d3174212fa9d9a6f34241d065389336ea69a7be99ba16cedc2 image: RH_COCKROACH_OP_IMAGE_PLACEHOLDER diff --git a/config/samples/crdb-tls-example.yaml b/config/samples/crdb-tls-example.yaml index 7c38ee930..5578fe1eb 100644 --- a/config/samples/crdb-tls-example.yaml +++ b/config/samples/crdb-tls-example.yaml @@ -19,7 +19,7 @@ kind: CrdbCluster metadata: name: crdb-tls-example spec: - cockroachDBVersion: v22.1.2 + cockroachDBVersion: v22.1.3 dataStore: pvc: spec: diff --git a/crdb-versions.yaml b/crdb-versions.yaml index 8fc392e5c..f53e80929 100644 --- a/crdb-versions.yaml +++ b/crdb-versions.yaml @@ -211,3 +211,6 @@ CrdbVersions: - image: cockroachdb/cockroach:v22.1.2 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:266165ab87b19a05d6796e8b15ff0eba632d6ac96e6393400464c6136dd500ec tag: v22.1.2 +- image: cockroachdb/cockroach:v22.1.3 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:65923c37fecda2d3174212fa9d9a6f34241d065389336ea69a7be99ba16cedc2 + tag: v22.1.3 diff --git a/examples/client-secure-operator.yaml b/examples/client-secure-operator.yaml index c57329f01..4bbe79b77 100644 --- a/examples/client-secure-operator.yaml +++ b/examples/client-secure-operator.yaml @@ -23,7 +23,7 @@ spec: serviceAccountName: cockroachdb-sa containers: - name: cockroachdb-client-secure - image: cockroachdb/cockroach:v22.1.2 + image: cockroachdb/cockroach:v22.1.3 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/examples/example.yaml b/examples/example.yaml index 7b688bd45..d04b31053 100644 --- a/examples/example.yaml +++ b/examples/example.yaml @@ -40,9 +40,9 @@ spec: memory: 8Gi tlsEnabled: true # You can set either a version of the db or a specific image name -# cockroachDBVersion: v22.1.2 +# cockroachDBVersion: v22.1.3 image: - name: cockroachdb/cockroach:v22.1.2 + name: cockroachdb/cockroach:v22.1.3 # nodes refers to the number of crdb pods that are created # via the statefulset nodes: 3 diff --git a/examples/smoketest.yaml b/examples/smoketest.yaml index 56add1c59..843fe7260 100644 --- a/examples/smoketest.yaml +++ b/examples/smoketest.yaml @@ -39,5 +39,5 @@ spec: memory: 300Mi tlsEnabled: true image: - name: cockroachdb/cockroach:v22.1.2 + name: cockroachdb/cockroach:v22.1.3 nodes: 3 diff --git a/install/operator.yaml b/install/operator.yaml index fb486901b..a6e373a45 100644 --- a/install/operator.yaml +++ b/install/operator.yaml @@ -510,6 +510,8 @@ spec: value: cockroachdb/cockroach:v22.1.1 - name: RELATED_IMAGE_COCKROACH_v22_1_2 value: cockroachdb/cockroach:v22.1.2 + - name: RELATED_IMAGE_COCKROACH_v22_1_3 + value: cockroachdb/cockroach:v22.1.3 - name: OPERATOR_NAME value: cockroachdb - name: POD_NAME From 0ef4d1e1b4c94a8edf1393b0fa72d9de8bc21477 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 21 Sep 2022 13:17:26 -0400 Subject: [PATCH 14/51] Update CRDB versions (#926) * Update CRDB versions * Update CRDB versions * Update CRDB versions Co-authored-by: GitHub Actions --- config/manager/patches/image.yaml | 6 ++++++ .../bases/cockroach-operator.clusterserviceversion.yaml | 6 ++++++ config/manifests/patches/deployment_patch.yaml | 6 ++++++ config/samples/crdb-tls-example.yaml | 2 +- crdb-versions.yaml | 9 +++++++++ examples/client-secure-operator.yaml | 2 +- examples/example.yaml | 4 ++-- examples/smoketest.yaml | 2 +- install/operator.yaml | 6 ++++++ 9 files changed, 38 insertions(+), 5 deletions(-) diff --git a/config/manager/patches/image.yaml b/config/manager/patches/image.yaml index e8519c2dc..0fc02ba8e 100644 --- a/config/manager/patches/image.yaml +++ b/config/manager/patches/image.yaml @@ -146,6 +146,8 @@ spec: value: cockroachdb/cockroach:v21.2.12 - name: RELATED_IMAGE_COCKROACH_v21_2_13 value: cockroachdb/cockroach:v21.2.13 + - name: RELATED_IMAGE_COCKROACH_v21_2_14 + value: cockroachdb/cockroach:v21.2.14 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: cockroachdb/cockroach:v22.1.0 - name: RELATED_IMAGE_COCKROACH_v22_1_1 @@ -154,3 +156,7 @@ spec: value: cockroachdb/cockroach:v22.1.2 - name: RELATED_IMAGE_COCKROACH_v22_1_3 value: cockroachdb/cockroach:v22.1.3 + - name: RELATED_IMAGE_COCKROACH_v22_1_4 + value: cockroachdb/cockroach:v22.1.4 + - name: RELATED_IMAGE_COCKROACH_v22_1_5 + value: cockroachdb/cockroach:v22.1.5 diff --git a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml index b129fccdf..6ae16babb 100644 --- a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml @@ -302,6 +302,8 @@ spec: image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:ce3d94a3fbdcde5858beb3c265987759971d991c397c6486e19904bd4706f44d - name: RELATED_IMAGE_COCKROACH_v21_2_13 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:9097e135159f46396ef4649f724d61bb5b9113c488f989d404586fbb7486fd85 + - name: RELATED_IMAGE_COCKROACH_v21_2_14 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:28ae9661b38a72decf413c6a6c3758e61098debf5162197c27a12a070c7a096d - name: RELATED_IMAGE_COCKROACH_v22_1_0 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 - name: RELATED_IMAGE_COCKROACH_v22_1_1 @@ -310,3 +312,7 @@ spec: image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:266165ab87b19a05d6796e8b15ff0eba632d6ac96e6393400464c6136dd500ec - name: RELATED_IMAGE_COCKROACH_v22_1_3 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:65923c37fecda2d3174212fa9d9a6f34241d065389336ea69a7be99ba16cedc2 + - name: RELATED_IMAGE_COCKROACH_v22_1_4 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:7bd75aa918355e77cd671c3e11ee807861378e96245245f4fdf243cba5749f9a + - name: RELATED_IMAGE_COCKROACH_v22_1_5 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:a4f932c3e9ff3aeb70ba1f7a92aa4642bd14cbb7d37d04ff750ed517b916cdb9 diff --git a/config/manifests/patches/deployment_patch.yaml b/config/manifests/patches/deployment_patch.yaml index cb7db5f2e..c5b697f1e 100644 --- a/config/manifests/patches/deployment_patch.yaml +++ b/config/manifests/patches/deployment_patch.yaml @@ -155,6 +155,8 @@ spec: value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:ce3d94a3fbdcde5858beb3c265987759971d991c397c6486e19904bd4706f44d - name: RELATED_IMAGE_COCKROACH_v21_2_13 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:9097e135159f46396ef4649f724d61bb5b9113c488f989d404586fbb7486fd85 + - name: RELATED_IMAGE_COCKROACH_v21_2_14 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:28ae9661b38a72decf413c6a6c3758e61098debf5162197c27a12a070c7a096d - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 - name: RELATED_IMAGE_COCKROACH_v22_1_1 @@ -163,4 +165,8 @@ spec: value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:266165ab87b19a05d6796e8b15ff0eba632d6ac96e6393400464c6136dd500ec - name: RELATED_IMAGE_COCKROACH_v22_1_3 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:65923c37fecda2d3174212fa9d9a6f34241d065389336ea69a7be99ba16cedc2 + - name: RELATED_IMAGE_COCKROACH_v22_1_4 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:7bd75aa918355e77cd671c3e11ee807861378e96245245f4fdf243cba5749f9a + - name: RELATED_IMAGE_COCKROACH_v22_1_5 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:a4f932c3e9ff3aeb70ba1f7a92aa4642bd14cbb7d37d04ff750ed517b916cdb9 image: RH_COCKROACH_OP_IMAGE_PLACEHOLDER diff --git a/config/samples/crdb-tls-example.yaml b/config/samples/crdb-tls-example.yaml index 5578fe1eb..bea3f8dc5 100644 --- a/config/samples/crdb-tls-example.yaml +++ b/config/samples/crdb-tls-example.yaml @@ -19,7 +19,7 @@ kind: CrdbCluster metadata: name: crdb-tls-example spec: - cockroachDBVersion: v22.1.3 + cockroachDBVersion: v22.1.5 dataStore: pvc: spec: diff --git a/crdb-versions.yaml b/crdb-versions.yaml index f53e80929..e896d6618 100644 --- a/crdb-versions.yaml +++ b/crdb-versions.yaml @@ -202,6 +202,9 @@ CrdbVersions: - image: cockroachdb/cockroach:v21.2.13 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:9097e135159f46396ef4649f724d61bb5b9113c488f989d404586fbb7486fd85 tag: v21.2.13 +- image: cockroachdb/cockroach:v21.2.14 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:28ae9661b38a72decf413c6a6c3758e61098debf5162197c27a12a070c7a096d + tag: v21.2.14 - image: cockroachdb/cockroach:v22.1.0 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 tag: v22.1.0 @@ -214,3 +217,9 @@ CrdbVersions: - image: cockroachdb/cockroach:v22.1.3 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:65923c37fecda2d3174212fa9d9a6f34241d065389336ea69a7be99ba16cedc2 tag: v22.1.3 +- image: cockroachdb/cockroach:v22.1.4 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:7bd75aa918355e77cd671c3e11ee807861378e96245245f4fdf243cba5749f9a + tag: v22.1.4 +- image: cockroachdb/cockroach:v22.1.5 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:a4f932c3e9ff3aeb70ba1f7a92aa4642bd14cbb7d37d04ff750ed517b916cdb9 + tag: v22.1.5 diff --git a/examples/client-secure-operator.yaml b/examples/client-secure-operator.yaml index 4bbe79b77..60cc56f2d 100644 --- a/examples/client-secure-operator.yaml +++ b/examples/client-secure-operator.yaml @@ -23,7 +23,7 @@ spec: serviceAccountName: cockroachdb-sa containers: - name: cockroachdb-client-secure - image: cockroachdb/cockroach:v22.1.3 + image: cockroachdb/cockroach:v22.1.5 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/examples/example.yaml b/examples/example.yaml index d04b31053..fccdd2bd4 100644 --- a/examples/example.yaml +++ b/examples/example.yaml @@ -40,9 +40,9 @@ spec: memory: 8Gi tlsEnabled: true # You can set either a version of the db or a specific image name -# cockroachDBVersion: v22.1.3 +# cockroachDBVersion: v22.1.5 image: - name: cockroachdb/cockroach:v22.1.3 + name: cockroachdb/cockroach:v22.1.5 # nodes refers to the number of crdb pods that are created # via the statefulset nodes: 3 diff --git a/examples/smoketest.yaml b/examples/smoketest.yaml index 843fe7260..befef465c 100644 --- a/examples/smoketest.yaml +++ b/examples/smoketest.yaml @@ -39,5 +39,5 @@ spec: memory: 300Mi tlsEnabled: true image: - name: cockroachdb/cockroach:v22.1.3 + name: cockroachdb/cockroach:v22.1.5 nodes: 3 diff --git a/install/operator.yaml b/install/operator.yaml index a6e373a45..f4bd107e8 100644 --- a/install/operator.yaml +++ b/install/operator.yaml @@ -504,6 +504,8 @@ spec: value: cockroachdb/cockroach:v21.2.12 - name: RELATED_IMAGE_COCKROACH_v21_2_13 value: cockroachdb/cockroach:v21.2.13 + - name: RELATED_IMAGE_COCKROACH_v21_2_14 + value: cockroachdb/cockroach:v21.2.14 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: cockroachdb/cockroach:v22.1.0 - name: RELATED_IMAGE_COCKROACH_v22_1_1 @@ -512,6 +514,10 @@ spec: value: cockroachdb/cockroach:v22.1.2 - name: RELATED_IMAGE_COCKROACH_v22_1_3 value: cockroachdb/cockroach:v22.1.3 + - name: RELATED_IMAGE_COCKROACH_v22_1_4 + value: cockroachdb/cockroach:v22.1.4 + - name: RELATED_IMAGE_COCKROACH_v22_1_5 + value: cockroachdb/cockroach:v22.1.5 - name: OPERATOR_NAME value: cockroachdb - name: POD_NAME From 1dc3a1b227c4d8b546f98c6183fa0b1929a65e51 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 16:18:45 -0400 Subject: [PATCH 15/51] Update CRDB versions (#934) Co-authored-by: GitHub Actions --- config/manager/patches/image.yaml | 8 ++++++++ .../cockroach-operator.clusterserviceversion.yaml | 8 ++++++++ config/manifests/patches/deployment_patch.yaml | 8 ++++++++ config/samples/crdb-tls-example.yaml | 2 +- crdb-versions.yaml | 12 ++++++++++++ examples/client-secure-operator.yaml | 2 +- examples/example.yaml | 4 ++-- examples/smoketest.yaml | 2 +- install/operator.yaml | 8 ++++++++ 9 files changed, 49 insertions(+), 5 deletions(-) diff --git a/config/manager/patches/image.yaml b/config/manager/patches/image.yaml index 0fc02ba8e..47988c335 100644 --- a/config/manager/patches/image.yaml +++ b/config/manager/patches/image.yaml @@ -148,6 +148,10 @@ spec: value: cockroachdb/cockroach:v21.2.13 - name: RELATED_IMAGE_COCKROACH_v21_2_14 value: cockroachdb/cockroach:v21.2.14 + - name: RELATED_IMAGE_COCKROACH_v21_2_15 + value: cockroachdb/cockroach:v21.2.15 + - name: RELATED_IMAGE_COCKROACH_v21_2_16 + value: cockroachdb/cockroach:v21.2.16 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: cockroachdb/cockroach:v22.1.0 - name: RELATED_IMAGE_COCKROACH_v22_1_1 @@ -160,3 +164,7 @@ spec: value: cockroachdb/cockroach:v22.1.4 - name: RELATED_IMAGE_COCKROACH_v22_1_5 value: cockroachdb/cockroach:v22.1.5 + - name: RELATED_IMAGE_COCKROACH_v22_1_7 + value: cockroachdb/cockroach:v22.1.7 + - name: RELATED_IMAGE_COCKROACH_v22_1_8 + value: cockroachdb/cockroach:v22.1.8 diff --git a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml index 6ae16babb..ec20c2423 100644 --- a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml @@ -304,6 +304,10 @@ spec: image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:9097e135159f46396ef4649f724d61bb5b9113c488f989d404586fbb7486fd85 - name: RELATED_IMAGE_COCKROACH_v21_2_14 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:28ae9661b38a72decf413c6a6c3758e61098debf5162197c27a12a070c7a096d + - name: RELATED_IMAGE_COCKROACH_v21_2_15 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:a6f1c43486d044fed9f59406118f429c8037b389bd8c8d7a1c7aeb89ed2661f7 + - name: RELATED_IMAGE_COCKROACH_v21_2_16 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:08496b84b3cc691909227be17e67bcd6f4d5185a93712f44d8a0985bd2c5fcd7 - name: RELATED_IMAGE_COCKROACH_v22_1_0 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 - name: RELATED_IMAGE_COCKROACH_v22_1_1 @@ -316,3 +320,7 @@ spec: image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:7bd75aa918355e77cd671c3e11ee807861378e96245245f4fdf243cba5749f9a - name: RELATED_IMAGE_COCKROACH_v22_1_5 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:a4f932c3e9ff3aeb70ba1f7a92aa4642bd14cbb7d37d04ff750ed517b916cdb9 + - name: RELATED_IMAGE_COCKROACH_v22_1_7 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:da367cf0ac52045002e1c186f8e6964267ad87d5c25f9e72fd2c9b9a98a32702 + - name: RELATED_IMAGE_COCKROACH_v22_1_8 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:f6bb15b36d64eebb6e4c1db5a5466e108b271d53383c58e0b6c78cec214756a9 diff --git a/config/manifests/patches/deployment_patch.yaml b/config/manifests/patches/deployment_patch.yaml index c5b697f1e..aff245c26 100644 --- a/config/manifests/patches/deployment_patch.yaml +++ b/config/manifests/patches/deployment_patch.yaml @@ -157,6 +157,10 @@ spec: value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:9097e135159f46396ef4649f724d61bb5b9113c488f989d404586fbb7486fd85 - name: RELATED_IMAGE_COCKROACH_v21_2_14 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:28ae9661b38a72decf413c6a6c3758e61098debf5162197c27a12a070c7a096d + - name: RELATED_IMAGE_COCKROACH_v21_2_15 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:a6f1c43486d044fed9f59406118f429c8037b389bd8c8d7a1c7aeb89ed2661f7 + - name: RELATED_IMAGE_COCKROACH_v21_2_16 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:08496b84b3cc691909227be17e67bcd6f4d5185a93712f44d8a0985bd2c5fcd7 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 - name: RELATED_IMAGE_COCKROACH_v22_1_1 @@ -169,4 +173,8 @@ spec: value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:7bd75aa918355e77cd671c3e11ee807861378e96245245f4fdf243cba5749f9a - name: RELATED_IMAGE_COCKROACH_v22_1_5 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:a4f932c3e9ff3aeb70ba1f7a92aa4642bd14cbb7d37d04ff750ed517b916cdb9 + - name: RELATED_IMAGE_COCKROACH_v22_1_7 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:da367cf0ac52045002e1c186f8e6964267ad87d5c25f9e72fd2c9b9a98a32702 + - name: RELATED_IMAGE_COCKROACH_v22_1_8 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:f6bb15b36d64eebb6e4c1db5a5466e108b271d53383c58e0b6c78cec214756a9 image: RH_COCKROACH_OP_IMAGE_PLACEHOLDER diff --git a/config/samples/crdb-tls-example.yaml b/config/samples/crdb-tls-example.yaml index bea3f8dc5..770f5a761 100644 --- a/config/samples/crdb-tls-example.yaml +++ b/config/samples/crdb-tls-example.yaml @@ -19,7 +19,7 @@ kind: CrdbCluster metadata: name: crdb-tls-example spec: - cockroachDBVersion: v22.1.5 + cockroachDBVersion: v22.1.8 dataStore: pvc: spec: diff --git a/crdb-versions.yaml b/crdb-versions.yaml index e896d6618..7774d26e7 100644 --- a/crdb-versions.yaml +++ b/crdb-versions.yaml @@ -205,6 +205,12 @@ CrdbVersions: - image: cockroachdb/cockroach:v21.2.14 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:28ae9661b38a72decf413c6a6c3758e61098debf5162197c27a12a070c7a096d tag: v21.2.14 +- image: cockroachdb/cockroach:v21.2.15 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:a6f1c43486d044fed9f59406118f429c8037b389bd8c8d7a1c7aeb89ed2661f7 + tag: v21.2.15 +- image: cockroachdb/cockroach:v21.2.16 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:08496b84b3cc691909227be17e67bcd6f4d5185a93712f44d8a0985bd2c5fcd7 + tag: v21.2.16 - image: cockroachdb/cockroach:v22.1.0 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 tag: v22.1.0 @@ -223,3 +229,9 @@ CrdbVersions: - image: cockroachdb/cockroach:v22.1.5 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:a4f932c3e9ff3aeb70ba1f7a92aa4642bd14cbb7d37d04ff750ed517b916cdb9 tag: v22.1.5 +- image: cockroachdb/cockroach:v22.1.7 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:da367cf0ac52045002e1c186f8e6964267ad87d5c25f9e72fd2c9b9a98a32702 + tag: v22.1.7 +- image: cockroachdb/cockroach:v22.1.8 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:f6bb15b36d64eebb6e4c1db5a5466e108b271d53383c58e0b6c78cec214756a9 + tag: v22.1.8 diff --git a/examples/client-secure-operator.yaml b/examples/client-secure-operator.yaml index 60cc56f2d..618d30ce6 100644 --- a/examples/client-secure-operator.yaml +++ b/examples/client-secure-operator.yaml @@ -23,7 +23,7 @@ spec: serviceAccountName: cockroachdb-sa containers: - name: cockroachdb-client-secure - image: cockroachdb/cockroach:v22.1.5 + image: cockroachdb/cockroach:v22.1.8 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/examples/example.yaml b/examples/example.yaml index fccdd2bd4..e51c4a142 100644 --- a/examples/example.yaml +++ b/examples/example.yaml @@ -40,9 +40,9 @@ spec: memory: 8Gi tlsEnabled: true # You can set either a version of the db or a specific image name -# cockroachDBVersion: v22.1.5 +# cockroachDBVersion: v22.1.8 image: - name: cockroachdb/cockroach:v22.1.5 + name: cockroachdb/cockroach:v22.1.8 # nodes refers to the number of crdb pods that are created # via the statefulset nodes: 3 diff --git a/examples/smoketest.yaml b/examples/smoketest.yaml index befef465c..532c758eb 100644 --- a/examples/smoketest.yaml +++ b/examples/smoketest.yaml @@ -39,5 +39,5 @@ spec: memory: 300Mi tlsEnabled: true image: - name: cockroachdb/cockroach:v22.1.5 + name: cockroachdb/cockroach:v22.1.8 nodes: 3 diff --git a/install/operator.yaml b/install/operator.yaml index f4bd107e8..b1a395eff 100644 --- a/install/operator.yaml +++ b/install/operator.yaml @@ -506,6 +506,10 @@ spec: value: cockroachdb/cockroach:v21.2.13 - name: RELATED_IMAGE_COCKROACH_v21_2_14 value: cockroachdb/cockroach:v21.2.14 + - name: RELATED_IMAGE_COCKROACH_v21_2_15 + value: cockroachdb/cockroach:v21.2.15 + - name: RELATED_IMAGE_COCKROACH_v21_2_16 + value: cockroachdb/cockroach:v21.2.16 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: cockroachdb/cockroach:v22.1.0 - name: RELATED_IMAGE_COCKROACH_v22_1_1 @@ -518,6 +522,10 @@ spec: value: cockroachdb/cockroach:v22.1.4 - name: RELATED_IMAGE_COCKROACH_v22_1_5 value: cockroachdb/cockroach:v22.1.5 + - name: RELATED_IMAGE_COCKROACH_v22_1_7 + value: cockroachdb/cockroach:v22.1.7 + - name: RELATED_IMAGE_COCKROACH_v22_1_8 + value: cockroachdb/cockroach:v22.1.8 - name: OPERATOR_NAME value: cockroachdb - name: POD_NAME From 308fb04e79f43bd2f64a57f980733885312912ad Mon Sep 17 00:00:00 2001 From: noguchitoshi Date: Wed, 12 Oct 2022 17:20:32 -0400 Subject: [PATCH 16/51] Fix e2e tests (#933) Co-authored-by: Chris Seto --- Makefile | 21 +++++++++++++-------- hack/bin/deps.bzl | 37 +++++++++++++++++++------------------ 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 511bdd3dc..70f21b776 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,11 @@ SHELL:=/usr/bin/env bash -O globstar +# Define path where we install binaries. +# NOTE(all): We need to use absolute paths because kubetest2 on go 1.19 does +# not support relative paths. +BINPATH := $(abspath bazel-bin) + # values used in workspace-status.sh CLUSTER_NAME?=bazel-test COCKROACH_DATABASE_VERSION=v21.2.3 @@ -104,15 +109,15 @@ test/e2e/testrunner-k3d-%: test/e2e/k3d-%: PACKAGE=$* test/e2e/k3d-%: bazel build //hack/bin/... //e2e/kubetest2-k3d/... - PATH=bazel-bin/hack/bin:bazel-bin/e2e/kubetest2-k3d/kubetest2-k3d_/:${PATH} \ - bazel-bin/hack/bin/kubetest2 k3d \ + PATH=$(BINPATH)/hack/bin:$(BINPATH)/e2e/kubetest2-k3d/kubetest2-k3d_/:${PATH} \ + kubetest2 k3d \ --cluster-name=$(CLUSTER_NAME) --image rancher/k3s:v1.23.3-k3s1 --servers 3 \ --up --down -v 10 --test=exec -- make test/e2e/testrunner-k3d-$(PACKAGE) # This target is used by kubetest2-eks to run e2e tests. .PHONY: test/e2e/testrunner-eks test/e2e/testrunner-eks: - KUBECONFIG=$(TMPDIR)/$(CLUSTER_NAME)-eks.kubeconfig.yaml bazel-bin/hack/bin/kubectl create -f hack/eks-storageclass.yaml + KUBECONFIG=$(TMPDIR)/$(CLUSTER_NAME)-eks.kubeconfig.yaml $(BINPATH)/hack/bin/kubectl create -f hack/eks-storageclass.yaml bazel test --stamp //e2e/upgrades/... --action_env=KUBECONFIG=$(TMPDIR)/$(CLUSTER_NAME)-eks.kubeconfig.yaml bazel test --stamp //e2e/create/... --action_env=KUBECONFIG=$(TMPDIR)/$(CLUSTER_NAME)-eks.kubeconfig.yaml bazel test --stamp //e2e/decommission/... --action_env=KUBECONFIG=$(TMPDIR)/$(CLUSTER_NAME)-eks.kubeconfig.yaml @@ -123,8 +128,8 @@ test/e2e/testrunner-eks: .PHONY: test/e2e/eks test/e2e/eks: bazel build //hack/bin/... //e2e/kubetest2-eks/... - PATH=${PATH}:bazel-bin/hack/bin:bazel-bin/e2e/kubetest2-eks/kubetest2-eks_/ \ - bazel-bin/hack/bin/kubetest2 eks --cluster-name=$(CLUSTER_NAME) --up --down -v 10 \ + PATH=${PATH}:$(BINPATH)/hack/bin:$(BINPATH)/e2e/kubetest2-eks/kubetest2-eks_/ \ + $(BINPATH)/hack/bin/kubetest2 eks --cluster-name=$(CLUSTER_NAME) --up --down -v 10 \ --test=exec -- make test/e2e/testrunner-eks # This target is used by kubetest2-tester-exec when running a gke test @@ -163,7 +168,7 @@ test/e2e/testrunner-gke: .PHONY: test/e2e/gke test/e2e/gke: bazel build //hack/bin/... - PATH=${PATH}:bazel-bin/hack/bin bazel-bin/hack/bin/kubetest2 gke --cluster-name=$(CLUSTER_NAME) \ + PATH=${PATH}:$(BINPATH)/hack/bin kubetest2 gke --cluster-name=$(CLUSTER_NAME) \ --zone=$(GCP_ZONE) --project=$(GCP_PROJECT) \ --version latest --up --down -v 10 --ignore-gcp-ssh-key \ --test=exec -- make test/e2e/testrunner-gke @@ -185,8 +190,8 @@ test/e2e/testrunner-openshift: .PHONY: test/e2e/openshift test/e2e/openshift: bazel build //hack/bin/... //e2e/kubetest2-openshift/... - PATH=${PATH}:bazel-bin/hack/bin:bazel-bin/e2e/kubetest2-openshift/kubetest2-openshift_/ \ - bazel-bin/hack/bin/kubetest2 openshift --cluster-name=$(CLUSTER_NAME) \ + PATH=${PATH}:$(BINPATH)/hack/bin:$(BINPATH)/e2e/kubetest2-openshift/kubetest2-openshift_/ \ + kubetest2 openshift --cluster-name=$(CLUSTER_NAME) \ --gcp-project-id=$(GCP_PROJECT) \ --gcp-region=$(GCP_REGION) \ --base-domain=$(BASE_DOMAIN) \ diff --git a/hack/bin/deps.bzl b/hack/bin/deps.bzl index 45bdebd20..87d112b69 100644 --- a/hack/bin/deps.bzl +++ b/hack/bin/deps.bzl @@ -268,17 +268,17 @@ filegroup( def install_kubetest2(): # install kubetest2 binary http_file( - name = "kubetest2_darwin", - executable = 1, - sha256 = "5b20aadd05eca47dead180a7c8296d75e81c184aabf182d4a41ef96597db543d", - urls = ["https://storage.googleapis.com/crdb-bazel-artifacts/osx/kubetest2"], + name = "kubetest2_darwin", + executable = 1, + sha256 = "9fab82888e5c955778a8c49fdd2b9d2216be1a58f70615977fb92f678383e688", + urls = ["https://storage.googleapis.com/cockroach-operator-bazel-artifacts/kubetest2_darwin_amd64_v1/kubetest2"], ) http_file( name = "kubetest2_linux", executable = 1, - sha256 = "7f0b05654fa43ca1c607db297b5f3a775f65eea90355bb6b10137a7fffff5e1a", - urls = ["https://storage.googleapis.com/crdb-bazel-artifacts/linux/kubetest2"], + sha256 = "f9306a103dc222d51753e788550bd77c05a910a957a7eb4901ccb7f78256f7b8", + urls = ["https://storage.googleapis.com/cockroach-operator-bazel-artifacts/kubetest2_linux_amd64_v1/kubetest2"], ) ## Fetch kubetest2-gke binary used during e2e tests @@ -286,34 +286,35 @@ def install_kubetest2_gke(): # install kubetest2-gke binary # TODO osx support http_file( - name = "kubetest2_gke_darwin", - executable = 1, - sha256 = "a1cbe02f61931dbe6c8d1662442f42cb538c81e4ec8cdd40f548f0e05cbd55a7", - urls = ["https://storage.googleapis.com/crdb-bazel-artifacts/osx/kubetest2-gke"], + name = "kubetest2_gke_darwin", + executable = 1, + sha256 = "12d0b7cc9eb2ab2befe781f08672f2707631debd852f2805bed1565699e44a6e", + urls = ["https://storage.googleapis.com/cockroach-operator-bazel-artifacts/kubetest2-gke_darwin_amd64_v1/kubetest2-gke"], ) http_file( name = "kubetest2_gke_linux", executable = 1, - sha256 = "9ac658234efc7f59968888662dd2d21908587789f6b812392ac5b6766b17c0b4", - urls = ["https://storage.googleapis.com/crdb-bazel-artifacts/linux/kubetest2-gke"], + sha256 = "2b294abe037243e8bf71fcef6f02d93ee69abadfd0034681237478fa69474097", + urls = ["https://storage.googleapis.com/cockroach-operator-bazel-artifacts/kubetest2-gke_linux_amd64_v1/kubetest2-gke"], ) + ## Fetch kubetest2-tester-exe binary used during e2e tests def install_kubetest2_exe(): # install kubetest2-exe binary # TODO osx support http_file( - name = "kubetest2_exe_darwin", - executable = 1, - sha256 = "818690cb55590440e163b18dd139c8a8714df9480f869bafe19eb344047cf37c", - urls = ["https://storage.googleapis.com/crdb-bazel-artifacts/osx/kubetest2-tester-exec"], + name = "kubetest2_exe_darwin", + executable = 1, + sha256 = "15a6c8ff2e6b3962954553eacc9aeefb40ac81f67c326144db2ad94d58756357", + urls = ["https://storage.googleapis.com/cockroach-operator-bazel-artifacts/kubetest2-tester-exec_darwin_amd64_v1/kubetest2-tester-exec"], ) http_file( name = "kubetest2_exe_linux", executable = 1, - sha256 = "4483f40f48b98e8a6aa41f58bfdf1f2787066a4e1ad1343e4281892aa1326736", - urls = ["https://storage.googleapis.com/crdb-bazel-artifacts/linux/kubetest2-tester-exec"], + sha256 = "b96c9b651c6a4449adfa41d6760ec1b34ec02230b5debd850976ced3926d80db", + urls = ["https://storage.googleapis.com/cockroach-operator-bazel-artifacts/kubetest2-tester-exec_linux_amd64_v1/kubetest2-tester-exec"], ) ## Fetch operator-sdk used on generating csv From f476ff308a53205512cf64ab70b8fb22748b0aae Mon Sep 17 00:00:00 2001 From: noguchitoshi Date: Tue, 18 Oct 2022 10:31:01 -0400 Subject: [PATCH 17/51] Fix cert permissions (#935) --- CHANGELOG.md | 4 ++++ pkg/resource/statefulset.go | 2 +- .../testdata/TestStatefulSetBuilder/automount_sa.golden | 2 +- .../testdata/TestStatefulSetBuilder/default_secure.golden | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61b7575e5..0341a45f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). # [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.8.0...master) +## Fixed + +* Install init container certs with 600 permissions + # [v2.8.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.7.0...v2.8.0) ## Added diff --git a/pkg/resource/statefulset.go b/pkg/resource/statefulset.go index 6f8d780e1..2356d2e17 100644 --- a/pkg/resource/statefulset.go +++ b/pkg/resource/statefulset.go @@ -43,7 +43,7 @@ const ( dataDirMountPath = "/cockroach/cockroach-data/" certsDirName = "certs" - certCpCmd = ">- cp -p /cockroach/cockroach-certs-prestage/..data/* /cockroach/cockroach-certs/ && chmod 700 /cockroach/cockroach-certs/*.key && chown 1000581000:1000581000 /cockroach/cockroach-certs/*.key" + certCpCmd = ">- cp -p /cockroach/cockroach-certs-prestage/..data/* /cockroach/cockroach-certs/ && chmod 600 /cockroach/cockroach-certs/*.key && chown 1000581000:1000581000 /cockroach/cockroach-certs/*.key" emptyDirName = "emptydir" // DbContainerName is the name of the container definition in the pod spec diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/automount_sa.golden b/pkg/resource/testdata/TestStatefulSetBuilder/automount_sa.golden index 8e820c2a6..37b73f0db 100644 --- a/pkg/resource/testdata/TestStatefulSetBuilder/automount_sa.golden +++ b/pkg/resource/testdata/TestStatefulSetBuilder/automount_sa.golden @@ -92,7 +92,7 @@ spec: - /bin/sh - -c - '>- cp -p /cockroach/cockroach-certs-prestage/..data/* /cockroach/cockroach-certs/ - && chmod 700 /cockroach/cockroach-certs/*.key && chown 1000581000:1000581000 + && chmod 600 /cockroach/cockroach-certs/*.key && chown 1000581000:1000581000 /cockroach/cockroach-certs/*.key' image: cockroachdb/cockroach:v21.1.0 imagePullPolicy: IfNotPresent diff --git a/pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden b/pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden index 9cc9489b9..15bf7d863 100644 --- a/pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden +++ b/pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden @@ -92,7 +92,7 @@ spec: - /bin/sh - -c - '>- cp -p /cockroach/cockroach-certs-prestage/..data/* /cockroach/cockroach-certs/ - && chmod 700 /cockroach/cockroach-certs/*.key && chown 1000581000:1000581000 + && chmod 600 /cockroach/cockroach-certs/*.key && chown 1000581000:1000581000 /cockroach/cockroach-certs/*.key' image: cockroachdb/cockroach:v21.1.0 imagePullPolicy: IfNotPresent From 503d8fc86b5a6c32a5d862884eda39bed2d4456d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 15 Dec 2022 13:29:03 -0500 Subject: [PATCH 18/51] Update CRDB versions (#936) * Update CRDB versions Co-authored-by: GitHub Actions --- config/manager/patches/image.yaml | 8 ++++++++ .../cockroach-operator.clusterserviceversion.yaml | 8 ++++++++ config/manifests/patches/deployment_patch.yaml | 8 ++++++++ config/samples/crdb-tls-example.yaml | 2 +- crdb-versions.yaml | 12 ++++++++++++ examples/client-secure-operator.yaml | 2 +- examples/example.yaml | 4 ++-- examples/smoketest.yaml | 2 +- install/operator.yaml | 8 ++++++++ 9 files changed, 49 insertions(+), 5 deletions(-) diff --git a/config/manager/patches/image.yaml b/config/manager/patches/image.yaml index 47988c335..244bb06df 100644 --- a/config/manager/patches/image.yaml +++ b/config/manager/patches/image.yaml @@ -120,6 +120,10 @@ spec: value: cockroachdb/cockroach:v21.1.18 - name: RELATED_IMAGE_COCKROACH_v21_1_19 value: cockroachdb/cockroach:v21.1.19 + - name: RELATED_IMAGE_COCKROACH_v21_1_20 + value: cockroachdb/cockroach:v21.1.20 + - name: RELATED_IMAGE_COCKROACH_v21_1_21 + value: cockroachdb/cockroach:v21.1.21 - name: RELATED_IMAGE_COCKROACH_v21_2_0 value: cockroachdb/cockroach:v21.2.0 - name: RELATED_IMAGE_COCKROACH_v21_2_1 @@ -152,6 +156,8 @@ spec: value: cockroachdb/cockroach:v21.2.15 - name: RELATED_IMAGE_COCKROACH_v21_2_16 value: cockroachdb/cockroach:v21.2.16 + - name: RELATED_IMAGE_COCKROACH_v21_2_17 + value: cockroachdb/cockroach:v21.2.17 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: cockroachdb/cockroach:v22.1.0 - name: RELATED_IMAGE_COCKROACH_v22_1_1 @@ -168,3 +174,5 @@ spec: value: cockroachdb/cockroach:v22.1.7 - name: RELATED_IMAGE_COCKROACH_v22_1_8 value: cockroachdb/cockroach:v22.1.8 + - name: RELATED_IMAGE_COCKROACH_v22_1_9 + value: cockroachdb/cockroach:v22.1.9 diff --git a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml index ec20c2423..1ab687999 100644 --- a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml @@ -276,6 +276,10 @@ spec: image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:0ba090381ee0ccaee4037901bad191e2d7d02ae092361f00d5e8208f858cbd0c - name: RELATED_IMAGE_COCKROACH_v21_1_19 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:62db19fa1b5aadaf45d5ca9a685d24835bb9a5c97c9e35fcb7fdfd6a74bccd92 + - name: RELATED_IMAGE_COCKROACH_v21_1_20 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:b686952378cc6c8a7ab9e36940b6e5f3637fb7010368cefeba85bc55c3820bfd + - name: RELATED_IMAGE_COCKROACH_v21_1_21 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:d606b4a0f3dc942992fedc0e77ab8deaf3ee4967f11365178cca5148cf96734b - name: RELATED_IMAGE_COCKROACH_v21_2_0 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e5814748c5ab229a1dea5662a007063c0df06fbbfcfe041fd9a6df9ef67e07cc - name: RELATED_IMAGE_COCKROACH_v21_2_1 @@ -308,6 +312,8 @@ spec: image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:a6f1c43486d044fed9f59406118f429c8037b389bd8c8d7a1c7aeb89ed2661f7 - name: RELATED_IMAGE_COCKROACH_v21_2_16 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:08496b84b3cc691909227be17e67bcd6f4d5185a93712f44d8a0985bd2c5fcd7 + - name: RELATED_IMAGE_COCKROACH_v21_2_17 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:3b046aa0a42dae992a03685ed82a20835532d6d4bf048e2366ff7382be4b3138 - name: RELATED_IMAGE_COCKROACH_v22_1_0 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 - name: RELATED_IMAGE_COCKROACH_v22_1_1 @@ -324,3 +330,5 @@ spec: image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:da367cf0ac52045002e1c186f8e6964267ad87d5c25f9e72fd2c9b9a98a32702 - name: RELATED_IMAGE_COCKROACH_v22_1_8 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:f6bb15b36d64eebb6e4c1db5a5466e108b271d53383c58e0b6c78cec214756a9 + - name: RELATED_IMAGE_COCKROACH_v22_1_9 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:851144827007c2e6fc03bfb9b500294fe574b5007000bf2cea96a22881be8517 diff --git a/config/manifests/patches/deployment_patch.yaml b/config/manifests/patches/deployment_patch.yaml index aff245c26..b205ab0ac 100644 --- a/config/manifests/patches/deployment_patch.yaml +++ b/config/manifests/patches/deployment_patch.yaml @@ -129,6 +129,10 @@ spec: value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:0ba090381ee0ccaee4037901bad191e2d7d02ae092361f00d5e8208f858cbd0c - name: RELATED_IMAGE_COCKROACH_v21_1_19 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:62db19fa1b5aadaf45d5ca9a685d24835bb9a5c97c9e35fcb7fdfd6a74bccd92 + - name: RELATED_IMAGE_COCKROACH_v21_1_20 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:b686952378cc6c8a7ab9e36940b6e5f3637fb7010368cefeba85bc55c3820bfd + - name: RELATED_IMAGE_COCKROACH_v21_1_21 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:d606b4a0f3dc942992fedc0e77ab8deaf3ee4967f11365178cca5148cf96734b - name: RELATED_IMAGE_COCKROACH_v21_2_0 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e5814748c5ab229a1dea5662a007063c0df06fbbfcfe041fd9a6df9ef67e07cc - name: RELATED_IMAGE_COCKROACH_v21_2_1 @@ -161,6 +165,8 @@ spec: value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:a6f1c43486d044fed9f59406118f429c8037b389bd8c8d7a1c7aeb89ed2661f7 - name: RELATED_IMAGE_COCKROACH_v21_2_16 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:08496b84b3cc691909227be17e67bcd6f4d5185a93712f44d8a0985bd2c5fcd7 + - name: RELATED_IMAGE_COCKROACH_v21_2_17 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:3b046aa0a42dae992a03685ed82a20835532d6d4bf048e2366ff7382be4b3138 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 - name: RELATED_IMAGE_COCKROACH_v22_1_1 @@ -177,4 +183,6 @@ spec: value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:da367cf0ac52045002e1c186f8e6964267ad87d5c25f9e72fd2c9b9a98a32702 - name: RELATED_IMAGE_COCKROACH_v22_1_8 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:f6bb15b36d64eebb6e4c1db5a5466e108b271d53383c58e0b6c78cec214756a9 + - name: RELATED_IMAGE_COCKROACH_v22_1_9 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:851144827007c2e6fc03bfb9b500294fe574b5007000bf2cea96a22881be8517 image: RH_COCKROACH_OP_IMAGE_PLACEHOLDER diff --git a/config/samples/crdb-tls-example.yaml b/config/samples/crdb-tls-example.yaml index 770f5a761..1633008b1 100644 --- a/config/samples/crdb-tls-example.yaml +++ b/config/samples/crdb-tls-example.yaml @@ -19,7 +19,7 @@ kind: CrdbCluster metadata: name: crdb-tls-example spec: - cockroachDBVersion: v22.1.8 + cockroachDBVersion: v22.1.9 dataStore: pvc: spec: diff --git a/crdb-versions.yaml b/crdb-versions.yaml index 7774d26e7..8bcf1133e 100644 --- a/crdb-versions.yaml +++ b/crdb-versions.yaml @@ -163,6 +163,12 @@ CrdbVersions: - image: cockroachdb/cockroach:v21.1.19 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:62db19fa1b5aadaf45d5ca9a685d24835bb9a5c97c9e35fcb7fdfd6a74bccd92 tag: v21.1.19 +- image: cockroachdb/cockroach:v21.1.20 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:b686952378cc6c8a7ab9e36940b6e5f3637fb7010368cefeba85bc55c3820bfd + tag: v21.1.20 +- image: cockroachdb/cockroach:v21.1.21 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:d606b4a0f3dc942992fedc0e77ab8deaf3ee4967f11365178cca5148cf96734b + tag: v21.1.21 - image: cockroachdb/cockroach:v21.2.0 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e5814748c5ab229a1dea5662a007063c0df06fbbfcfe041fd9a6df9ef67e07cc tag: v21.2.0 @@ -211,6 +217,9 @@ CrdbVersions: - image: cockroachdb/cockroach:v21.2.16 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:08496b84b3cc691909227be17e67bcd6f4d5185a93712f44d8a0985bd2c5fcd7 tag: v21.2.16 +- image: cockroachdb/cockroach:v21.2.17 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:3b046aa0a42dae992a03685ed82a20835532d6d4bf048e2366ff7382be4b3138 + tag: v21.2.17 - image: cockroachdb/cockroach:v22.1.0 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:5a54d564e08baefc2786f4b742b2507d31984664cd00333406aa7a3aa5b9c913 tag: v22.1.0 @@ -235,3 +244,6 @@ CrdbVersions: - image: cockroachdb/cockroach:v22.1.8 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:f6bb15b36d64eebb6e4c1db5a5466e108b271d53383c58e0b6c78cec214756a9 tag: v22.1.8 +- image: cockroachdb/cockroach:v22.1.9 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:851144827007c2e6fc03bfb9b500294fe574b5007000bf2cea96a22881be8517 + tag: v22.1.9 diff --git a/examples/client-secure-operator.yaml b/examples/client-secure-operator.yaml index 618d30ce6..98db0bcb9 100644 --- a/examples/client-secure-operator.yaml +++ b/examples/client-secure-operator.yaml @@ -23,7 +23,7 @@ spec: serviceAccountName: cockroachdb-sa containers: - name: cockroachdb-client-secure - image: cockroachdb/cockroach:v22.1.8 + image: cockroachdb/cockroach:v22.1.9 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/examples/example.yaml b/examples/example.yaml index e51c4a142..e31e43dee 100644 --- a/examples/example.yaml +++ b/examples/example.yaml @@ -40,9 +40,9 @@ spec: memory: 8Gi tlsEnabled: true # You can set either a version of the db or a specific image name -# cockroachDBVersion: v22.1.8 +# cockroachDBVersion: v22.1.9 image: - name: cockroachdb/cockroach:v22.1.8 + name: cockroachdb/cockroach:v22.1.9 # nodes refers to the number of crdb pods that are created # via the statefulset nodes: 3 diff --git a/examples/smoketest.yaml b/examples/smoketest.yaml index 532c758eb..d8a048a56 100644 --- a/examples/smoketest.yaml +++ b/examples/smoketest.yaml @@ -39,5 +39,5 @@ spec: memory: 300Mi tlsEnabled: true image: - name: cockroachdb/cockroach:v22.1.8 + name: cockroachdb/cockroach:v22.1.9 nodes: 3 diff --git a/install/operator.yaml b/install/operator.yaml index b1a395eff..2420234f8 100644 --- a/install/operator.yaml +++ b/install/operator.yaml @@ -478,6 +478,10 @@ spec: value: cockroachdb/cockroach:v21.1.18 - name: RELATED_IMAGE_COCKROACH_v21_1_19 value: cockroachdb/cockroach:v21.1.19 + - name: RELATED_IMAGE_COCKROACH_v21_1_20 + value: cockroachdb/cockroach:v21.1.20 + - name: RELATED_IMAGE_COCKROACH_v21_1_21 + value: cockroachdb/cockroach:v21.1.21 - name: RELATED_IMAGE_COCKROACH_v21_2_0 value: cockroachdb/cockroach:v21.2.0 - name: RELATED_IMAGE_COCKROACH_v21_2_1 @@ -510,6 +514,8 @@ spec: value: cockroachdb/cockroach:v21.2.15 - name: RELATED_IMAGE_COCKROACH_v21_2_16 value: cockroachdb/cockroach:v21.2.16 + - name: RELATED_IMAGE_COCKROACH_v21_2_17 + value: cockroachdb/cockroach:v21.2.17 - name: RELATED_IMAGE_COCKROACH_v22_1_0 value: cockroachdb/cockroach:v22.1.0 - name: RELATED_IMAGE_COCKROACH_v22_1_1 @@ -526,6 +532,8 @@ spec: value: cockroachdb/cockroach:v22.1.7 - name: RELATED_IMAGE_COCKROACH_v22_1_8 value: cockroachdb/cockroach:v22.1.8 + - name: RELATED_IMAGE_COCKROACH_v22_1_9 + value: cockroachdb/cockroach:v22.1.9 - name: OPERATOR_NAME value: cockroachdb - name: POD_NAME From 6cde78a2ded7ae12a8e7825bdd1e7a169d7605a2 Mon Sep 17 00:00:00 2001 From: David Muto Date: Thu, 15 Dec 2022 15:46:58 -0500 Subject: [PATCH 19/51] Bump golangci-lint to v1.50.1 and update code as necessary (#944) * Bump golangci-lint to v1.50.1 and update code as necessary Making tests on master pass. * Update templates with new versions --- cmd/cockroach-operator/prep_webhooks.go | 5 ++--- config/manager/patches/image.yaml | 10 ++++++++-- ...kroach-operator.clusterserviceversion.yaml | 10 ++++++++-- .../manifests/patches/deployment_patch.yaml | 10 ++++++++-- config/samples/crdb-tls-example.yaml | 2 +- crdb-versions.yaml | 15 +++++++++++--- e2e/kubetest2-openshift/deployer/up.go | 5 ++--- e2e/openshift/openshift_packaging_test.go | 3 +-- examples/client-secure-operator.yaml | 2 +- examples/example.yaml | 4 ++-- examples/smoketest.yaml | 2 +- hack/bin/deps.bzl | 18 ++++++++--------- hack/crdbversions/main.go | 5 ++--- hack/release/main.go | 3 +-- hack/release/steps.go | 5 ++--- hack/release/steps_test.go | 5 ++--- hack/update_crdb_versions/main.go | 3 +-- install/operator.yaml | 10 ++++++++-- pkg/actor/generate_cert.go | 20 +++++++++---------- pkg/actor/partitioned_update_test.go | 3 +-- pkg/kube/dialer.go | 4 ++-- pkg/kuberecord/recorder.go | 6 +++--- pkg/resource/statefulset_test.go | 4 ++-- pkg/security/certs_test.go | 3 +-- pkg/testutil/assert.go | 5 ++--- pkg/testutil/helpers.go | 6 +++--- pkg/testutil/validate_headers.go | 3 +-- pkg/testutil/validate_headers_test.go | 6 ++---- pkg/util/tmp_dir.go | 3 +-- 29 files changed, 99 insertions(+), 81 deletions(-) diff --git a/cmd/cockroach-operator/prep_webhooks.go b/cmd/cockroach-operator/prep_webhooks.go index 3ff0e633b..62823626b 100644 --- a/cmd/cockroach-operator/prep_webhooks.go +++ b/cmd/cockroach-operator/prep_webhooks.go @@ -18,7 +18,6 @@ package main import ( "context" - "io/ioutil" "os" "path/filepath" @@ -84,12 +83,12 @@ func writeWebhookSecrets(cert security.Certificate, dir string) error { // r/w for current user only mode := os.FileMode(0600) - if err := ioutil.WriteFile(filepath.Join(dir, "tls.crt"), cert.Certificate(), mode); err != nil { + if err := os.WriteFile(filepath.Join(dir, "tls.crt"), cert.Certificate(), mode); err != nil { return errors.Wrap(err, "failed to write TLS certificate") } return errors.Wrap( - ioutil.WriteFile(filepath.Join(dir, "tls.key"), cert.PrivateKey(), mode), + os.WriteFile(filepath.Join(dir, "tls.key"), cert.PrivateKey(), mode), "failed to write TLS private key", ) } diff --git a/config/manager/patches/image.yaml b/config/manager/patches/image.yaml index 244bb06df..9a3fd89e2 100644 --- a/config/manager/patches/image.yaml +++ b/config/manager/patches/image.yaml @@ -174,5 +174,11 @@ spec: value: cockroachdb/cockroach:v22.1.7 - name: RELATED_IMAGE_COCKROACH_v22_1_8 value: cockroachdb/cockroach:v22.1.8 - - name: RELATED_IMAGE_COCKROACH_v22_1_9 - value: cockroachdb/cockroach:v22.1.9 + - name: RELATED_IMAGE_COCKROACH_v22_1_10 + value: cockroachdb/cockroach:v22.1.10 + - name: RELATED_IMAGE_COCKROACH_v22_1_11 + value: cockroachdb/cockroach:v22.1.11 + - name: RELATED_IMAGE_COCKROACH_v22_1_12 + value: cockroachdb/cockroach:v22.1.12 + - name: RELATED_IMAGE_COCKROACH_v22_2_0 + value: cockroachdb/cockroach:v22.2.0 diff --git a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml index 1ab687999..57130d22d 100644 --- a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml @@ -330,5 +330,11 @@ spec: image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:da367cf0ac52045002e1c186f8e6964267ad87d5c25f9e72fd2c9b9a98a32702 - name: RELATED_IMAGE_COCKROACH_v22_1_8 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:f6bb15b36d64eebb6e4c1db5a5466e108b271d53383c58e0b6c78cec214756a9 - - name: RELATED_IMAGE_COCKROACH_v22_1_9 - image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:851144827007c2e6fc03bfb9b500294fe574b5007000bf2cea96a22881be8517 + - name: RELATED_IMAGE_COCKROACH_v22_1_10 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:ec6eb7c28c213cc83b2d7919cd87988f9a07f12276eb7351d0915f1567a5b095 + - name: RELATED_IMAGE_COCKROACH_v22_1_11 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:f5a0ccc02dc9e938e484d5b5282ff650d1890d5f754c30a0c0d717989ed5d600 + - name: RELATED_IMAGE_COCKROACH_v22_1_12 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:310310515625f099a928545865f7096997871ee4a16650a01c76c3799a18b684 + - name: RELATED_IMAGE_COCKROACH_v22_2_0 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e50aab39722af22ccbf3d1db19e37972d52b0fc9a40998a64618dc966b2bac57 diff --git a/config/manifests/patches/deployment_patch.yaml b/config/manifests/patches/deployment_patch.yaml index b205ab0ac..6cfb4f046 100644 --- a/config/manifests/patches/deployment_patch.yaml +++ b/config/manifests/patches/deployment_patch.yaml @@ -183,6 +183,12 @@ spec: value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:da367cf0ac52045002e1c186f8e6964267ad87d5c25f9e72fd2c9b9a98a32702 - name: RELATED_IMAGE_COCKROACH_v22_1_8 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:f6bb15b36d64eebb6e4c1db5a5466e108b271d53383c58e0b6c78cec214756a9 - - name: RELATED_IMAGE_COCKROACH_v22_1_9 - value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:851144827007c2e6fc03bfb9b500294fe574b5007000bf2cea96a22881be8517 + - name: RELATED_IMAGE_COCKROACH_v22_1_10 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:ec6eb7c28c213cc83b2d7919cd87988f9a07f12276eb7351d0915f1567a5b095 + - name: RELATED_IMAGE_COCKROACH_v22_1_11 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:f5a0ccc02dc9e938e484d5b5282ff650d1890d5f754c30a0c0d717989ed5d600 + - name: RELATED_IMAGE_COCKROACH_v22_1_12 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:310310515625f099a928545865f7096997871ee4a16650a01c76c3799a18b684 + - name: RELATED_IMAGE_COCKROACH_v22_2_0 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e50aab39722af22ccbf3d1db19e37972d52b0fc9a40998a64618dc966b2bac57 image: RH_COCKROACH_OP_IMAGE_PLACEHOLDER diff --git a/config/samples/crdb-tls-example.yaml b/config/samples/crdb-tls-example.yaml index 1633008b1..a08c1d883 100644 --- a/config/samples/crdb-tls-example.yaml +++ b/config/samples/crdb-tls-example.yaml @@ -19,7 +19,7 @@ kind: CrdbCluster metadata: name: crdb-tls-example spec: - cockroachDBVersion: v22.1.9 + cockroachDBVersion: v22.2.0 dataStore: pvc: spec: diff --git a/crdb-versions.yaml b/crdb-versions.yaml index 8bcf1133e..665e91ce0 100644 --- a/crdb-versions.yaml +++ b/crdb-versions.yaml @@ -244,6 +244,15 @@ CrdbVersions: - image: cockroachdb/cockroach:v22.1.8 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:f6bb15b36d64eebb6e4c1db5a5466e108b271d53383c58e0b6c78cec214756a9 tag: v22.1.8 -- image: cockroachdb/cockroach:v22.1.9 - redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:851144827007c2e6fc03bfb9b500294fe574b5007000bf2cea96a22881be8517 - tag: v22.1.9 +- image: cockroachdb/cockroach:v22.1.10 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:ec6eb7c28c213cc83b2d7919cd87988f9a07f12276eb7351d0915f1567a5b095 + tag: v22.1.10 +- image: cockroachdb/cockroach:v22.1.11 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:f5a0ccc02dc9e938e484d5b5282ff650d1890d5f754c30a0c0d717989ed5d600 + tag: v22.1.11 +- image: cockroachdb/cockroach:v22.1.12 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:310310515625f099a928545865f7096997871ee4a16650a01c76c3799a18b684 + tag: v22.1.12 +- image: cockroachdb/cockroach:v22.2.0 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e50aab39722af22ccbf3d1db19e37972d52b0fc9a40998a64618dc966b2bac57 + tag: v22.2.0 diff --git a/e2e/kubetest2-openshift/deployer/up.go b/e2e/kubetest2-openshift/deployer/up.go index 1ef041ae9..75f428832 100644 --- a/e2e/kubetest2-openshift/deployer/up.go +++ b/e2e/kubetest2-openshift/deployer/up.go @@ -19,7 +19,6 @@ package deployer import ( "errors" "fmt" - "io/ioutil" "os" "path/filepath" @@ -82,7 +81,7 @@ func (d *deployer) Up() error { } } - pullSecretContent, err := ioutil.ReadFile(d.PullSecret) + pullSecretContent, err := os.ReadFile(d.PullSecret) if err != nil { klog.Fatalf("unable to read pull secret file '%s': %v", d.PullSecret, err) return err @@ -110,7 +109,7 @@ func (d *deployer) Up() error { installConfigFile := filepath.Join(baseDir, "install-config.yaml") - if err := ioutil.WriteFile(installConfigFile, b, 0644); err != nil { + if err := os.WriteFile(installConfigFile, b, 0644); err != nil { klog.Fatalf("unable to write openshift install file %v", err) return err } diff --git a/e2e/openshift/openshift_packaging_test.go b/e2e/openshift/openshift_packaging_test.go index 9f4de024b..bf8414f66 100644 --- a/e2e/openshift/openshift_packaging_test.go +++ b/e2e/openshift/openshift_packaging_test.go @@ -27,7 +27,6 @@ import ( "text/template" "time" - "io/ioutil" "os" "testing" @@ -248,7 +247,7 @@ func writeFile(t *testing.T, b []byte) string { fileName := fmt.Sprintf("%s-test.yaml", randSeq(10)) fileName = filepath.Join(t.TempDir(), fileName) - if err := ioutil.WriteFile(fileName, b, 0644); err != nil { + if err := os.WriteFile(fileName, b, 0644); err != nil { t.Fatal("Failed to write to temporary file", err) } diff --git a/examples/client-secure-operator.yaml b/examples/client-secure-operator.yaml index 98db0bcb9..f7f81c833 100644 --- a/examples/client-secure-operator.yaml +++ b/examples/client-secure-operator.yaml @@ -23,7 +23,7 @@ spec: serviceAccountName: cockroachdb-sa containers: - name: cockroachdb-client-secure - image: cockroachdb/cockroach:v22.1.9 + image: cockroachdb/cockroach:v22.2.0 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/examples/example.yaml b/examples/example.yaml index e31e43dee..90215e9ed 100644 --- a/examples/example.yaml +++ b/examples/example.yaml @@ -40,9 +40,9 @@ spec: memory: 8Gi tlsEnabled: true # You can set either a version of the db or a specific image name -# cockroachDBVersion: v22.1.9 +# cockroachDBVersion: v22.2.0 image: - name: cockroachdb/cockroach:v22.1.9 + name: cockroachdb/cockroach:v22.2.0 # nodes refers to the number of crdb pods that are created # via the statefulset nodes: 3 diff --git a/examples/smoketest.yaml b/examples/smoketest.yaml index d8a048a56..48150c172 100644 --- a/examples/smoketest.yaml +++ b/examples/smoketest.yaml @@ -39,5 +39,5 @@ spec: memory: 300Mi tlsEnabled: true image: - name: cockroachdb/cockroach:v22.1.9 + name: cockroachdb/cockroach:v22.2.0 nodes: 3 diff --git a/hack/bin/deps.bzl b/hack/bin/deps.bzl index 87d112b69..19b511d5a 100644 --- a/hack/bin/deps.bzl +++ b/hack/bin/deps.bzl @@ -199,14 +199,14 @@ def install_k3d(): def install_golangci_lint(): http_archive( name = "golangci_lint_darwin", - sha256 = "d4bd25b9814eeaa2134197dd2c7671bb791eae786d42010d9d788af20dee4bfa", - urls = ["https://github.com/golangci/golangci-lint/releases/download/v1.42.0/golangci-lint-1.42.0-darwin-amd64.tar.gz"], + sha256 = "0f615fb8c364f6e4a213f2ed2ff7aa1fc2b208addf29511e89c03534067bbf57", + urls = ["https://github.com/golangci/golangci-lint/releases/download/v1.50.1/golangci-lint-1.50.1-darwin-amd64.tar.gz"], build_file_content = """ filegroup( name = "file", srcs = [ - "golangci-lint-1.42.0-darwin-amd64/golangci-lint", + "golangci-lint-1.50.1-darwin-amd64/golangci-lint", ], visibility = ["//visibility:public"], ) @@ -215,14 +215,14 @@ filegroup( http_archive( name = "golangci_lint_m1", - sha256 = "f649893bf2b1d24b2632b5e109884a15f3bf25cfdad46b34fb8fd13a016098fd", - urls = ["https://github.com/golangci/golangci-lint/releases/download/v1.42.1/golangci-lint-1.42.1-darwin-arm64.tar.gz"], + sha256 = "0f615fb8c364f6e4a213f2ed2ff7aa1fc2b208addf29511e89c03534067bbf57", + urls = ["https://github.com/golangci/golangci-lint/releases/download/v1.50.1/golangci-lint-1.50.1-darwin-arm64.tar.gz"], build_file_content = """ filegroup( name = "file", srcs = [ - "golangci-lint-1.42.1-darwin-arm64/golangci-lint", + "golangci-lint-1.50.1-darwin-arm64/golangci-lint", ], visibility = ["//visibility:public"], ) @@ -231,14 +231,14 @@ filegroup( http_archive( name = "golangci_lint_linux", - sha256 = "6937f62f8e2329e94822dc11c10b871ace5557ae1fcc4ee2f9980cd6aecbc159", - urls = ["https://github.com/golangci/golangci-lint/releases/download/v1.42.0/golangci-lint-1.42.0-linux-amd64.tar.gz"], + sha256 = "4ba1dc9dbdf05b7bdc6f0e04bdfe6f63aa70576f51817be1b2540bbce017b69a", + urls = ["https://github.com/golangci/golangci-lint/releases/download/v1.50.1/golangci-lint-1.50.1-linux-amd64.tar.gz"], build_file_content = """ filegroup( name = "file", srcs = [ - "golangci-lint-1.42.0-linux-amd64/golangci-lint", + "golangci-lint-1.50.1-linux-amd64/golangci-lint", ], visibility = ["//visibility:public"], ) diff --git a/hack/crdbversions/main.go b/hack/crdbversions/main.go index e422e0f02..455facb60 100644 --- a/hack/crdbversions/main.go +++ b/hack/crdbversions/main.go @@ -24,7 +24,6 @@ import ( "flag" "fmt" "io" - "io/ioutil" "log" "os" "path/filepath" @@ -98,7 +97,7 @@ func main() { outputFile := filepath.Join(*repoRoot, f.output) log.Printf("generating `%s` from `%s`", outputFile, tplFile) name := filepath.Base(outputFile) - tplContents, err := ioutil.ReadFile(tplFile) + tplContents, err := os.ReadFile(tplFile) if err != nil { log.Fatalf("Cannot read template file `%s`: %s", tplFile, err) } @@ -170,7 +169,7 @@ func generateFile(name string, tplText string, output io.Writer, data templateDa // verifyYamlLoads tries to open a YAML file and parses its content in order to // verify that the generated file doesn't have any syntax errors func verifyYamlLoads(fName string) error { - contents, err := ioutil.ReadFile(fName) + contents, err := os.ReadFile(fName) if err != nil { return fmt.Errorf("cannot read file `%s`: %w", fName, err) } diff --git a/hack/release/main.go b/hack/release/main.go index 95ce04676..2a888e28b 100644 --- a/hack/release/main.go +++ b/hack/release/main.go @@ -18,7 +18,6 @@ package main import ( "flag" "fmt" - "io/ioutil" "os" "os/exec" @@ -40,7 +39,7 @@ func main() { EnsureUniqueVersion(func(cmd *exec.Cmd) error { return cmd.Run() }), CreateReleaseBranch(process.ExecJUnit), UpdateVersion(), - UpdateChangelog(ioutil.ReadFile), + UpdateChangelog(os.ReadFile), GenerateFiles(process.ExecJUnit), } diff --git a/hack/release/steps.go b/hack/release/steps.go index cf2eb9281..e8cbec88e 100644 --- a/hack/release/steps.go +++ b/hack/release/steps.go @@ -18,7 +18,6 @@ package main import ( "bytes" "fmt" - "io/ioutil" "os" "os/exec" "regexp" @@ -94,7 +93,7 @@ func EnsureUniqueVersion(fn CmdFn) Step { func UpdateVersion() Step { return StepFn(func(version string) error { // setting the mode to 0644 to match the existing permissions: r/w for current user, read-only for everyone else. - return ioutil.WriteFile("version.txt", []byte(version), 0644) + return os.WriteFile("version.txt", []byte(version), 0644) }) } @@ -149,6 +148,6 @@ func UpdateChangelog(fn FileFn) Step { newUnreleased = append(newUnreleased, append([]byte("\n\n"), latestRelease...)...) data = bytes.Replace(data, prevUnreleased, newUnreleased, 1) - return ioutil.WriteFile(fileName, data, 0644) + return os.WriteFile(fileName, data, 0644) }) } diff --git a/hack/release/steps_test.go b/hack/release/steps_test.go index 9d3e0a41e..02cbee878 100644 --- a/hack/release/steps_test.go +++ b/hack/release/steps_test.go @@ -18,7 +18,6 @@ package main_test import ( "fmt" "io" - "io/ioutil" "os" "os/exec" "testing" @@ -96,7 +95,7 @@ func TestEnsureUniqueVersion(t *testing.T) { func TestUpdateVersion(t *testing.T) { require.NoError(t, UpdateVersion().Apply("1.2.3")) - v, err := ioutil.ReadFile("version.txt") + v, err := os.ReadFile("version.txt") require.NoError(t, err) require.Equal(t, "1.2.3", string(v)) @@ -162,7 +161,7 @@ func TestUpdateChangelog(t *testing.T) { err := UpdateChangelog(func(_ string) ([]byte, error) { return []byte(input), nil }).Apply("1.1.0") require.NoError(t, err) - data, err := ioutil.ReadFile("CHANGELOG.md") + data, err := os.ReadFile("CHANGELOG.md") require.NoError(t, err) require.Equal(t, string(data), expected) } diff --git a/hack/update_crdb_versions/main.go b/hack/update_crdb_versions/main.go index e4db154d9..3ca197289 100644 --- a/hack/update_crdb_versions/main.go +++ b/hack/update_crdb_versions/main.go @@ -20,7 +20,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "os" "path/filepath" @@ -68,7 +67,7 @@ var ( func main() { path := filepath.Join(os.Getenv("BUILD_WORKSPACE_DIRECTORY"), versionsFile) - if err := ioutil.WriteFile(path, []byte(fileHeader), 0644); err != nil { + if err := os.WriteFile(path, []byte(fileHeader), 0644); err != nil { panic(err) } diff --git a/install/operator.yaml b/install/operator.yaml index 2420234f8..60b0bee17 100644 --- a/install/operator.yaml +++ b/install/operator.yaml @@ -532,8 +532,14 @@ spec: value: cockroachdb/cockroach:v22.1.7 - name: RELATED_IMAGE_COCKROACH_v22_1_8 value: cockroachdb/cockroach:v22.1.8 - - name: RELATED_IMAGE_COCKROACH_v22_1_9 - value: cockroachdb/cockroach:v22.1.9 + - name: RELATED_IMAGE_COCKROACH_v22_1_10 + value: cockroachdb/cockroach:v22.1.10 + - name: RELATED_IMAGE_COCKROACH_v22_1_11 + value: cockroachdb/cockroach:v22.1.11 + - name: RELATED_IMAGE_COCKROACH_v22_1_12 + value: cockroachdb/cockroach:v22.1.12 + - name: RELATED_IMAGE_COCKROACH_v22_2_0 + value: cockroachdb/cockroach:v22.2.0 - name: OPERATOR_NAME value: cockroachdb - name: POD_NAME diff --git a/pkg/actor/generate_cert.go b/pkg/actor/generate_cert.go index 138cbfb57..81cbf709d 100644 --- a/pkg/actor/generate_cert.go +++ b/pkg/actor/generate_cert.go @@ -21,7 +21,7 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "io/ioutil" + "os" "path/filepath" "time" @@ -191,7 +191,7 @@ func (rc *generateCert) generateCA(ctx context.Context, log logr.Logger, cluster // if the secret is ready then don't update the secret // the Actor should have already generated the secret if secret.ReadyCA() { - if err := ioutil.WriteFile(rc.CAKey, secret.CAKey(), 0600); err != nil { + if err := os.WriteFile(rc.CAKey, secret.CAKey(), 0600); err != nil { return errors.Wrap(err, "failed to write CA key") } log.V(DEBUGLEVEL).Info("not updating ca key as it exists") @@ -210,7 +210,7 @@ func (rc *generateCert) generateCA(ctx context.Context, log logr.Logger, cluster return err } // Read the ca key into memory - cakey, err := ioutil.ReadFile(rc.CAKey) + cakey, err := os.ReadFile(rc.CAKey) if err != nil { return errors.Wrap(err, "unable to read ca.key") } @@ -259,7 +259,7 @@ func (rc *generateCert) generateNodeCert(ctx context.Context, log logr.Logger, c if secret.Ready() { if regenerateCert { log.V(DEBUGLEVEL).Info("regenerating node certificate because of change in SQLHost") - if err = ioutil.WriteFile(filepath.Join(rc.CertsDir, "ca.crt"), secret.CA(), 0644); err != nil { + if err = os.WriteFile(filepath.Join(rc.CertsDir, "ca.crt"), secret.CA(), 0644); err != nil { return "", errors.Wrap(err, "failed to write CA cert") } } else { @@ -300,17 +300,17 @@ func (rc *generateCert) generateNodeCert(ctx context.Context, log logr.Logger, c } // Read the node certificates into memory - ca, err := ioutil.ReadFile(filepath.Join(rc.CertsDir, "ca.crt")) + ca, err := os.ReadFile(filepath.Join(rc.CertsDir, "ca.crt")) if err != nil { return "", errors.Wrap(err, "unable to read ca.crt") } - pemCert, err := ioutil.ReadFile(filepath.Join(rc.CertsDir, "node.crt")) + pemCert, err := os.ReadFile(filepath.Join(rc.CertsDir, "node.crt")) if err != nil { return "", errors.Wrap(err, "unable to read node.crt") } - pemKey, err := ioutil.ReadFile(filepath.Join(rc.CertsDir, "node.key")) + pemKey, err := os.ReadFile(filepath.Join(rc.CertsDir, "node.key")) if err != nil { return "", errors.Wrap(err, "unable to ready node.key") } @@ -368,17 +368,17 @@ func (rc *generateCert) generateClientCert(ctx context.Context, log logr.Logger, } // Load the certificates into memory - ca, err := ioutil.ReadFile(filepath.Join(rc.CertsDir, "ca.crt")) + ca, err := os.ReadFile(filepath.Join(rc.CertsDir, "ca.crt")) if err != nil { return errors.Wrap(err, "unable to read ca.crt") } - pemCert, err := ioutil.ReadFile(filepath.Join(rc.CertsDir, "client.root.crt")) + pemCert, err := os.ReadFile(filepath.Join(rc.CertsDir, "client.root.crt")) if err != nil { return errors.Wrap(err, "unable to read client.root.crt") } - pemKey, err := ioutil.ReadFile(filepath.Join(rc.CertsDir, "client.root.key")) + pemKey, err := os.ReadFile(filepath.Join(rc.CertsDir, "client.root.key")) if err != nil { return errors.Wrap(err, "unable to read client.root.key") } diff --git a/pkg/actor/partitioned_update_test.go b/pkg/actor/partitioned_update_test.go index 5e4779100..8a3067845 100644 --- a/pkg/actor/partitioned_update_test.go +++ b/pkg/actor/partitioned_update_test.go @@ -17,7 +17,6 @@ limitations under the License. package actor import ( - "io/ioutil" "os" "testing" @@ -31,7 +30,7 @@ func TestDeployedInCluster(t *testing.T) { t.Fatal("we should not be running inside of k8s") } - file, err := ioutil.TempFile("/tmp", "foo") + file, err := os.CreateTemp("/tmp", "foo") if err != nil { t.Fatal(err) } diff --git a/pkg/kube/dialer.go b/pkg/kube/dialer.go index c7fdce8e5..dc785f05b 100644 --- a/pkg/kube/dialer.go +++ b/pkg/kube/dialer.go @@ -20,7 +20,7 @@ import ( "context" "errors" "fmt" - "io/ioutil" + "io" "net" "net/http" "strings" @@ -160,7 +160,7 @@ func (k *PodDialer) Dial(network, addr string) (net.Conn, error) { errorChan := make(chan error) go func() { - message, err := ioutil.ReadAll(errStream) + message, err := io.ReadAll(errStream) if err != nil { errorChan <- err } diff --git a/pkg/kuberecord/recorder.go b/pkg/kuberecord/recorder.go index f4b0980b2..6ca9c455c 100644 --- a/pkg/kuberecord/recorder.go +++ b/pkg/kuberecord/recorder.go @@ -22,7 +22,7 @@ import ( "bytes" "crypto/sha1" "fmt" - "io/ioutil" + "io" "net/http" "path/filepath" "sync" @@ -184,13 +184,13 @@ func (f *kubeRecorder) RoundTrip(r *http.Request) (*http.Response, error) { var err error if r.Body != nil { - body, err = ioutil.ReadAll(r.Body) + body, err = io.ReadAll(r.Body) if err != nil { return nil, err } // Reset the body to something usable - r.Body = ioutil.NopCloser(bytes.NewBuffer(body)) + r.Body = io.NopCloser(bytes.NewBuffer(body)) if _, err := hasher.Write(body); err != nil { // "It never returns an error." diff --git a/pkg/resource/statefulset_test.go b/pkg/resource/statefulset_test.go index 87d44087f..c41f3c690 100644 --- a/pkg/resource/statefulset_test.go +++ b/pkg/resource/statefulset_test.go @@ -20,7 +20,7 @@ import ( "bytes" "flag" "fmt" - "io/ioutil" + "os" "path/filepath" api "github.com/cockroachdb/cockroach-operator/apis/v1alpha1" @@ -111,7 +111,7 @@ func TestRHImage(t *testing.T) { } func load(t *testing.T, file string) []byte { - content, err := ioutil.ReadFile(file) + content, err := os.ReadFile(file) if err != nil { t.Fatalf("failed to load yaml file %s: %v", file, err) } diff --git a/pkg/security/certs_test.go b/pkg/security/certs_test.go index d091642af..47cd3fad1 100644 --- a/pkg/security/certs_test.go +++ b/pkg/security/certs_test.go @@ -17,7 +17,6 @@ limitations under the License. package security_test import ( - "io/ioutil" "os" "path/filepath" "testing" @@ -38,7 +37,7 @@ func TestMain(m *testing.M) { // tempDir is like testutils.TempDir but avoids a circular import. func tempDir(t *testing.T) (string, func()) { - certsDir, err := ioutil.TempDir("", "certs_test") + certsDir, err := os.MkdirTemp("", "certs_test") if err != nil { t.Fatal(err) } diff --git a/pkg/testutil/assert.go b/pkg/testutil/assert.go index 979291361..c9d50735d 100644 --- a/pkg/testutil/assert.go +++ b/pkg/testutil/assert.go @@ -31,11 +31,10 @@ import ( // and fails if the two interfaces do not match. // This func removes all metadata calico annotations. func AssertDiff(t *testing.T, expected interface{}, actual interface{}) { - - if actual, ok := actual.(string); ok { + if casted, ok := actual.(string); ok { decode, encode := Yamlizers(t, InitScheme(t)) var newSlice []string - actualSlice := strings.Split(actual, "---") + actualSlice := strings.Split(casted, "---") for _, str := range actualSlice { // we are getting zero length string because the string starts with --- diff --git a/pkg/testutil/helpers.go b/pkg/testutil/helpers.go index 3ab3415e7..2bfacdfb8 100644 --- a/pkg/testutil/helpers.go +++ b/pkg/testutil/helpers.go @@ -18,7 +18,7 @@ package testutil import ( "io" - "io/ioutil" + "os" "path/filepath" "testing" @@ -47,12 +47,12 @@ func ReadOrUpdateGoldenFile(t *testing.T, content string, update bool) string { gf := filepath.Join("testdata", filepath.FromSlash(t.Name())+".golden") if update { - if err := ioutil.WriteFile(gf, []byte(content), 0644); err != nil { + if err := os.WriteFile(gf, []byte(content), 0644); err != nil { t.Fatalf("failed to update golden file %s: %v", gf, err) } } - g, err := ioutil.ReadFile(gf) + g, err := os.ReadFile(gf) if err != nil { t.Fatalf("failed to read goldenfile %s: %v", gf, err) } diff --git a/pkg/testutil/validate_headers.go b/pkg/testutil/validate_headers.go index 7662b0c0e..fb1184ae7 100644 --- a/pkg/testutil/validate_headers.go +++ b/pkg/testutil/validate_headers.go @@ -20,7 +20,6 @@ import ( "bufio" "errors" "fmt" - "io/ioutil" "os" "path" "path/filepath" @@ -165,7 +164,7 @@ func (v ValidateHeaders) readGlob(glob string, regex *regexp.Regexp) (filesPtr * } func (v ValidateHeaders) hasValidHeader(filename string) (bool, error) { - content, err := ioutil.ReadFile(filename) + content, err := os.ReadFile(filename) if err != nil { return false, err } diff --git a/pkg/testutil/validate_headers_test.go b/pkg/testutil/validate_headers_test.go index 80922443d..5c2abe1dc 100644 --- a/pkg/testutil/validate_headers_test.go +++ b/pkg/testutil/validate_headers_test.go @@ -17,7 +17,6 @@ limitations under the License. package testutil_test import ( - "io/ioutil" "os" "path" "path/filepath" @@ -84,12 +83,11 @@ package testutil func writeFile(data string, dir string, fileName string) error { content := []byte(data) tmpfn := filepath.Join(dir, fileName) - return ioutil.WriteFile(tmpfn, content, 0666) + return os.WriteFile(tmpfn, content, 0666) } func TestValidate(t *testing.T) { - - dir, err := ioutil.TempDir("", "validate-headers-test") + dir, err := os.MkdirTemp("", "validate-headers-test") if err != nil { t.Fatal(err) } diff --git a/pkg/util/tmp_dir.go b/pkg/util/tmp_dir.go index 19b94083c..e82fc403d 100644 --- a/pkg/util/tmp_dir.go +++ b/pkg/util/tmp_dir.go @@ -17,7 +17,6 @@ limitations under the License. package util import ( - "io/ioutil" "os" ) @@ -25,7 +24,7 @@ import ( // the directory name and also a function for removing the directory. // The funcation is often deferred for directory removal. func CreateTempDir(baseDirectory string) (string, func()) { - tmpDir, err := ioutil.TempDir("", baseDirectory) + tmpDir, err := os.MkdirTemp("", baseDirectory) if err != nil { panic(err) } From 91d60ede77de607c523fa28200c4d4afe7ee9cd8 Mon Sep 17 00:00:00 2001 From: David Muto Date: Fri, 16 Dec 2022 10:22:17 -0500 Subject: [PATCH 20/51] [#906] Use FQDN for service address when updating/decommissioning (#943) When running the cluster and operator in separate namespaces there's an issue when attempting to connect to the database (from the operator). This is specific to decommissioning and running a partitioned update. As is the code tries to connect using the public service name (`-public`). To avoid the connection issues described in #906, I've updated this to use the FQDN of the service which is in the following format: `-public..`. This should make it possible to connect to the database regardless of which namespace it's in. --- CHANGELOG.md | 1 + pkg/actor/decommission.go | 2 +- pkg/actor/generate_cert.go | 2 +- pkg/actor/partitioned_update.go | 2 +- pkg/resource/cluster.go | 11 +++++++++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0341a45f0..a75381d77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Fixed * Install init container certs with 600 permissions +* Ensure operator can connect to DBs in all namespaces # [v2.8.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.7.0...v2.8.0) diff --git a/pkg/actor/decommission.go b/pkg/actor/decommission.go index 6b5cfe825..e9a70d54d 100644 --- a/pkg/actor/decommission.go +++ b/pkg/actor/decommission.go @@ -83,7 +83,7 @@ func (d decommission) Act(ctx context.Context, cluster *resource.Cluster, log lo // If we are running inside of k8s we will not find this file. runningInsideK8s := inK8s("/var/run/secrets/kubernetes.io/serviceaccount/token") - serviceName := cluster.PublicServiceName() + serviceName := cluster.PublicServiceAddress() if runningInsideK8s { log.V(DEBUGLEVEL).Info("operator is running inside of kubernetes, connecting to service for db connection") } else { diff --git a/pkg/actor/generate_cert.go b/pkg/actor/generate_cert.go index 81cbf709d..77b13262d 100644 --- a/pkg/actor/generate_cert.go +++ b/pkg/actor/generate_cert.go @@ -275,7 +275,7 @@ func (rc *generateCert) generateNodeCert(ctx context.Context, log logr.Logger, c "127.0.0.1", cluster.PublicServiceName(), fmt.Sprintf("%s.%s", cluster.PublicServiceName(), cluster.Namespace()), - fmt.Sprintf("%s.%s.%s", cluster.PublicServiceName(), cluster.Namespace(), cluster.Domain()), + cluster.PublicServiceAddress(), fmt.Sprintf("*.%s", cluster.DiscoveryServiceName()), fmt.Sprintf("*.%s.%s", cluster.DiscoveryServiceName(), cluster.Namespace()), fmt.Sprintf("*.%s.%s.%s", cluster.DiscoveryServiceName(), cluster.Namespace(), cluster.Domain()), diff --git a/pkg/actor/partitioned_update.go b/pkg/actor/partitioned_update.go index b01ab75fb..76feac964 100644 --- a/pkg/actor/partitioned_update.go +++ b/pkg/actor/partitioned_update.go @@ -130,7 +130,7 @@ func (up *partitionedUpdate) Act(ctx context.Context, cluster *resource.Cluster, // If we are running inside of k8s we will not find this file. runningInsideK8s := inK8s("/var/run/secrets/kubernetes.io/serviceaccount/token") - serviceName := cluster.PublicServiceName() + serviceName := cluster.PublicServiceAddress() if runningInsideK8s { log.V(DEBUGLEVEL).Info("operator is running inside of kubernetes, connecting to service for db connection") } else { diff --git a/pkg/resource/cluster.go b/pkg/resource/cluster.go index 8a5f6c263..a15608dc3 100644 --- a/pkg/resource/cluster.go +++ b/pkg/resource/cluster.go @@ -162,6 +162,17 @@ func (cluster Cluster) PublicServiceName() string { return fmt.Sprintf("%s-public", cluster.Name()) } +// PublicServiceAddress is the FQDN of the public service. +// E.g. -public.namespace.svc.cluster.local +func (cluster Cluster) PublicServiceAddress() string { + return fmt.Sprintf( + "%s.%s.%s", + cluster.PublicServiceName(), + cluster.Namespace(), + cluster.Domain(), + ) +} + func (cluster Cluster) ServiceAccountName() string { return fmt.Sprintf("%s-sa", cluster.Name()) } From 54d6fcdd7eeec7147c1be026ffc9c5d8e10050e9 Mon Sep 17 00:00:00 2001 From: David Muto Date: Fri, 16 Dec 2022 10:34:02 -0500 Subject: [PATCH 21/51] Bump version to 2.9.0 (#945) --- CHANGELOG.md | 4 +++- config/manager/patches/image.yaml | 2 +- install/operator.yaml | 2 +- version.txt | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a75381d77..c1695af18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -# [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.8.0...master) +# [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.9.0...master) + +# [v2.9.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.8.0...v2.9.0) ## Fixed diff --git a/config/manager/patches/image.yaml b/config/manager/patches/image.yaml index 9a3fd89e2..d3c0595d8 100644 --- a/config/manager/patches/image.yaml +++ b/config/manager/patches/image.yaml @@ -24,7 +24,7 @@ spec: spec: containers: - name: cockroach-operator - image: cockroachdb/cockroach-operator:v2.8.0 + image: cockroachdb/cockroach-operator:v2.9.0 env: - name: RELATED_IMAGE_COCKROACH_v20_1_4 value: cockroachdb/cockroach:v20.1.4 diff --git a/install/operator.yaml b/install/operator.yaml index 60b0bee17..d45f218db 100644 --- a/install/operator.yaml +++ b/install/operator.yaml @@ -550,7 +550,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - image: cockroachdb/cockroach-operator:v2.8.0 + image: cockroachdb/cockroach-operator:v2.9.0 imagePullPolicy: IfNotPresent name: cockroach-operator resources: diff --git a/version.txt b/version.txt index 6533b6687..f3ac133c5 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.8.0 \ No newline at end of file +2.9.0 \ No newline at end of file From 22632abd7c5ca1c3b881d862c0567f9c41753c84 Mon Sep 17 00:00:00 2001 From: Rail Aliiev Date: Tue, 3 Jan 2023 08:18:59 -0500 Subject: [PATCH 22/51] Pin Bazel version to 5.4.0 (#947) * Pin Bazel version to 5.4.0 GitHub runners used in CI use Bazelisk to install Bazel and by default it fetches the latest version. Bazel 6.0.0 was released a few days ago with some changes that brake the build. This PR pins the Bazel version used by GitHub runners. * Update templates --- .bazeliskrc | 1 + config/manager/patches/image.yaml | 2 ++ .../bases/cockroach-operator.clusterserviceversion.yaml | 2 ++ config/manifests/patches/deployment_patch.yaml | 2 ++ config/samples/crdb-tls-example.yaml | 2 +- crdb-versions.yaml | 3 +++ examples/client-secure-operator.yaml | 2 +- examples/example.yaml | 4 ++-- examples/smoketest.yaml | 2 +- install/operator.yaml | 2 ++ 10 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 .bazeliskrc diff --git a/.bazeliskrc b/.bazeliskrc new file mode 100644 index 000000000..f5f1a08e9 --- /dev/null +++ b/.bazeliskrc @@ -0,0 +1 @@ +USE_BAZEL_VERSION=5.4.0 diff --git a/config/manager/patches/image.yaml b/config/manager/patches/image.yaml index d3c0595d8..9baac7c9f 100644 --- a/config/manager/patches/image.yaml +++ b/config/manager/patches/image.yaml @@ -182,3 +182,5 @@ spec: value: cockroachdb/cockroach:v22.1.12 - name: RELATED_IMAGE_COCKROACH_v22_2_0 value: cockroachdb/cockroach:v22.2.0 + - name: RELATED_IMAGE_COCKROACH_v22_2_1 + value: cockroachdb/cockroach:v22.2.1 diff --git a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml index 57130d22d..8e69830f1 100644 --- a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml @@ -338,3 +338,5 @@ spec: image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:310310515625f099a928545865f7096997871ee4a16650a01c76c3799a18b684 - name: RELATED_IMAGE_COCKROACH_v22_2_0 image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e50aab39722af22ccbf3d1db19e37972d52b0fc9a40998a64618dc966b2bac57 + - name: RELATED_IMAGE_COCKROACH_v22_2_1 + image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:db4e5c2f27ba23e95a363c8174c01f0f9c6b6a27e0e581c86a38f3a1f68dc43c diff --git a/config/manifests/patches/deployment_patch.yaml b/config/manifests/patches/deployment_patch.yaml index 6cfb4f046..3bd1e793f 100644 --- a/config/manifests/patches/deployment_patch.yaml +++ b/config/manifests/patches/deployment_patch.yaml @@ -191,4 +191,6 @@ spec: value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:310310515625f099a928545865f7096997871ee4a16650a01c76c3799a18b684 - name: RELATED_IMAGE_COCKROACH_v22_2_0 value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e50aab39722af22ccbf3d1db19e37972d52b0fc9a40998a64618dc966b2bac57 + - name: RELATED_IMAGE_COCKROACH_v22_2_1 + value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:db4e5c2f27ba23e95a363c8174c01f0f9c6b6a27e0e581c86a38f3a1f68dc43c image: RH_COCKROACH_OP_IMAGE_PLACEHOLDER diff --git a/config/samples/crdb-tls-example.yaml b/config/samples/crdb-tls-example.yaml index a08c1d883..fa237d159 100644 --- a/config/samples/crdb-tls-example.yaml +++ b/config/samples/crdb-tls-example.yaml @@ -19,7 +19,7 @@ kind: CrdbCluster metadata: name: crdb-tls-example spec: - cockroachDBVersion: v22.2.0 + cockroachDBVersion: v22.2.1 dataStore: pvc: spec: diff --git a/crdb-versions.yaml b/crdb-versions.yaml index 665e91ce0..b75c4d2ba 100644 --- a/crdb-versions.yaml +++ b/crdb-versions.yaml @@ -256,3 +256,6 @@ CrdbVersions: - image: cockroachdb/cockroach:v22.2.0 redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:e50aab39722af22ccbf3d1db19e37972d52b0fc9a40998a64618dc966b2bac57 tag: v22.2.0 +- image: cockroachdb/cockroach:v22.2.1 + redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:db4e5c2f27ba23e95a363c8174c01f0f9c6b6a27e0e581c86a38f3a1f68dc43c + tag: v22.2.1 diff --git a/examples/client-secure-operator.yaml b/examples/client-secure-operator.yaml index f7f81c833..6569ff05f 100644 --- a/examples/client-secure-operator.yaml +++ b/examples/client-secure-operator.yaml @@ -23,7 +23,7 @@ spec: serviceAccountName: cockroachdb-sa containers: - name: cockroachdb-client-secure - image: cockroachdb/cockroach:v22.2.0 + image: cockroachdb/cockroach:v22.2.1 imagePullPolicy: IfNotPresent volumeMounts: - name: client-certs diff --git a/examples/example.yaml b/examples/example.yaml index 90215e9ed..574f36cce 100644 --- a/examples/example.yaml +++ b/examples/example.yaml @@ -40,9 +40,9 @@ spec: memory: 8Gi tlsEnabled: true # You can set either a version of the db or a specific image name -# cockroachDBVersion: v22.2.0 +# cockroachDBVersion: v22.2.1 image: - name: cockroachdb/cockroach:v22.2.0 + name: cockroachdb/cockroach:v22.2.1 # nodes refers to the number of crdb pods that are created # via the statefulset nodes: 3 diff --git a/examples/smoketest.yaml b/examples/smoketest.yaml index 48150c172..ab97f3483 100644 --- a/examples/smoketest.yaml +++ b/examples/smoketest.yaml @@ -39,5 +39,5 @@ spec: memory: 300Mi tlsEnabled: true image: - name: cockroachdb/cockroach:v22.2.0 + name: cockroachdb/cockroach:v22.2.1 nodes: 3 diff --git a/install/operator.yaml b/install/operator.yaml index d45f218db..0aa857fae 100644 --- a/install/operator.yaml +++ b/install/operator.yaml @@ -540,6 +540,8 @@ spec: value: cockroachdb/cockroach:v22.1.12 - name: RELATED_IMAGE_COCKROACH_v22_2_0 value: cockroachdb/cockroach:v22.2.0 + - name: RELATED_IMAGE_COCKROACH_v22_2_1 + value: cockroachdb/cockroach:v22.2.1 - name: OPERATOR_NAME value: cockroachdb - name: POD_NAME From 07ac2c7ef8deff59ce15846c86e209476f1876cf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 3 Jan 2023 08:24:16 -0500 Subject: [PATCH 23/51] Update CRDB versions (#948) Co-authored-by: GitHub Actions --- config/manager/patches/image.yaml | 2 +- config/manifests/patches/deployment_patch.yaml | 2 +- config/samples/crdb-tls-example.yaml | 2 +- examples/client-secure-operator.yaml | 2 +- examples/example.yaml | 2 +- examples/smoketest.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/manager/patches/image.yaml b/config/manager/patches/image.yaml index 9baac7c9f..74e2965b8 100644 --- a/config/manager/patches/image.yaml +++ b/config/manager/patches/image.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/manifests/patches/deployment_patch.yaml b/config/manifests/patches/deployment_patch.yaml index 3bd1e793f..5892d96a4 100644 --- a/config/manifests/patches/deployment_patch.yaml +++ b/config/manifests/patches/deployment_patch.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/samples/crdb-tls-example.yaml b/config/samples/crdb-tls-example.yaml index fa237d159..498eed564 100644 --- a/config/samples/crdb-tls-example.yaml +++ b/config/samples/crdb-tls-example.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/examples/client-secure-operator.yaml b/examples/client-secure-operator.yaml index 6569ff05f..9eb9fba81 100644 --- a/examples/client-secure-operator.yaml +++ b/examples/client-secure-operator.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/examples/example.yaml b/examples/example.yaml index 574f36cce..e597ba0ec 100644 --- a/examples/example.yaml +++ b/examples/example.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/examples/smoketest.yaml b/examples/smoketest.yaml index ab97f3483..5e1d9850b 100644 --- a/examples/smoketest.yaml +++ b/examples/smoketest.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From c7ea8c17f2cce43506d50108449b9169323b44fe Mon Sep 17 00:00:00 2001 From: David Muto Date: Tue, 3 Jan 2023 09:55:33 -0500 Subject: [PATCH 24/51] Update Copyright Headers for 2023 (#949) Updating the headers in all files to reflect the new year. **How** ``` grep -RiIl 'Copyright 2022' | \ xargs sed -i 's/Copyright 2022/Copyright 2023/g' ``` --- .github/workflows/e2e-kind-create.yaml | 2 +- .github/workflows/e2e-kind-decommission.yaml | 2 +- .github/workflows/e2e-kind-upgrades.yaml | 2 +- .github/workflows/e2e-kind-upgradessha256.yaml | 2 +- .github/workflows/e2e-kind-versionchecker.yaml | 2 +- .github/workflows/nightly-smoketest.yaml | 2 +- .github/workflows/templates.yaml | 2 +- .github/workflows/tests.yaml | 2 +- .github/workflows/update-crdb-versions.yaml | 2 +- .golangci.yaml | 2 +- Makefile | 2 +- apis/v1alpha1/action_status.go | 2 +- apis/v1alpha1/action_types.go | 2 +- apis/v1alpha1/cluster_types.go | 2 +- apis/v1alpha1/cluster_types_test.go | 2 +- apis/v1alpha1/condition_types.go | 2 +- apis/v1alpha1/doc.go | 2 +- apis/v1alpha1/groupversion_info.go | 2 +- apis/v1alpha1/restart_types.go | 2 +- apis/v1alpha1/volume.go | 2 +- apis/v1alpha1/volume_test.go | 2 +- apis/v1alpha1/webhook.go | 2 +- apis/v1alpha1/webhook_test.go | 2 +- apis/v1alpha1/zz_generated.deepcopy.go | 2 +- build/release/teamcity-publish-openshift-bundle.sh | 2 +- build/release/teamcity-publish-openshift.sh | 2 +- build/release/teamcity-publish-release.sh | 2 +- build/release/teamcity-support.sh | 2 +- cmd/cockroach-operator/main.go | 2 +- cmd/cockroach-operator/prep_webhooks.go | 2 +- config/crd/bases/crdb.cockroachlabs.com_crdbclusters.yaml | 2 +- config/crd/kustomization.yaml | 2 +- config/default/kustomization.yaml | 2 +- config/default/namespace.yaml | 2 +- config/manager/deployment.yaml | 2 +- config/manager/kustomization.yaml | 2 +- .../bases/cockroach-operator.clusterserviceversion.yaml | 2 +- config/manifests/kustomization.yaml | 2 +- config/operator/kustomization.yaml | 2 +- config/rbac/kustomization.yaml | 2 +- config/rbac/operator.yaml | 2 +- config/rbac/role.yaml | 2 +- config/samples/kustomization.yaml | 2 +- config/scorecard/bases/config.yaml | 2 +- config/scorecard/kustomization.yaml | 2 +- config/scorecard/patches/basic.config.yaml | 2 +- config/scorecard/patches/olm.config.yaml | 2 +- config/templates/csv.yaml.in | 2 +- config/webhook/kustomization.yaml | 2 +- config/webhook/kustomizeconfig.yaml | 2 +- config/webhook/manifests.yaml | 2 +- config/webhook/service.yaml | 2 +- crdb-versions.yaml | 2 +- e2e/create/create_test.go | 2 +- e2e/decommission/decommission_test.go | 2 +- e2e/e2e.go | 2 +- e2e/kubetest2-eks/deployer/build.go | 2 +- e2e/kubetest2-eks/deployer/deployer.go | 2 +- e2e/kubetest2-eks/deployer/down.go | 2 +- e2e/kubetest2-eks/deployer/dumplogs.go | 2 +- e2e/kubetest2-eks/deployer/up.go | 2 +- e2e/kubetest2-eks/main.go | 2 +- e2e/kubetest2-k3d/deployer/build.go | 2 +- e2e/kubetest2-k3d/deployer/deployer.go | 2 +- e2e/kubetest2-k3d/deployer/down.go | 2 +- e2e/kubetest2-k3d/deployer/dumplogs.go | 2 +- e2e/kubetest2-k3d/deployer/up.go | 2 +- e2e/kubetest2-k3d/main.go | 2 +- e2e/kubetest2-openshift/deployer/build.go | 2 +- e2e/kubetest2-openshift/deployer/deployer.go | 2 +- e2e/kubetest2-openshift/deployer/down.go | 2 +- e2e/kubetest2-openshift/deployer/dumplogs.go | 2 +- e2e/kubetest2-openshift/deployer/up.go | 2 +- e2e/kubetest2-openshift/main.go | 2 +- e2e/kubetest2-openshift/types/gcp/platform.go | 2 +- e2e/kubetest2-openshift/types/installconfigs.go | 2 +- e2e/openshift/openshift_packaging_test.go | 2 +- e2e/pvcresize/pvcresize_test.go | 2 +- e2e/upgrades/upgrades_test.go | 2 +- e2e/upgradessha256/upgradessha256_test.go | 2 +- e2e/versionchecker/versionchecker_test.go | 2 +- examples/3-nodes-insecure-no-topology.yaml | 2 +- examples/3-nodes-insecure.yaml | 2 +- examples/3-nodes-secure-kube-cert-v20.1.yaml | 2 +- examples/3-nodes-secure-kube-cert.yaml | 2 +- hack/bin/tools.go | 2 +- hack/boilerplate/boilerplate.Dockerfile.txt | 2 +- hack/boilerplate/boilerplate.Makefile.txt | 2 +- hack/boilerplate/boilerplate.css.txt | 2 +- hack/boilerplate/boilerplate.deepcopy.go.txt | 2 +- hack/boilerplate/boilerplate.go.txt | 2 +- hack/boilerplate/boilerplate.html.txt | 2 +- hack/boilerplate/boilerplate.java.txt | 2 +- hack/boilerplate/boilerplate.js.txt | 2 +- hack/boilerplate/boilerplate.py.txt | 2 +- hack/boilerplate/boilerplate.scss.txt | 2 +- hack/boilerplate/boilerplate.sh.txt | 2 +- hack/boilerplate/boilerplate.tf.txt | 2 +- hack/boilerplate/boilerplate.ts.txt | 2 +- hack/boilerplate/boilerplate.xml.txt | 2 +- hack/boilerplate/boilerplate.yaml.txt | 2 +- hack/boilerplaterize | 2 +- hack/build/print-workspace-status.sh | 2 +- hack/bundle.sh | 2 +- hack/common.sh | 2 +- hack/crdbversions/main.go | 2 +- hack/crdbversions/main_test.go | 2 +- hack/create-gke-cluster.sh | 2 +- hack/delete-gke-cluster.sh | 2 +- hack/dev.sh | 2 +- hack/eks-storageclass.yaml | 2 +- hack/functions.sh | 2 +- hack/gke/start_stop_gke.go | 2 +- hack/k8s/cluster_checker.go | 2 +- hack/k8s/verify_k8s_running.go | 2 +- hack/openshift-gcp-create.sh | 2 +- hack/openshift-iam-delete.sh | 2 +- hack/openshift-test-packaging.sh | 2 +- hack/release/main.go | 2 +- hack/release/steps.go | 2 +- hack/release/steps_test.go | 2 +- hack/smoketest/main.go | 2 +- hack/smoketest/steps.go | 2 +- hack/smoketest/steps_test.go | 2 +- hack/update-codegen.sh | 2 +- hack/update_crdb_versions/main.go | 2 +- hack/update_crdb_versions/main_test.go | 2 +- hack/verify-codegen.sh | 2 +- hack/verify-crds.sh | 2 +- hack/verify_boilerplate_test.go | 2 +- install/crds.yaml | 2 +- install/operator.yaml | 2 +- pkg/actor/actor.go | 2 +- pkg/actor/cluster_restart.go | 2 +- pkg/actor/cluster_restart_test.go | 2 +- pkg/actor/decommission.go | 2 +- pkg/actor/deploy.go | 2 +- pkg/actor/deploy_test.go | 2 +- pkg/actor/director.go | 2 +- pkg/actor/director_test.go | 2 +- pkg/actor/export_test.go | 2 +- pkg/actor/expose_ingress.go | 2 +- pkg/actor/generate_cert.go | 2 +- pkg/actor/initialize.go | 2 +- pkg/actor/partitioned_update.go | 2 +- pkg/actor/partitioned_update_test.go | 2 +- pkg/actor/resize_pvc.go | 2 +- pkg/actor/setup_rbac.go | 2 +- pkg/actor/setup_rbac_test.go | 2 +- pkg/actor/validate_version.go | 2 +- pkg/client/clientset/versioned/clientset.go | 2 +- pkg/client/clientset/versioned/doc.go | 2 +- .../clientset/versioned/fake/clientset_generated.go | 2 +- pkg/client/clientset/versioned/fake/doc.go | 2 +- pkg/client/clientset/versioned/fake/register.go | 2 +- pkg/client/clientset/versioned/scheme/doc.go | 2 +- pkg/client/clientset/versioned/scheme/register.go | 2 +- .../versioned/typed/apis/v1alpha1/apis_client.go | 2 +- .../versioned/typed/apis/v1alpha1/crdbcluster.go | 2 +- pkg/client/clientset/versioned/typed/apis/v1alpha1/doc.go | 2 +- .../clientset/versioned/typed/apis/v1alpha1/fake/doc.go | 2 +- .../typed/apis/v1alpha1/fake/fake_apis_client.go | 2 +- .../typed/apis/v1alpha1/fake/fake_crdbcluster.go | 2 +- .../versioned/typed/apis/v1alpha1/generated_expansion.go | 2 +- pkg/client/informers/externalversions/apis/interface.go | 2 +- .../externalversions/apis/v1alpha1/crdbcluster.go | 2 +- .../informers/externalversions/apis/v1alpha1/interface.go | 2 +- pkg/client/informers/externalversions/factory.go | 2 +- pkg/client/informers/externalversions/generic.go | 2 +- .../internalinterfaces/factory_interfaces.go | 2 +- pkg/client/listers/apis/v1alpha1/crdbcluster.go | 2 +- pkg/client/listers/apis/v1alpha1/expansion_generated.go | 2 +- pkg/clustersql/settings.go | 2 +- pkg/clustersql/settings_test.go | 2 +- pkg/clustersql/zones.go | 2 +- pkg/clustersql/zones_test.go | 2 +- pkg/clusterstatus/clusterstatus.go | 2 +- pkg/clusterstatus/clusterstatus_test.go | 2 +- pkg/condition/condition.go | 2 +- pkg/condition/condition_test.go | 2 +- pkg/controller/cluster_controller.go | 2 +- pkg/controller/cluster_controller_test.go | 2 +- pkg/controller/result.go | 2 +- pkg/database/connection.go | 2 +- pkg/featuregates/feature_gate.go | 2 +- pkg/featuregates/feature_gate_test.go | 2 +- pkg/features/operator_features.go | 2 +- pkg/healthchecker/healthchecker.go | 2 +- pkg/kube/aliases.go | 2 +- pkg/kube/dialer.go | 2 +- pkg/kube/helpers.go | 2 +- pkg/kube/kubernetes_distro.go | 2 +- pkg/kuberecord/cassettes.go | 2 +- pkg/kuberecord/cassettes_test.go | 2 +- pkg/kuberecord/mode.go | 2 +- pkg/kuberecord/mode_test.go | 2 +- pkg/kuberecord/recorder.go | 2 +- pkg/kuberecord/recorder_test.go | 2 +- .../testdata/cassettes/kuberecord_demo.vcr.yaml | 2 +- pkg/labels/label.go | 2 +- pkg/labels/label_test.go | 2 +- pkg/ptr/ptr.go | 2 +- pkg/resource/certificate.go | 2 +- pkg/resource/certificate_test.go | 2 +- pkg/resource/cluster.go | 2 +- pkg/resource/cluster_test.go | 2 +- pkg/resource/discovery_service.go | 2 +- pkg/resource/discovery_service_test.go | 2 +- pkg/resource/job.go | 2 +- pkg/resource/pod_distruption_budget.go | 2 +- pkg/resource/pod_distruption_budget_test.go | 2 +- pkg/resource/public_service.go | 2 +- pkg/resource/public_service_test.go | 2 +- pkg/resource/rbac.go | 2 +- pkg/resource/rbac_test.go | 2 +- pkg/resource/resource.go | 2 +- pkg/resource/resource_test.go | 2 +- pkg/resource/sql_ingress.go | 2 +- pkg/resource/sql_ingress_test.go | 2 +- pkg/resource/statefulset.go | 2 +- pkg/resource/statefulset_test.go | 2 +- .../testdata/TestStatefulSetBuilder/automount_sa_in.yaml | 2 +- .../default_insecure_statefulset_in.yaml | 2 +- .../TestStatefulSetBuilder/default_secure_in.yaml | 2 +- .../insecure_statefulset_cli_args_in.yaml | 2 +- .../insecure_statefulset_cli_args_with_join_in.yaml | 2 +- .../insecure_statefulset_with_resources_in.yaml | 2 +- pkg/resource/tls_secret.go | 2 +- pkg/resource/tls_secret_test.go | 2 +- pkg/resource/ui_ingress.go | 2 +- pkg/resource/ui_ingress_test.go | 2 +- pkg/resource/webhook_certificates.go | 2 +- pkg/resource/webhook_certificates_test.go | 2 +- pkg/scale/cockroach_statefulset.go | 2 +- pkg/scale/cockroach_statefulset_test.go | 2 +- pkg/scale/drainer.go | 2 +- pkg/scale/executor.go | 2 +- pkg/scale/persistent_volume_pruner.go | 2 +- pkg/scale/persistent_volume_pruner_test.go | 2 +- pkg/scale/scale.go | 2 +- pkg/security/certificate.go | 2 +- pkg/security/certificate_test.go | 2 +- pkg/security/certs.go | 2 +- pkg/security/certs_test.go | 2 +- pkg/testutil/assert.go | 2 +- pkg/testutil/builder.go | 2 +- pkg/testutil/cmp.go | 2 +- pkg/testutil/env.go | 2 +- pkg/testutil/env/env.go | 2 +- pkg/testutil/env/env_test.go | 2 +- pkg/testutil/env/path.go | 2 +- pkg/testutil/env/path_test.go | 2 +- pkg/testutil/env/sandbox.go | 2 +- pkg/testutil/env_test.go | 2 +- pkg/testutil/exec/exec.go | 2 +- pkg/testutil/fake.go | 2 +- pkg/testutil/helpers.go | 2 +- pkg/testutil/require.go | 2 +- pkg/testutil/retry.go | 2 +- pkg/testutil/steps.go | 2 +- pkg/testutil/validate_headers.go | 2 +- pkg/testutil/validate_headers_test.go | 8 ++++---- pkg/update/internal.go | 2 +- pkg/update/rolling_restart.go | 2 +- pkg/update/update.go | 2 +- pkg/update/update_cockroach_version.go | 2 +- pkg/update/update_cockroach_version_common.go | 2 +- pkg/update/update_cockroach_version_common_test.go | 2 +- pkg/update/update_cockroach_version_test.go | 2 +- pkg/util/api_kind_checker.go | 2 +- pkg/util/tmp_dir.go | 2 +- pkg/utilfeature/feature_gate.go | 2 +- test-registry.yaml | 2 +- 273 files changed, 276 insertions(+), 276 deletions(-) diff --git a/.github/workflows/e2e-kind-create.yaml b/.github/workflows/e2e-kind-create.yaml index f8b9ab811..3c8a38c31 100644 --- a/.github/workflows/e2e-kind-create.yaml +++ b/.github/workflows/e2e-kind-create.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/e2e-kind-decommission.yaml b/.github/workflows/e2e-kind-decommission.yaml index 2a995e20c..99c6e0f86 100644 --- a/.github/workflows/e2e-kind-decommission.yaml +++ b/.github/workflows/e2e-kind-decommission.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/e2e-kind-upgrades.yaml b/.github/workflows/e2e-kind-upgrades.yaml index 0b1ef0187..4b9232619 100644 --- a/.github/workflows/e2e-kind-upgrades.yaml +++ b/.github/workflows/e2e-kind-upgrades.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/e2e-kind-upgradessha256.yaml b/.github/workflows/e2e-kind-upgradessha256.yaml index 627261a2b..727f11d52 100644 --- a/.github/workflows/e2e-kind-upgradessha256.yaml +++ b/.github/workflows/e2e-kind-upgradessha256.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/e2e-kind-versionchecker.yaml b/.github/workflows/e2e-kind-versionchecker.yaml index b6164a19a..f53b4c55b 100644 --- a/.github/workflows/e2e-kind-versionchecker.yaml +++ b/.github/workflows/e2e-kind-versionchecker.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/nightly-smoketest.yaml b/.github/workflows/nightly-smoketest.yaml index 4340f9c85..2eef7b1d7 100644 --- a/.github/workflows/nightly-smoketest.yaml +++ b/.github/workflows/nightly-smoketest.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/templates.yaml b/.github/workflows/templates.yaml index a9831d5d4..622df9736 100644 --- a/.github/workflows/templates.yaml +++ b/.github/workflows/templates.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3f97238cf..84b919b83 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/workflows/update-crdb-versions.yaml b/.github/workflows/update-crdb-versions.yaml index ebdc00888..ef9c3c658 100644 --- a/.github/workflows/update-crdb-versions.yaml +++ b/.github/workflows/update-crdb-versions.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.golangci.yaml b/.golangci.yaml index 6bf3892cc..a58ae719c 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index 70f21b776..ff961e76c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/action_status.go b/apis/v1alpha1/action_status.go index 0ae4e6779..fe8fd5832 100644 --- a/apis/v1alpha1/action_status.go +++ b/apis/v1alpha1/action_status.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/action_types.go b/apis/v1alpha1/action_types.go index 82461e07c..c40ccd3ba 100644 --- a/apis/v1alpha1/action_types.go +++ b/apis/v1alpha1/action_types.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/cluster_types.go b/apis/v1alpha1/cluster_types.go index b7d27ae0c..64d101eef 100644 --- a/apis/v1alpha1/cluster_types.go +++ b/apis/v1alpha1/cluster_types.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/cluster_types_test.go b/apis/v1alpha1/cluster_types_test.go index 7ad21b2e4..ebb152579 100644 --- a/apis/v1alpha1/cluster_types_test.go +++ b/apis/v1alpha1/cluster_types_test.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/condition_types.go b/apis/v1alpha1/condition_types.go index d6b0b4636..e15290535 100644 --- a/apis/v1alpha1/condition_types.go +++ b/apis/v1alpha1/condition_types.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/doc.go b/apis/v1alpha1/doc.go index eef18cd47..ff59ad6aa 100644 --- a/apis/v1alpha1/doc.go +++ b/apis/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/groupversion_info.go b/apis/v1alpha1/groupversion_info.go index 40960a479..c0a402415 100644 --- a/apis/v1alpha1/groupversion_info.go +++ b/apis/v1alpha1/groupversion_info.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/restart_types.go b/apis/v1alpha1/restart_types.go index 2dbb2b737..a0dbda010 100644 --- a/apis/v1alpha1/restart_types.go +++ b/apis/v1alpha1/restart_types.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/volume.go b/apis/v1alpha1/volume.go index 35a7d74c7..8d6485d8e 100644 --- a/apis/v1alpha1/volume.go +++ b/apis/v1alpha1/volume.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/volume_test.go b/apis/v1alpha1/volume_test.go index c89483464..4a2a49ab7 100644 --- a/apis/v1alpha1/volume_test.go +++ b/apis/v1alpha1/volume_test.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/webhook.go b/apis/v1alpha1/webhook.go index dc4f8fcf1..1d5a21d26 100644 --- a/apis/v1alpha1/webhook.go +++ b/apis/v1alpha1/webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/webhook_test.go b/apis/v1alpha1/webhook_test.go index 0f46f2552..0851da10f 100644 --- a/apis/v1alpha1/webhook_test.go +++ b/apis/v1alpha1/webhook_test.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/apis/v1alpha1/zz_generated.deepcopy.go b/apis/v1alpha1/zz_generated.deepcopy.go index 3222780e2..ca1e8b44a 100644 --- a/apis/v1alpha1/zz_generated.deepcopy.go +++ b/apis/v1alpha1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/build/release/teamcity-publish-openshift-bundle.sh b/build/release/teamcity-publish-openshift-bundle.sh index ca2b6a5a2..85b7d8374 100755 --- a/build/release/teamcity-publish-openshift-bundle.sh +++ b/build/release/teamcity-publish-openshift-bundle.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/build/release/teamcity-publish-openshift.sh b/build/release/teamcity-publish-openshift.sh index f461a6ffc..b111b2a8e 100755 --- a/build/release/teamcity-publish-openshift.sh +++ b/build/release/teamcity-publish-openshift.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/build/release/teamcity-publish-release.sh b/build/release/teamcity-publish-release.sh index 233c65c9e..9cdf52c21 100755 --- a/build/release/teamcity-publish-release.sh +++ b/build/release/teamcity-publish-release.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/build/release/teamcity-support.sh b/build/release/teamcity-support.sh index 3a7d9e8b2..2ba38b7ea 100644 --- a/build/release/teamcity-support.sh +++ b/build/release/teamcity-support.sh @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmd/cockroach-operator/main.go b/cmd/cockroach-operator/main.go index 52c112edf..0659ca560 100644 --- a/cmd/cockroach-operator/main.go +++ b/cmd/cockroach-operator/main.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/cockroach-operator/prep_webhooks.go b/cmd/cockroach-operator/prep_webhooks.go index 62823626b..ad713d0c3 100644 --- a/cmd/cockroach-operator/prep_webhooks.go +++ b/cmd/cockroach-operator/prep_webhooks.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/config/crd/bases/crdb.cockroachlabs.com_crdbclusters.yaml b/config/crd/bases/crdb.cockroachlabs.com_crdbclusters.yaml index 457c9e965..9866fe8bb 100644 --- a/config/crd/bases/crdb.cockroachlabs.com_crdbclusters.yaml +++ b/config/crd/bases/crdb.cockroachlabs.com_crdbclusters.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 3ec1ae8d2..cf47969e6 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 2cc3e58c2..5bd88770e 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/default/namespace.yaml b/config/default/namespace.yaml index e28c8609b..1440e8af9 100644 --- a/config/default/namespace.yaml +++ b/config/default/namespace.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/manager/deployment.yaml b/config/manager/deployment.yaml index 7909a5dbe..fd5866c45 100644 --- a/config/manager/deployment.yaml +++ b/config/manager/deployment.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index e97daf91c..34e41a7e9 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml index 8e69830f1..da1e722fe 100644 --- a/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/cockroach-operator.clusterserviceversion.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/manifests/kustomization.yaml b/config/manifests/kustomization.yaml index ec3ebd5e7..9eaf8fbc1 100644 --- a/config/manifests/kustomization.yaml +++ b/config/manifests/kustomization.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/operator/kustomization.yaml b/config/operator/kustomization.yaml index 215536a6d..eea59e0a0 100644 --- a/config/operator/kustomization.yaml +++ b/config/operator/kustomization.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index 445b8bfe0..35ece5b1b 100644 --- a/config/rbac/kustomization.yaml +++ b/config/rbac/kustomization.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/rbac/operator.yaml b/config/rbac/operator.yaml index 747258698..48965f8ca 100644 --- a/config/rbac/operator.yaml +++ b/config/rbac/operator.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 2ead098b4..841422af8 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index 1fe461849..1d12569e4 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/scorecard/bases/config.yaml b/config/scorecard/bases/config.yaml index fab3e62a6..d78653f90 100644 --- a/config/scorecard/bases/config.yaml +++ b/config/scorecard/bases/config.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/scorecard/kustomization.yaml b/config/scorecard/kustomization.yaml index c873d094c..e0b7b7650 100644 --- a/config/scorecard/kustomization.yaml +++ b/config/scorecard/kustomization.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/scorecard/patches/basic.config.yaml b/config/scorecard/patches/basic.config.yaml index e4402b1f1..32123f145 100644 --- a/config/scorecard/patches/basic.config.yaml +++ b/config/scorecard/patches/basic.config.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/scorecard/patches/olm.config.yaml b/config/scorecard/patches/olm.config.yaml index e8b945bf1..bc946a0d0 100644 --- a/config/scorecard/patches/olm.config.yaml +++ b/config/scorecard/patches/olm.config.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/templates/csv.yaml.in b/config/templates/csv.yaml.in index f46cf837d..4c736a54b 100644 --- a/config/templates/csv.yaml.in +++ b/config/templates/csv.yaml.in @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/webhook/kustomization.yaml b/config/webhook/kustomization.yaml index 6758522e7..21fdbc08c 100644 --- a/config/webhook/kustomization.yaml +++ b/config/webhook/kustomization.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/webhook/kustomizeconfig.yaml b/config/webhook/kustomizeconfig.yaml index 02c082a95..51a7f57f9 100644 --- a/config/webhook/kustomizeconfig.yaml +++ b/config/webhook/kustomizeconfig.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index 7bfc050a4..6c8c8681d 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/config/webhook/service.yaml b/config/webhook/service.yaml index b11922815..9a4613aa8 100644 --- a/config/webhook/service.yaml +++ b/config/webhook/service.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/crdb-versions.yaml b/crdb-versions.yaml index b75c4d2ba..b2392748b 100644 --- a/crdb-versions.yaml +++ b/crdb-versions.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/e2e/create/create_test.go b/e2e/create/create_test.go index fcb1f1f1c..6a8d154ce 100644 --- a/e2e/create/create_test.go +++ b/e2e/create/create_test.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/decommission/decommission_test.go b/e2e/decommission/decommission_test.go index 6a77007c5..5823ce390 100644 --- a/e2e/decommission/decommission_test.go +++ b/e2e/decommission/decommission_test.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/e2e.go b/e2e/e2e.go index d32dfd4a4..9874fecf6 100644 --- a/e2e/e2e.go +++ b/e2e/e2e.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-eks/deployer/build.go b/e2e/kubetest2-eks/deployer/build.go index 42a9d460e..dc6e2d36c 100644 --- a/e2e/kubetest2-eks/deployer/build.go +++ b/e2e/kubetest2-eks/deployer/build.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-eks/deployer/deployer.go b/e2e/kubetest2-eks/deployer/deployer.go index 904d39c4a..f43b68918 100644 --- a/e2e/kubetest2-eks/deployer/deployer.go +++ b/e2e/kubetest2-eks/deployer/deployer.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-eks/deployer/down.go b/e2e/kubetest2-eks/deployer/down.go index 3b911ac68..3a21460a7 100644 --- a/e2e/kubetest2-eks/deployer/down.go +++ b/e2e/kubetest2-eks/deployer/down.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-eks/deployer/dumplogs.go b/e2e/kubetest2-eks/deployer/dumplogs.go index e169efd3f..1b71f2aab 100644 --- a/e2e/kubetest2-eks/deployer/dumplogs.go +++ b/e2e/kubetest2-eks/deployer/dumplogs.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-eks/deployer/up.go b/e2e/kubetest2-eks/deployer/up.go index e378b2081..b6307d0ce 100644 --- a/e2e/kubetest2-eks/deployer/up.go +++ b/e2e/kubetest2-eks/deployer/up.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-eks/main.go b/e2e/kubetest2-eks/main.go index 34b72267a..9335ac32b 100644 --- a/e2e/kubetest2-eks/main.go +++ b/e2e/kubetest2-eks/main.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-k3d/deployer/build.go b/e2e/kubetest2-k3d/deployer/build.go index 706066755..e2ec7a355 100644 --- a/e2e/kubetest2-k3d/deployer/build.go +++ b/e2e/kubetest2-k3d/deployer/build.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-k3d/deployer/deployer.go b/e2e/kubetest2-k3d/deployer/deployer.go index 2d2b85b8f..10cfef55e 100644 --- a/e2e/kubetest2-k3d/deployer/deployer.go +++ b/e2e/kubetest2-k3d/deployer/deployer.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-k3d/deployer/down.go b/e2e/kubetest2-k3d/deployer/down.go index eeed0f47e..1efee0b16 100644 --- a/e2e/kubetest2-k3d/deployer/down.go +++ b/e2e/kubetest2-k3d/deployer/down.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-k3d/deployer/dumplogs.go b/e2e/kubetest2-k3d/deployer/dumplogs.go index 60cf050fd..51f437905 100644 --- a/e2e/kubetest2-k3d/deployer/dumplogs.go +++ b/e2e/kubetest2-k3d/deployer/dumplogs.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-k3d/deployer/up.go b/e2e/kubetest2-k3d/deployer/up.go index 07882f0d9..55acd4abb 100644 --- a/e2e/kubetest2-k3d/deployer/up.go +++ b/e2e/kubetest2-k3d/deployer/up.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-k3d/main.go b/e2e/kubetest2-k3d/main.go index 665a597a9..369257879 100644 --- a/e2e/kubetest2-k3d/main.go +++ b/e2e/kubetest2-k3d/main.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-openshift/deployer/build.go b/e2e/kubetest2-openshift/deployer/build.go index 816a09513..83f29921a 100644 --- a/e2e/kubetest2-openshift/deployer/build.go +++ b/e2e/kubetest2-openshift/deployer/build.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-openshift/deployer/deployer.go b/e2e/kubetest2-openshift/deployer/deployer.go index d0b34104b..1f8ef64a0 100644 --- a/e2e/kubetest2-openshift/deployer/deployer.go +++ b/e2e/kubetest2-openshift/deployer/deployer.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-openshift/deployer/down.go b/e2e/kubetest2-openshift/deployer/down.go index 1b8a84bbf..e87e28e5f 100644 --- a/e2e/kubetest2-openshift/deployer/down.go +++ b/e2e/kubetest2-openshift/deployer/down.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-openshift/deployer/dumplogs.go b/e2e/kubetest2-openshift/deployer/dumplogs.go index cb47e7c1e..f9482aea0 100644 --- a/e2e/kubetest2-openshift/deployer/dumplogs.go +++ b/e2e/kubetest2-openshift/deployer/dumplogs.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-openshift/deployer/up.go b/e2e/kubetest2-openshift/deployer/up.go index 75f428832..527f2c900 100644 --- a/e2e/kubetest2-openshift/deployer/up.go +++ b/e2e/kubetest2-openshift/deployer/up.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-openshift/main.go b/e2e/kubetest2-openshift/main.go index 9c04b0248..6083f9144 100644 --- a/e2e/kubetest2-openshift/main.go +++ b/e2e/kubetest2-openshift/main.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-openshift/types/gcp/platform.go b/e2e/kubetest2-openshift/types/gcp/platform.go index d4f9eb641..00721651a 100644 --- a/e2e/kubetest2-openshift/types/gcp/platform.go +++ b/e2e/kubetest2-openshift/types/gcp/platform.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/kubetest2-openshift/types/installconfigs.go b/e2e/kubetest2-openshift/types/installconfigs.go index 262348c46..48a046aa3 100644 --- a/e2e/kubetest2-openshift/types/installconfigs.go +++ b/e2e/kubetest2-openshift/types/installconfigs.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/openshift/openshift_packaging_test.go b/e2e/openshift/openshift_packaging_test.go index bf8414f66..bdc0df7dc 100644 --- a/e2e/openshift/openshift_packaging_test.go +++ b/e2e/openshift/openshift_packaging_test.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/pvcresize/pvcresize_test.go b/e2e/pvcresize/pvcresize_test.go index f8c6a2b3b..7d59eb185 100644 --- a/e2e/pvcresize/pvcresize_test.go +++ b/e2e/pvcresize/pvcresize_test.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/upgrades/upgrades_test.go b/e2e/upgrades/upgrades_test.go index b23e54b17..739691b2d 100644 --- a/e2e/upgrades/upgrades_test.go +++ b/e2e/upgrades/upgrades_test.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/upgradessha256/upgradessha256_test.go b/e2e/upgradessha256/upgradessha256_test.go index e240b32b8..aecb613e8 100644 --- a/e2e/upgradessha256/upgradessha256_test.go +++ b/e2e/upgradessha256/upgradessha256_test.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/e2e/versionchecker/versionchecker_test.go b/e2e/versionchecker/versionchecker_test.go index 1ddb8b137..b7c0bb114 100644 --- a/e2e/versionchecker/versionchecker_test.go +++ b/e2e/versionchecker/versionchecker_test.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/examples/3-nodes-insecure-no-topology.yaml b/examples/3-nodes-insecure-no-topology.yaml index 243310c27..886a0d7f5 100644 --- a/examples/3-nodes-insecure-no-topology.yaml +++ b/examples/3-nodes-insecure-no-topology.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/examples/3-nodes-insecure.yaml b/examples/3-nodes-insecure.yaml index 552c450df..2eb809915 100644 --- a/examples/3-nodes-insecure.yaml +++ b/examples/3-nodes-insecure.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/examples/3-nodes-secure-kube-cert-v20.1.yaml b/examples/3-nodes-secure-kube-cert-v20.1.yaml index b7bc69f34..1a4298bbc 100644 --- a/examples/3-nodes-secure-kube-cert-v20.1.yaml +++ b/examples/3-nodes-secure-kube-cert-v20.1.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/examples/3-nodes-secure-kube-cert.yaml b/examples/3-nodes-secure-kube-cert.yaml index a6f32b88a..d661aa9c6 100644 --- a/examples/3-nodes-secure-kube-cert.yaml +++ b/examples/3-nodes-secure-kube-cert.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hack/bin/tools.go b/hack/bin/tools.go index ddefddcba..1052b67e8 100644 --- a/hack/bin/tools.go +++ b/hack/bin/tools.go @@ -1,7 +1,7 @@ // +build tools /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/hack/boilerplate/boilerplate.Dockerfile.txt b/hack/boilerplate/boilerplate.Dockerfile.txt index 5ded78d85..0ca059688 100644 --- a/hack/boilerplate/boilerplate.Dockerfile.txt +++ b/hack/boilerplate/boilerplate.Dockerfile.txt @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hack/boilerplate/boilerplate.Makefile.txt b/hack/boilerplate/boilerplate.Makefile.txt index 5ded78d85..0ca059688 100644 --- a/hack/boilerplate/boilerplate.Makefile.txt +++ b/hack/boilerplate/boilerplate.Makefile.txt @@ -1,4 +1,4 @@ -# Copyright 2022 The Cockroach Authors +# Copyright 2023 The Cockroach Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hack/boilerplate/boilerplate.css.txt b/hack/boilerplate/boilerplate.css.txt index 100d69c67..c41a30542 100644 --- a/hack/boilerplate/boilerplate.css.txt +++ b/hack/boilerplate/boilerplate.css.txt @@ -1,4 +1,4 @@ -// Copyright 2022 The Cockroach Authors +// Copyright 2023 The Cockroach Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/hack/boilerplate/boilerplate.deepcopy.go.txt b/hack/boilerplate/boilerplate.deepcopy.go.txt index 56c60238e..00fba57c1 100644 --- a/hack/boilerplate/boilerplate.deepcopy.go.txt +++ b/hack/boilerplate/boilerplate.deepcopy.go.txt @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/hack/boilerplate/boilerplate.go.txt b/hack/boilerplate/boilerplate.go.txt index 56c60238e..00fba57c1 100644 --- a/hack/boilerplate/boilerplate.go.txt +++ b/hack/boilerplate/boilerplate.go.txt @@ -1,5 +1,5 @@ /* -Copyright 2022 The Cockroach Authors +Copyright 2023 The Cockroach Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/hack/boilerplate/boilerplate.html.txt b/hack/boilerplate/boilerplate.html.txt index 78983f536..7eb305308 100644 --- a/hack/boilerplate/boilerplate.html.txt +++ b/hack/boilerplate/boilerplate.html.txt @@ -1,5 +1,5 @@