Skip to content

Commit e0220ae

Browse files
committed
modify tests for new cert bundle and comments
1 parent 070abed commit e0220ae

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

internal/mode/static/state/dataplane/configuration_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,14 @@ func TestBuildConfiguration(t *testing.T) {
680680
apiv1.TLSPrivateKeyKey: []byte("privateKey-1"),
681681
},
682682
},
683+
CertBundle: graph.NewCertificateBundle(
684+
secret1NsName,
685+
"Secret",
686+
&graph.Certificate{
687+
TLSCert: []byte("cert-1"),
688+
TLSPrivateKey: []byte("privateKey-1"),
689+
},
690+
),
683691
}
684692

685693
secret2NsName := types.NamespacedName{Namespace: "test", Name: "secret-2"}
@@ -694,6 +702,14 @@ func TestBuildConfiguration(t *testing.T) {
694702
apiv1.TLSPrivateKeyKey: []byte("privateKey-2"),
695703
},
696704
},
705+
CertBundle: graph.NewCertificateBundle(
706+
secret2NsName,
707+
"Secret",
708+
&graph.Certificate{
709+
TLSCert: []byte("cert-2"),
710+
TLSPrivateKey: []byte("privateKey-2"),
711+
},
712+
),
697713
}
698714

699715
listener80 := v1.Listener{

internal/mode/static/state/graph/certificate_bundle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func NewCertificateBundle(name types.NamespacedName, kind string, cert *Certific
4343
}
4444
}
4545

46-
// validateTLS ...
46+
// validateTLS checks to make sure a ssl certificate key pair is valid
4747
func validateTLS(tlsCert, tlsPrivateKey []byte) error {
4848
_, err := tls.X509KeyPair(tlsCert, tlsPrivateKey)
4949
if err != nil {

0 commit comments

Comments
 (0)