Skip to content

Commit ebca67d

Browse files
authored
Merge pull request #99 from tahmmee/2.3.x
Fix cluster creation with legacy TLS
2 parents b748da6 + 265b03d commit ebca67d

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

charts/couchbase-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: couchbase-operator
33
description: A Helm chart to deploy the Couchbase Autonomous Operator for easily deploying, managing, and maintaining Couchbase Clusters. Couchbase Server is a NoSQL document database with a distributed architecture for performance, scalability, and availability. It enables developers to build applications easier and faster by leveraging the power of SQL with the flexibility of JSON.
4-
version: 2.32.1
4+
version: 2.32.2
55
appVersion: 2.3.2
66
type: application
77
keywords:

charts/couchbase-operator/templates/_helpers.tpl

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -280,27 +280,35 @@ Determine if tls legacy mode is enabled. Legacy TLS involves use of static secr
280280
{{/* legacy is explicitly set */}}
281281
{{- true -}}
282282
{{- else -}}
283-
{{- $deprecatedClusterName := (include "couchbase-cluster.fullname" .) -}}
284-
{{- $deprecatedClusterSpec := (lookup "couchbase.com/v2" "CouchbaseCluster" .Release.Namespace $deprecatedClusterName) -}}
285-
{{- if $deprecatedClusterSpec -}}
286-
{{- $deprecatedTLS := $deprecatedClusterSpec.spec.networking.tls -}}
287-
{{- if $deprecatedTLS -}}
288-
{{- if $deprecatedTLS.static -}}
289-
{{/* legacy format is in use for legacy-style cluster */}}
290-
{{- true -}}
291-
{{- end -}}
283+
{{/* check if request spec is in legacy format */}}
284+
{{- $requestSpecTLS := .Values.cluster.networking.tls -}}
285+
{{- if $requestSpecTLS -}}
286+
{{- if $requestSpecTLS.static -}}
287+
{{- true -}}
292288
{{- end -}}
293-
{{- else -}}
294-
{{- $clusterName := (include "couchbase-cluster.clustername" .) -}}
295-
{{- $clusterSpec := (lookup "couchbase.com/v2" "CouchbaseCluster" .Release.Namespace $clusterName) -}}
296-
{{- if $clusterSpec -}}
297-
{{- $clusterTLS := $clusterSpec.spec.networking.tls -}}
298-
{{- if $clusterTLS -}}
299-
{{- if $clusterTLS.static -}}
300-
{{/* legacy format is in use for cluster */}}
289+
{{- else -}}
290+
{{- $deprecatedClusterName := (include "couchbase-cluster.fullname" .) -}}
291+
{{- $deprecatedClusterSpec := (lookup "couchbase.com/v2" "CouchbaseCluster" .Release.Namespace $deprecatedClusterName) -}}
292+
{{- if $deprecatedClusterSpec -}}
293+
{{- $deprecatedTLS := $deprecatedClusterSpec.spec.networking.tls -}}
294+
{{- if $deprecatedTLS -}}
295+
{{- if $deprecatedTLS.static -}}
296+
{{/* legacy format is in use for legacy-style cluster */}}
301297
{{- true -}}
302298
{{- end -}}
303299
{{- end -}}
300+
{{- else -}}
301+
{{- $clusterName := (include "couchbase-cluster.clustername" .) -}}
302+
{{- $clusterSpec := (lookup "couchbase.com/v2" "CouchbaseCluster" .Release.Namespace $clusterName) -}}
303+
{{- if $clusterSpec -}}
304+
{{- $clusterTLS := $clusterSpec.spec.networking -}}
305+
{{- if $clusterTLS -}}
306+
{{- if $clusterTLS.static -}}
307+
{{/* legacy format is in use for cluster */}}
308+
{{- true -}}
309+
{{- end -}}
310+
{{- end -}}
311+
{{- end -}}
304312
{{- end -}}
305313
{{- end -}}
306314
{{- end -}}

0 commit comments

Comments
 (0)