Skip to content

Commit

Permalink
use sha256 of key as rule ID
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbeeSo committed Apr 11, 2024
1 parent 7ec9daa commit f8689f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion workflow/artifacts/oss/oss.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package oss

import (
"crypto/sha256"
"fmt"
"io"
"math"
Expand Down Expand Up @@ -331,8 +332,9 @@ func setBucketLifecycleRule(client *oss.Client, ossArtifact *wfv1.OSSArtifact) e
Days: markDeletionAfterDays,
}

keySha := fmt.Sprintf("%x", sha256.Sum256([]byte(ossArtifact.Key)))
rule := oss.LifecycleRule{
ID: "argo-workflows-rule",
ID: keySha,
Prefix: ossArtifact.Key,
Status: string(oss.VersionEnabled),
Expiration: &expiration,
Expand Down

0 comments on commit f8689f1

Please sign in to comment.