Skip to content

Commit

Permalink
Merge pull request #99 from tahmmee/2.3.x
Browse files Browse the repository at this point in the history
Fix cluster creation with legacy TLS
  • Loading branch information
tahmmee authored Sep 27, 2022
2 parents b748da6 + 265b03d commit ebca67d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
2 changes: 1 addition & 1 deletion charts/couchbase-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: couchbase-operator
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.
version: 2.32.1
version: 2.32.2
appVersion: 2.3.2
type: application
keywords:
Expand Down
42 changes: 25 additions & 17 deletions charts/couchbase-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -280,27 +280,35 @@ Determine if tls legacy mode is enabled. Legacy TLS involves use of static secr
{{/* legacy is explicitly set */}}
{{- true -}}
{{- else -}}
{{- $deprecatedClusterName := (include "couchbase-cluster.fullname" .) -}}
{{- $deprecatedClusterSpec := (lookup "couchbase.com/v2" "CouchbaseCluster" .Release.Namespace $deprecatedClusterName) -}}
{{- if $deprecatedClusterSpec -}}
{{- $deprecatedTLS := $deprecatedClusterSpec.spec.networking.tls -}}
{{- if $deprecatedTLS -}}
{{- if $deprecatedTLS.static -}}
{{/* legacy format is in use for legacy-style cluster */}}
{{- true -}}
{{- end -}}
{{/* check if request spec is in legacy format */}}
{{- $requestSpecTLS := .Values.cluster.networking.tls -}}
{{- if $requestSpecTLS -}}
{{- if $requestSpecTLS.static -}}
{{- true -}}
{{- end -}}
{{- else -}}
{{- $clusterName := (include "couchbase-cluster.clustername" .) -}}
{{- $clusterSpec := (lookup "couchbase.com/v2" "CouchbaseCluster" .Release.Namespace $clusterName) -}}
{{- if $clusterSpec -}}
{{- $clusterTLS := $clusterSpec.spec.networking.tls -}}
{{- if $clusterTLS -}}
{{- if $clusterTLS.static -}}
{{/* legacy format is in use for cluster */}}
{{- else -}}
{{- $deprecatedClusterName := (include "couchbase-cluster.fullname" .) -}}
{{- $deprecatedClusterSpec := (lookup "couchbase.com/v2" "CouchbaseCluster" .Release.Namespace $deprecatedClusterName) -}}
{{- if $deprecatedClusterSpec -}}
{{- $deprecatedTLS := $deprecatedClusterSpec.spec.networking.tls -}}
{{- if $deprecatedTLS -}}
{{- if $deprecatedTLS.static -}}
{{/* legacy format is in use for legacy-style cluster */}}
{{- true -}}
{{- end -}}
{{- end -}}
{{- else -}}
{{- $clusterName := (include "couchbase-cluster.clustername" .) -}}
{{- $clusterSpec := (lookup "couchbase.com/v2" "CouchbaseCluster" .Release.Namespace $clusterName) -}}
{{- if $clusterSpec -}}
{{- $clusterTLS := $clusterSpec.spec.networking -}}
{{- if $clusterTLS -}}
{{- if $clusterTLS.static -}}
{{/* legacy format is in use for cluster */}}
{{- true -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
Expand Down

0 comments on commit ebca67d

Please sign in to comment.