Print warning only instead of error if no permission on ingressclass (#7578)
* skip ingressclass check if ingressclass is not enabled * reformat with gofmt
This commit is contained in:
parent
710d0db9a5
commit
6499393772
3 changed files with 27 additions and 10 deletions
|
|
@ -110,8 +110,11 @@ func main() {
|
|||
_, err = kubeClient.NetworkingV1().IngressClasses().List(context.TODO(), metav1.ListOptions{})
|
||||
if err != nil {
|
||||
if !errors.IsNotFound(err) {
|
||||
if errors.IsUnauthorized(err) || !errors.IsForbidden(err) {
|
||||
if errors.IsUnauthorized(err) {
|
||||
klog.Fatalf("Error searching IngressClass: Please verify your RBAC and allow Ingress Controller to list and get Ingress Classes: %v", err)
|
||||
} else if errors.IsForbidden(err) {
|
||||
klog.Warningf("No permissions to list and get Ingress Classes: %v, IngressClass feature will be disabled", err)
|
||||
conf.IngressClassConfiguration.IgnoreIngressClass = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue