@@ -44,7 +44,7 @@ var getCA func(certificate.Issuer) (pem.RootCertificate, error) = func(i certifi
44
44
// NewCertificateManager returns a new certificate manager with a MRC compat client.
45
45
// TODO(4713): Remove and use NewCertificateManagerFromMRC
46
46
func NewCertificateManager (ctx context.Context , kubeClient kubernetes.Interface , kubeConfig * rest.Config , cfg configurator.Configurator ,
47
- providerNamespace string , option Options , msgBroker * messaging.Broker , ic * informers. InformerCollection , checkInterval time.Duration ) (* certificate.Manager , error ) {
47
+ providerNamespace string , option Options , msgBroker * messaging.Broker , checkInterval time.Duration ) (* certificate.Manager , error ) {
48
48
if err := option .Validate (); err != nil {
49
49
return nil , err
50
50
}
@@ -60,9 +60,6 @@ func NewCertificateManager(ctx context.Context, kubeClient kubernetes.Interface,
60
60
ObjectMeta : metav1.ObjectMeta {
61
61
Name : "legacy-compat" ,
62
62
Namespace : providerNamespace ,
63
- Annotations : map [string ]string {
64
- constants .MRCVersionAnnotation : "legacy-compat" ,
65
- },
66
63
},
67
64
Spec : v1alpha2.MeshRootCertificateSpec {
68
65
Provider : option .AsProviderSpec (),
@@ -134,13 +131,6 @@ func (c *MRCProviderGenerator) GetCertIssuerForMRC(mrc *v1alpha2.MeshRootCertifi
134
131
return issuer , ca , id , nil
135
132
}
136
133
137
- func getMRCID (mrc * v1alpha2.MeshRootCertificate ) (string , error ) {
138
- if mrc .Annotations == nil || mrc .Annotations [constants .MRCVersionAnnotation ] == "" {
139
- return "" , fmt .Errorf ("no annotation found for MRC %s/%s, expected annotation %s" , mrc .Namespace , mrc .Name , constants .MRCVersionAnnotation )
140
- }
141
- return mrc .Annotations [constants .MRCVersionAnnotation ], nil
142
- }
143
-
144
134
// getTresorOSMCertificateManager returns a certificate manager instance with Tresor as the certificate provider
145
135
func (c * MRCProviderGenerator ) getTresorOSMCertificateManager (mrc * v1alpha2.MeshRootCertificate ) (certificate.Issuer , string , error ) {
146
136
var err error
@@ -177,11 +167,7 @@ func (c *MRCProviderGenerator) getTresorOSMCertificateManager(mrc *v1alpha2.Mesh
177
167
return nil , "" , fmt .Errorf ("failed to instantiate Tresor as a Certificate Manager: %w" , err )
178
168
}
179
169
180
- id , err := getMRCID (mrc )
181
- if err != nil {
182
- return nil , "" , err
183
- }
184
- return tresorClient , id , nil
170
+ return tresorClient , mrc .Name , nil
185
171
}
186
172
187
173
// getHashiVaultOSMCertificateManager returns a certificate manager instance with Hashi Vault as the certificate provider
@@ -210,11 +196,8 @@ func (c *MRCProviderGenerator) getHashiVaultOSMCertificateManager(mrc *v1alpha2.
210
196
if err != nil {
211
197
return nil , "" , fmt .Errorf ("error instantiating Hashicorp Vault as a Certificate Manager: %w" , err )
212
198
}
213
- id , err := getMRCID (mrc )
214
- if err != nil {
215
- return nil , "" , err
216
- }
217
- return vaultClient , id , nil
199
+
200
+ return vaultClient , mrc .Name , nil
218
201
}
219
202
220
203
// getHashiVaultOSMToken returns the Hashi Vault token from the secret specified in the provided secret key reference
@@ -253,9 +236,6 @@ func (c *MRCProviderGenerator) getCertManagerOSMCertificateManager(mrc *v1alpha2
253
236
if err != nil {
254
237
return nil , "" , fmt .Errorf ("error instantiating Jetstack cert-manager client: %w" , err )
255
238
}
256
- id , err := getMRCID (mrc )
257
- if err != nil {
258
- return nil , "" , err
259
- }
260
- return cmClient , id , nil
239
+
240
+ return cmClient , mrc .Name , nil
261
241
}
0 commit comments