Skip to content

Commit e364a55

Browse files
authored
fix: always reload certificate for refresh on rotation (#772)
<!-- markdownlint-disable MD041 --> #### What this PR does / why we need it Closes open-component-model/ocm-project#763 #### Which issue(s) this PR is related to <!-- Usage: `Related to #<issue number>`, or `Related to (paste link of issue)`. --> Signed-off-by: Gergely Brautigam <[email protected]>
1 parent 276fa4b commit e364a55

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pkg/oci/repository.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,9 @@ func (c *Client) WithTransport(ctx context.Context) Option {
9999
return nil
100100
}
101101

102-
if c.certPem == nil && c.keyPem == nil {
103-
if err := c.setupCertificates(ctx); err != nil {
104-
return fmt.Errorf("failed to set up certificates for transport: %w", err)
105-
}
102+
// always refresh certificates to handle cert-manager rotation
103+
if err := c.setupCertificates(ctx); err != nil {
104+
return fmt.Errorf("failed to set up certificates for transport: %w", err)
106105
}
107106

108107
o.remoteOpts = append(o.remoteOpts, remote.WithTransport(c.constructTLSRoundTripper()))

0 commit comments

Comments
 (0)