Skip to content

Commit

Permalink
Fix bug for tls
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpengcheng committed Aug 3, 2022
1 parent e425d79 commit 5cf13ba
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions controllers/spec/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ func MakeStatefulSet(objectMeta *metav1.ObjectMeta, replicas *int32, downloaderI
if pulsar.Oauth2Config != nil {
volumeMounts = append(volumeMounts, generateVolumeMountFromOauthConfig(*pulsar.Oauth2Config))
}

if !reflect.ValueOf(pulsar.TLSConfig).IsNil() && pulsar.TLSConfig.HasSecretVolume() {
volumeMounts = append(volumeMounts, generateVolumeMountFromTLSConfig(pulsar.TLSConfig))
}

var downloadPath, componentPackage string
if javaRuntime != nil {
downloadPath = javaRuntime.JarLocation
Expand Down Expand Up @@ -300,13 +305,10 @@ func getDownloadCommand(downloadPath, componentPackage string, tlsProvided, auth
}
} else {
if tlsConfig.IsEnabled() {
if tlsConfig.AllowInsecureConnection() == "true" {
args = append(args, "--tls-allow-insecure")
}

if tlsConfig.EnableHostnameVerification() == "true" {
args = append(args, "--tls-enable-hostname-verification")
}
args = append(args, []string{
"--tls-allow-insecure=" + tlsConfig.AllowInsecureConnection(),
"--tls-enable-hostname-verification=" + tlsConfig.EnableHostnameVerification(),
}...)

if tlsConfig.HasSecretVolume() {
args = append(args, []string{
Expand Down Expand Up @@ -778,7 +780,6 @@ func generateDownloaderVolumeMountsForRuntime(javaRuntime *v1alpha1.JavaRuntime,
Name: DownloaderVolume,
MountPath: mountPath,
SubPath: subPath,
ReadOnly: true,
}}
}
return nil
Expand Down

0 comments on commit 5cf13ba

Please sign in to comment.