Files
argo-cd/gitops-engine/pkg/sync/hook/helm/weight.go
Leonardo Luz Almeida bcc0243f1e prepare repo for migration to ArgoCD repo
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2025-09-23 10:05:42 -04:00

20 lines
385 B
Go

package helm
import (
"strconv"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
// note that we do not take into account if this is or is not a hook, caller should check
func Weight(obj *unstructured.Unstructured) int {
text, ok := obj.GetAnnotations()["helm.sh/hook-weight"]
if ok {
value, err := strconv.Atoi(text)
if err == nil {
return value
}
}
return 0
}