2022-03-21 12:41:53 +00:00
|
|
|
package webhookconfig
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2022-05-09 16:31:35 +02:00
|
|
|
kyverno "github.com/kyverno/kyverno/api/kyverno/v1"
|
2022-03-21 12:41:53 +00:00
|
|
|
"gotest.tools/assert"
|
|
|
|
)
|
|
|
|
|
2022-05-09 16:31:35 +02:00
|
|
|
func Test_webhook_isEmpty(t *testing.T) {
|
|
|
|
empty := newWebhook(kindMutating, DefaultWebhookTimeout, kyverno.Ignore)
|
|
|
|
assert.Equal(t, empty.isEmpty(), true)
|
|
|
|
notEmpty := newWebhook(kindMutating, DefaultWebhookTimeout, kyverno.Ignore)
|
|
|
|
setWildcardConfig(notEmpty)
|
|
|
|
assert.Equal(t, notEmpty.isEmpty(), false)
|
2022-03-21 12:41:53 +00:00
|
|
|
}
|