in pkg/manifests/external_dns.go [81:109]
func (rt ResourceType) generateRBACRules(dnsconfig *ExternalDnsConfig) []rbacv1.PolicyRule {
switch rt {
case ResourceTypeGateway:
ret := []rbacv1.PolicyRule{
{
APIGroups: []string{"gateway.networking.k8s.io"},
Resources: []string{"gateways", "httproutes", "grpcroutes"},
Verbs: []string{"get", "watch", "list"},
},
}
if !dnsconfig.isNamespaced {
ret = append(ret, rbacv1.PolicyRule{
APIGroups: []string{""},
Resources: []string{"namespaces"},
Verbs: []string{"get", "watch", "list"},
})
}
return ret
default:
return []rbacv1.PolicyRule{
{
APIGroups: []string{"extensions", "networking.k8s.io"},
Resources: []string{"ingresses"},
Verbs: []string{"get", "watch", "list"},
},
}
}
}