Skip to content

Commit 2dc0544

Browse files
committed
minor fix
Signed-off-by: Ryan Zhang <[email protected]>
1 parent 15bae40 commit 2dc0544

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pkg/propertyprovider/azure/provider.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package azure
1919

2020
import (
2121
"context"
22-
"encoding/base64"
2322
"fmt"
2423
"sync"
2524
"time"
@@ -115,7 +114,7 @@ type PropertyProvider struct {
115114
clusterEntryPointObservedTime time.Time
116115

117116
// Cached cluster certificate authority data (base64 encoded).
118-
clusterCertificateAuthority string
117+
clusterCertificateAuthority []byte
119118
clusterCertificateAuthorityObservedTime time.Time
120119
}
121120

@@ -260,7 +259,7 @@ func (p *PropertyProvider) Start(ctx context.Context, config *rest.Config) error
260259

261260
// Cache the cluster certificate authority data (base64 encoded).
262261
if len(config.CAData) > 0 {
263-
p.clusterCertificateAuthority = base64.StdEncoding.EncodeToString(config.CAData)
262+
p.clusterCertificateAuthority = config.CAData
264263
p.clusterCertificateAuthorityObservedTime = time.Now()
265264
klog.V(2).Info("Cached cluster certificate authority data")
266265
} else {
@@ -368,9 +367,9 @@ func (p *PropertyProvider) Collect(ctx context.Context) propertyprovider.Propert
368367
}
369368

370369
// insert the cluster certificate authority property (if available)
371-
if p.clusterCertificateAuthority != "" {
370+
if len(p.clusterCertificateAuthority) > 0 {
372371
properties[propertyprovider.ClusterCertificateAuthorityProperty] = clusterv1beta1.PropertyValue{
373-
Value: p.clusterCertificateAuthority,
372+
Value: string(p.clusterCertificateAuthority),
374373
ObservationTime: metav1.NewTime(p.clusterCertificateAuthorityObservedTime),
375374
}
376375
}

0 commit comments

Comments
 (0)