Skip to content

Commit

Permalink
use secret version as checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
m-terra committed Nov 11, 2024
1 parent ccc0040 commit 7b7af7e
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions controllers/instance/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ package instance

import (
"context"
// #nosec
"crypto/md5"
"encoding/hex"
"fmt"
"path/filepath"
"sort"
Expand Down Expand Up @@ -111,20 +108,7 @@ func (r *Reconciler) reconcileConfig(ctx context.Context, instance *proxyv1alpha
logger.Info(fmt.Sprintf("Object %s", result), "secret", configSecret.Name)
}

cs := generateChecksum(configSecret)

return cs, nil
}

// #nosec
func generateChecksum(secret *corev1.Secret) string {
var b []byte
for k := range secret.Data {
b = append(b, secret.Data[k]...)
}

hash := md5.Sum(b)
return hex.EncodeToString(hash[:])
return configSecret.ResourceVersion, nil
}

func (r *Reconciler) generateHAPProxyConfiguration(ctx context.Context, instance *proxyv1alpha1.Instance, listens *configv1alpha1.ListenList, frontends *configv1alpha1.FrontendList, backends *configv1alpha1.BackendList, resolvers *configv1alpha1.ResolverList) (string, error) {
Expand Down

0 comments on commit 7b7af7e

Please sign in to comment.