diff --git a/pkg/generate/generate.go b/pkg/generate/generate.go index aab5ff1ae4..edfc12e0e9 100644 --- a/pkg/generate/generate.go +++ b/pkg/generate/generate.go @@ -247,6 +247,9 @@ func applyRule(log logr.Logger, client *dclient.Client, rule kyverno.Rule, resou newResource.SetUnstructuredContent(rdata) newResource.SetName(genName) newResource.SetNamespace(genNamespace) + if newResource.GetKind() == "" { + newResource.SetKind(genKind) + } // manage labels // - app.kubernetes.io/managed-by: kyverno