@@ -49,6 +49,8 @@ import (
49
49
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
50
50
51
51
v2 "github.com/fluxcd/helm-controller/api/v2beta2"
52
+ intdigest "github.com/fluxcd/helm-controller/internal/digest"
53
+
52
54
// +kubebuilder:scaffold:imports
53
55
54
56
intacl "github.com/fluxcd/helm-controller/internal/acl"
@@ -95,6 +97,7 @@ func main() {
95
97
oomWatchMemoryThreshold uint8
96
98
oomWatchMaxMemoryPath string
97
99
oomWatchCurrentMemoryPath string
100
+ snapshotDigestAlgo string
98
101
)
99
102
100
103
flag .StringVar (& metricsAddr , "metrics-addr" , ":8080" ,
@@ -121,6 +124,8 @@ func main() {
121
124
"The path to the cgroup memory limit file. Requires feature gate 'OOMWatch' to be enabled. If not set, the path will be automatically detected." )
122
125
flag .StringVar (& oomWatchCurrentMemoryPath , "oom-watch-current-memory-path" , "" ,
123
126
"The path to the cgroup current memory usage file. Requires feature gate 'OOMWatch' to be enabled. If not set, the path will be automatically detected." )
127
+ flag .StringVar (& snapshotDigestAlgo , "snapshot-digest-algo" , intdigest .Canonical .String (),
128
+ "The algorithm to use to calculate the digest of Helm release storage snapshots." )
124
129
125
130
clientOptions .BindFlags (flag .CommandLine )
126
131
logOptions .BindFlags (flag .CommandLine )
@@ -180,6 +185,16 @@ func main() {
180
185
// Configure the ACL policy.
181
186
intacl .AllowCrossNamespaceRef = ! aclOptions .NoCrossNamespaceRefs
182
187
188
+ // Configure the digest algorithm.
189
+ if snapshotDigestAlgo != intdigest .Canonical .String () {
190
+ algo , err := intdigest .AlgorithmForName (snapshotDigestAlgo )
191
+ if err != nil {
192
+ setupLog .Error (err , "unable to configure canonical digest algorithm" )
193
+ os .Exit (1 )
194
+ }
195
+ intdigest .Canonical = algo
196
+ }
197
+
183
198
restConfig := client .GetConfigOrDie (clientOptions )
184
199
185
200
mgrConfig := ctrl.Options {
0 commit comments