Skip to content

Commit a675be1

Browse files
Fix Server TLS settings so it works with Istio 1.27 (#1462)
Co-authored-by: Dave Protasowski <dprotaso@gmail.com>
1 parent 6178cb4 commit a675be1

File tree

3 files changed

+31
-157
lines changed

3 files changed

+31
-157
lines changed

pkg/reconciler/ingress/ingress_test.go

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,8 @@ var (
125125
Protocol: "HTTPS",
126126
},
127127
Tls: &istiov1beta1.ServerTLSSettings{
128-
Mode: istiov1beta1.ServerTLSSettings_SIMPLE,
129-
ServerCertificate: corev1.TLSCertKey,
130-
PrivateKey: corev1.TLSPrivateKeyKey,
131-
CredentialName: "secret0",
132-
MinProtocolVersion: istiov1beta1.ServerTLSSettings_TLSV1_2,
128+
Mode: istiov1beta1.ServerTLSSettings_SIMPLE,
129+
CredentialName: "secret0",
133130
},
134131
}
135132
originGateways = map[string]string{
@@ -210,11 +207,8 @@ var (
210207
Protocol: "HTTPS",
211208
},
212209
Tls: &istiov1beta1.ServerTLSSettings{
213-
Mode: istiov1beta1.ServerTLSSettings_SIMPLE,
214-
ServerCertificate: "tls.crt",
215-
PrivateKey: "tls.key",
216-
CredentialName: "secret0",
217-
MinProtocolVersion: istiov1beta1.ServerTLSSettings_TLSV1_2,
210+
Mode: istiov1beta1.ServerTLSSettings_SIMPLE,
211+
CredentialName: "secret0",
218212
},
219213
}
220214

@@ -226,11 +220,8 @@ var (
226220
Protocol: "HTTPS",
227221
},
228222
Tls: &istiov1beta1.ServerTLSSettings{
229-
Mode: istiov1beta1.ServerTLSSettings_SIMPLE,
230-
ServerCertificate: "tls.crt",
231-
PrivateKey: "tls.key",
232-
CredentialName: "secret0",
233-
MinProtocolVersion: istiov1beta1.ServerTLSSettings_TLSV1_2,
223+
Mode: istiov1beta1.ServerTLSSettings_SIMPLE,
224+
CredentialName: "secret0",
234225
},
235226
}
236227

@@ -264,11 +255,8 @@ var (
264255
Protocol: "HTTPS",
265256
},
266257
Tls: &istiov1beta1.ServerTLSSettings{
267-
Mode: istiov1beta1.ServerTLSSettings_SIMPLE,
268-
ServerCertificate: "tls.crt",
269-
PrivateKey: "tls.key",
270-
CredentialName: "other-secret",
271-
MinProtocolVersion: istiov1beta1.ServerTLSSettings_TLSV1_2,
258+
Mode: istiov1beta1.ServerTLSSettings_SIMPLE,
259+
CredentialName: "other-secret",
272260
},
273261
}
274262
irrelevantServer1 = &istiov1beta1.Server{

pkg/reconciler/ingress/resources/gateway.go

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,8 @@ func makeWildcardTLSGateways(originWildcardSecrets map[string]*corev1.Secret,
191191
Protocol: "HTTPS",
192192
},
193193
Tls: &istiov1beta1.ServerTLSSettings{
194-
Mode: istiov1beta1.ServerTLSSettings_SIMPLE,
195-
ServerCertificate: corev1.TLSCertKey,
196-
PrivateKey: corev1.TLSPrivateKeyKey,
197-
CredentialName: credentialName,
198-
// TODO: Drop this when all supported Istio version uses TLS v1.2 by default.
199-
MinProtocolVersion: istiov1beta1.ServerTLSSettings_TLSV1_2,
194+
Mode: istiov1beta1.ServerTLSSettings_SIMPLE,
195+
CredentialName: credentialName,
200196
},
201197
}}
202198
gvk := schema.GroupVersionKind{Version: "v1", Kind: "Secret"}
@@ -343,12 +339,8 @@ func MakeTLSServers(ing *v1alpha1.Ingress, visibility v1alpha1.IngressVisibility
343339
Protocol: "HTTPS",
344340
},
345341
Tls: &istiov1beta1.ServerTLSSettings{
346-
Mode: istiov1beta1.ServerTLSSettings_SIMPLE,
347-
ServerCertificate: corev1.TLSCertKey,
348-
PrivateKey: corev1.TLSPrivateKeyKey,
349-
CredentialName: credentialName,
350-
// TODO: Drop this when all supported Istio version uses TLS v1.2 by default.
351-
MinProtocolVersion: istiov1beta1.ServerTLSSettings_TLSV1_2,
342+
Mode: istiov1beta1.ServerTLSSettings_SIMPLE,
343+
CredentialName: credentialName,
352344
},
353345
}
354346
}

0 commit comments

Comments
 (0)