argo-cd/gitops-engine/pkg/sync/hook/helm/hook_test.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

16 lines
511 B
Go

package helm
import (
"testing"
"github.com/stretchr/testify/assert"
testingutils "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/testing"
)
func TestIsHook(t *testing.T) {
assert.False(t, IsHook(testingutils.NewPod()))
assert.True(t, IsHook(testingutils.Annotate(testingutils.NewPod(), "helm.sh/hook", "anything")))
// helm calls "crd-install" a hook, but it really can't be treated as such
assert.False(t, IsHook(testingutils.Annotate(testingutils.NewCRD(), "helm.sh/hook", "crd-install")))
}