argo-cd/gitops-engine/pkg/sync/syncwaves/waves.go
Leonardo Luz Almeida 0cdd44bda7
chore: fix gitops-engine mod name so it can be referenced by external repos (#26407)
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2026-02-12 09:29:40 -05:00

21 lines
452 B
Go

package syncwaves
import (
"strconv"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"github.com/argoproj/argo-cd/gitops-engine/pkg/sync/common"
helmhook "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm"
)
func Wave(obj *unstructured.Unstructured) int {
text, ok := obj.GetAnnotations()[common.AnnotationSyncWave]
if ok {
val, err := strconv.Atoi(text)
if err == nil {
return val
}
}
return helmhook.Weight(obj)
}