mirror of
https://github.com/wahyd4/cert-manager.git
synced 2026-08-19 01:56:11 +10:00
Use adler32 hash for acme http01 resource labels
This commit is contained in:
@@ -2,6 +2,7 @@ package http
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hash/adler32"
|
||||
|
||||
"github.com/golang/glog"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
@@ -15,13 +16,15 @@ import (
|
||||
)
|
||||
|
||||
func podLabels(ch v1alpha1.ACMEOrderChallenge) map[string]string {
|
||||
domainHash := fmt.Sprintf("%d", adler32.Checksum([]byte(ch.Domain)))
|
||||
tokenHash := fmt.Sprintf("%d", adler32.Checksum([]byte(ch.Token)))
|
||||
return map[string]string{
|
||||
// TODO: we need to support domains longer than 63 characters
|
||||
// this value should probably be hashed, and then the full plain text
|
||||
// value stored as an annotation to make it easier for users to read
|
||||
// see #425 for details: https://github.com/jetstack/cert-manager/issues/425
|
||||
domainLabelKey: ch.Domain,
|
||||
tokenLabelKey: ch.Token,
|
||||
domainLabelKey: domainHash,
|
||||
tokenLabelKey: tokenHash,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user