@@ -24,6 +24,7 @@ import (
24
24
"github.com/openservicemesh/osm/pkg/constants"
25
25
"github.com/openservicemesh/osm/pkg/k8s/informers"
26
26
"github.com/openservicemesh/osm/pkg/messaging"
27
+ "github.com/openservicemesh/osm/pkg/utils"
27
28
)
28
29
29
30
const (
@@ -54,7 +55,7 @@ func NewCertificateManager(ctx context.Context, kubeClient kubernetes.Interface,
54
55
MRCProviderGenerator : MRCProviderGenerator {
55
56
kubeClient : kubeClient ,
56
57
kubeConfig : kubeConfig ,
57
- KeyBitSize : cfg .GetCertKeyBitSize (),
58
+ KeyBitSize : utils .GetCertKeyBitSize (cfg . GetMeshConfig () ),
58
59
caExtractorFunc : getCA ,
59
60
},
60
61
mrc : & v1alpha2.MeshRootCertificate {
@@ -76,7 +77,13 @@ func NewCertificateManager(ctx context.Context, kubeClient kubernetes.Interface,
76
77
mrcClient .MRCProviderGenerator .DefaultVaultToken = vaultOption .VaultToken
77
78
}
78
79
79
- return certificate .NewManager (ctx , mrcClient , cfg .GetServiceCertValidityPeriod , cfg .GetIngressGatewayCertValidityPeriod , checkInterval )
80
+ return certificate .NewManager (
81
+ ctx ,
82
+ mrcClient ,
83
+ func () time.Duration { return utils .GetServiceCertValidityPeriod (cfg .GetMeshConfig ()) },
84
+ func () time.Duration { return utils .GetIngressGatewayCertValidityPeriod (cfg .GetMeshConfig ()) },
85
+ checkInterval ,
86
+ )
80
87
}
81
88
82
89
// NewCertificateManagerFromMRC returns a new certificate manager.
@@ -90,7 +97,7 @@ func NewCertificateManagerFromMRC(ctx context.Context, kubeClient kubernetes.Int
90
97
MRCProviderGenerator : MRCProviderGenerator {
91
98
kubeClient : kubeClient ,
92
99
kubeConfig : kubeConfig ,
93
- KeyBitSize : cfg .GetCertKeyBitSize (),
100
+ KeyBitSize : utils .GetCertKeyBitSize (cfg . GetMeshConfig () ),
94
101
caExtractorFunc : getCA ,
95
102
},
96
103
informerCollection : ic ,
@@ -100,7 +107,13 @@ func NewCertificateManagerFromMRC(ctx context.Context, kubeClient kubernetes.Int
100
107
mrcClient .MRCProviderGenerator .DefaultVaultToken = vaultOption .VaultToken
101
108
}
102
109
103
- return certificate .NewManager (ctx , mrcClient , cfg .GetServiceCertValidityPeriod , cfg .GetIngressGatewayCertValidityPeriod , checkInterval )
110
+ return certificate .NewManager (
111
+ ctx ,
112
+ mrcClient ,
113
+ func () time.Duration { return utils .GetServiceCertValidityPeriod (cfg .GetMeshConfig ()) },
114
+ func () time.Duration { return utils .GetIngressGatewayCertValidityPeriod (cfg .GetMeshConfig ()) },
115
+ checkInterval ,
116
+ )
104
117
}
105
118
106
119
// GetCertIssuerForMRC returns a certificate.Issuer generated from the provided MRC.
0 commit comments