Skip to content

Commit

Permalink
ignore deprecation warning for tlsconfig.RootCAs.Subjects() since we …
Browse files Browse the repository at this point in the history
…use it for things not in systemcertpool
  • Loading branch information
geofffranks authored and ebroberson committed Mar 6, 2024
1 parent 640630a commit 0dcd9f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions initializer/initializer_test.go
Expand Up @@ -495,6 +495,7 @@ var _ = Describe("Initializer", func() {
Expect(tlsConfig.MinVersion).To(BeEquivalentTo(tls.VersionTLS12))
Expect(tlsConfig.InsecureSkipVerify).To(Equal(config.SkipCertVerify))
Expect(tlsConfig.Certificates).To(ContainElement(tlsClientCert))
//lint:ignore SA1019 - ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool.
Expect(tlsConfig.RootCAs.Subjects()).To(ContainElement(caCert.RawSubject))
})

Expand All @@ -515,6 +516,7 @@ var _ = Describe("Initializer", func() {
Expect(tlsConfig).NotTo(BeNil())

Expect(fakeCertPoolRetriever.SystemCertsCallCount()).To(Equal(1))
//lint:ignore SA1019 - ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool.
Expect(tlsConfig.RootCAs.Subjects()).To(ContainElement(caCert.RawSubject))
})

Expand Down Expand Up @@ -552,6 +554,7 @@ var _ = Describe("Initializer", func() {
tlsConfig, err = initializer.TLSConfigFromConfig(logger, fakeCertPoolRetriever, config)
Expect(err).To(Succeed())
Expect(tlsConfig).NotTo(BeNil())
//lint:ignore SA1019 - ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool.
Expect(tlsConfig.RootCAs.Subjects()).To(ContainElement(caCert.RawSubject))
})
})
Expand All @@ -567,6 +570,7 @@ var _ = Describe("Initializer", func() {
tlsConfig, err = initializer.TLSConfigFromConfig(logger, fakeCertPoolRetriever, config)
Expect(err).To(Succeed())
Expect(tlsConfig).NotTo(BeNil())
//lint:ignore SA1019 - ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool.
Expect(tlsConfig.RootCAs.Subjects()).To(ContainElement(caCert.RawSubject))
})
})
Expand Down

0 comments on commit 0dcd9f0

Please sign in to comment.