diff --git a/cmd/kube-rbac-proxy/app/options/proxyoptions.go b/cmd/kube-rbac-proxy/app/options/proxyoptions.go index 9d593bb5d..d2cfe30fa 100644 --- a/cmd/kube-rbac-proxy/app/options/proxyoptions.go +++ b/cmd/kube-rbac-proxy/app/options/proxyoptions.go @@ -133,8 +133,8 @@ func (o *ProxyOptions) ApplyTo(krpInfo *server.KubeRBACProxyInfo, authInfo *serv return fmt.Errorf("failed to setup transport for upstream: %w", err) } - if configFileName := o.AuthzConfigFileName; len(configFileName) > 0 { - krpInfo.Authorization, err = parseAuthorizationConfigFile(configFileName) + if len(o.AuthzConfigFileName) > 0 { + krpInfo.Authorization, err = parseAuthorizationConfigFile(o.AuthzConfigFileName) if err != nil { return fmt.Errorf("failed to read the config file: %w", err) }