mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-04-02 14:58:48 +02:00
22 lines
436 B
Go
22 lines
436 B
Go
package syncwaves
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
|
|
|
"github.com/argoproj/gitops-engine/pkg/sync/common"
|
|
helmhook "github.com/argoproj/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)
|
|
}
|