@@ -41,18 +41,17 @@ func (i deployAction) Handle(ctx context.Context, instance *rhtasv1alpha1.Fulcio
41
41
labels := constants .LabelsFor (ComponentName , DeploymentName , instance .Name )
42
42
43
43
signingKeySecret , _ := k8sutils .GetSecret (i .Client , "openshift-service-ca" , "signing-key" )
44
- switch {
45
- case instance .Spec .Ctlog .Address == "" :
44
+ if instance .Spec .Ctlog .Address == "" {
46
45
if instance .Spec .TLSCertificate .CACertRef != nil || signingKeySecret != nil {
47
46
instance .Spec .Ctlog .Address = fmt .Sprintf ("https://ctlog.%s.svc" , instance .Namespace )
48
47
} else {
49
48
instance .Spec .Ctlog .Address = fmt .Sprintf ("http://ctlog.%s.svc" , instance .Namespace )
50
49
}
51
- case instance .Spec .Ctlog .Port == nil :
50
+ }
51
+ if instance .Spec .Ctlog .Port == nil || * instance .Spec .Ctlog .Port == 0 {
52
52
var port int32
53
53
if instance .Spec .TLSCertificate .CACertRef != nil || signingKeySecret != nil {
54
54
port = int32 (443 )
55
-
56
55
} else {
57
56
port = int32 (80 )
58
57
}
@@ -72,39 +71,13 @@ func (i deployAction) Handle(ctx context.Context, instance *rhtasv1alpha1.Fulcio
72
71
}
73
72
74
73
// TLS certificate
75
- if instance .Spec .TLSCertificate .CertRef != nil && instance . Spec . TLSCertificate . CACertRef != nil {
74
+ if instance .Spec .TLSCertificate .CACertRef != nil {
76
75
dp .Spec .Template .Spec .Volumes = append (dp .Spec .Template .Spec .Volumes ,
77
76
corev1.Volume {
78
77
Name : "tls-cert" ,
79
78
VolumeSource : corev1.VolumeSource {
80
79
Projected : & corev1.ProjectedVolumeSource {
81
80
Sources : []corev1.VolumeProjection {
82
- {
83
- Secret : & corev1.SecretProjection {
84
- LocalObjectReference : corev1.LocalObjectReference {
85
- Name : instance .Spec .TLSCertificate .CertRef .Name ,
86
- },
87
- Items : []corev1.KeyToPath {
88
- {
89
- Key : instance .Spec .TLSCertificate .CertRef .Key ,
90
- Path : "tls.crt" ,
91
- },
92
- },
93
- },
94
- },
95
- {
96
- Secret : & corev1.SecretProjection {
97
- LocalObjectReference : corev1.LocalObjectReference {
98
- Name : instance .Spec .TLSCertificate .PrivateKeyRef .Name ,
99
- },
100
- Items : []corev1.KeyToPath {
101
- {
102
- Key : instance .Spec .TLSCertificate .PrivateKeyRef .Key ,
103
- Path : "tls.key" ,
104
- },
105
- },
106
- },
107
- },
108
81
{
109
82
ConfigMap : & corev1.ConfigMapProjection {
110
83
LocalObjectReference : corev1.LocalObjectReference {
@@ -130,13 +103,6 @@ func (i deployAction) Handle(ctx context.Context, instance *rhtasv1alpha1.Fulcio
130
103
VolumeSource : corev1.VolumeSource {
131
104
Projected : & corev1.ProjectedVolumeSource {
132
105
Sources : []corev1.VolumeProjection {
133
- {
134
- Secret : & corev1.SecretProjection {
135
- LocalObjectReference : corev1.LocalObjectReference {
136
- Name : instance .Name + "-tls-secret" ,
137
- },
138
- },
139
- },
140
106
{
141
107
ConfigMap : & corev1.ConfigMapProjection {
142
108
LocalObjectReference : corev1.LocalObjectReference {
@@ -166,9 +132,7 @@ func (i deployAction) Handle(ctx context.Context, instance *rhtasv1alpha1.Fulcio
166
132
ReadOnly : true ,
167
133
})
168
134
169
- dp .Spec .Template .Spec .Containers [0 ].Args = append (dp .Spec .Template .Spec .Containers [0 ].Args , "--grpc-tls-certificate" , "/etc/ssl/certs/tls.crt" )
170
- dp .Spec .Template .Spec .Containers [0 ].Args = append (dp .Spec .Template .Spec .Containers [0 ].Args , "--grpc-tls-key" , "/etc/ssl/certs/tls.key" )
171
- dp .Spec .Template .Spec .Containers [0 ].Args = append (dp .Spec .Template .Spec .Containers [0 ].Args , "--tls-ca-cert" , "/etc/ssl/certs/ca.crt" )
135
+ dp .Spec .Template .Spec .Containers [0 ].Args = append (dp .Spec .Template .Spec .Containers [0 ].Args , "--ct-log.tls-ca-cert" , "/etc/ssl/certs/ca.crt" )
172
136
}
173
137
174
138
if err = controllerutil .SetControllerReference (instance , dp , i .Client .Scheme ()); err != nil {
0 commit comments