mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
21 lines
452 B
Go
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)
|
|
}
|