File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
pkg/controller/namespaced/mysql/tls Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 6
6
"crypto/x509"
7
7
"fmt"
8
8
9
- "github.com/crossplane-contrib/provider-sql/apis/namespaced/mysql/v1alpha1"
10
9
namespacedv1alpha1 "github.com/crossplane-contrib/provider-sql/apis/namespaced/mysql/v1alpha1"
11
10
"github.com/crossplane/crossplane-runtime/v2/apis/common"
12
11
"github.com/go-sql-driver/mysql"
@@ -21,24 +20,24 @@ import (
21
20
func LoadConfig (
22
21
ctx context.Context ,
23
22
kube client.Client ,
24
- ProviderConfigName string ,
25
- TLSMode * string ,
26
- TLSConfig * v1alpha1 .TLSConfig ,
23
+ providerConfigName string ,
24
+ tlsMode * string ,
25
+ tlsConfig * namespacedv1alpha1 .TLSConfig ,
27
26
) (* string , error ) {
28
- if TLSMode == nil || * TLSMode != "custom" {
29
- if TLSConfig != nil {
27
+ if tlsMode == nil || * tlsMode != "custom" {
28
+ if tlsConfig != nil {
30
29
return nil , fmt .Errorf ("tlsConfig is allowed only when tls=custom" )
31
30
}
32
31
33
- return TLSMode , nil
32
+ return tlsMode , nil
34
33
}
35
34
36
- if err := validateTLSConfig (TLSConfig ); err != nil {
35
+ if err := validateTLSConfig (tlsConfig ); err != nil {
37
36
return nil , err
38
37
}
39
38
40
- tlsName := fmt .Sprintf ("custom-%s" , ProviderConfigName )
41
- err := registerTLS (ctx , kube , tlsName , TLSConfig )
39
+ tlsName := fmt .Sprintf ("custom-%s" , providerConfigName )
40
+ err := registerTLS (ctx , kube , tlsName , tlsConfig )
42
41
if err != nil {
43
42
return nil , err
44
43
}
You can’t perform that action at this time.
0 commit comments