Skip to content

Commit fa1a955

Browse files
committed
Remove unsafe destroy on LockedData attribute
1 parent 05571bf commit fa1a955

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

utils/service_binding_reconciler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (r *ReconcilerBase) applyDefaultValuesToExpose(secret *common.LockedBufferS
128128

129129
if _, found = secretData["certificates"]; !found && ba.GetStatus().GetReferences()[common.StatusReferenceCertSecretName] != "" {
130130
certSecret, err := common.GetSecret(r.GetClient(), ba.GetStatus().GetReferences()[common.StatusReferenceCertSecretName], mObj.GetNamespace())
131-
defer certSecret.LockedData.Destroy()
131+
defer certSecret.Destroy()
132132
if err == nil {
133133
caCert, _ := certSecret.LockedData.Get("ca.crt")
134134
tlsCrt, _ := certSecret.LockedData.Get("tls.crt")

utils/utils.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,8 +1160,7 @@ func ValidatePrometheusMonitoringEndpoints(ba common.BaseComponent, client clien
11601160
}
11611161
// Error if any Secret is specified but does not exist
11621162
for _, secretName := range secretNames {
1163-
secret, err := common.GetSecret(client, secretName, namespace)
1164-
secret.LockedData.Destroy()
1163+
err := common.CheckSecret(client, secretName, namespace)
11651164
if err != nil {
11661165
errorMessage := fmt.Sprintf("Could not find Secret '%s' in this namespace.", secretName)
11671166
return errors.New(errorMessage)

0 commit comments

Comments
 (0)